This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/release/0.6.0' into main
- Loading branch information
Showing
277 changed files
with
6,926 additions
and
3,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/json/ObjectMapperFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.highmed.dsf.fhir.json; | ||
|
||
import org.highmed.dsf.fhir.variables.FhirResourceJacksonDeserializer; | ||
import org.highmed.dsf.fhir.variables.FhirResourceJacksonSerializer; | ||
import org.highmed.openehr.json.OpenEhrObjectMapperFactory; | ||
import org.hl7.fhir.r4.model.Resource; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import com.fasterxml.jackson.databind.MapperFeature; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.json.JsonMapper; | ||
import com.fasterxml.jackson.databind.module.SimpleModule; | ||
|
||
import ca.uhn.fhir.context.FhirContext; | ||
|
||
public class ObjectMapperFactory | ||
{ | ||
private ObjectMapperFactory() | ||
{ | ||
} | ||
|
||
public static ObjectMapper createObjectMapper(FhirContext fhirContext) | ||
{ | ||
return JsonMapper.builder().serializationInclusion(Include.NON_NULL).serializationInclusion(Include.NON_EMPTY) | ||
.addModule(fhirModule(fhirContext)).addModule(OpenEhrObjectMapperFactory.openEhrModule()) | ||
.disable(MapperFeature.AUTO_DETECT_CREATORS).disable(MapperFeature.AUTO_DETECT_FIELDS) | ||
// .disable(MapperFeature.AUTO_DETECT_GETTERS).disable(MapperFeature.AUTO_DETECT_IS_GETTERS) | ||
.disable(MapperFeature.AUTO_DETECT_SETTERS).build(); | ||
} | ||
|
||
public static SimpleModule fhirModule(FhirContext fhirContext) | ||
{ | ||
return new SimpleModule().addSerializer(Resource.class, new FhirResourceJacksonSerializer(fhirContext)) | ||
.addDeserializer(Resource.class, new FhirResourceJacksonDeserializer(fhirContext)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.