use of com.nedap.archie.json.RMJacksonConfiguration in project openEHR_SDK by ehrbase.
the class JacksonUtil method getObjectMapper.
/**
* Get an object mapper that works with Archie RM and AOM objects. It will be cached in a static variable for
* performance reasons
*
* @return
*/
public static ObjectMapper getObjectMapper() {
RMJacksonConfiguration configuration = new RMJacksonConfiguration();
configuration.setAddExtraFieldsInArchetypeId(false);
configuration.setTypePropertyName("_type");
configuration.setSerializeEmptyCollections(true);
return com.nedap.archie.json.JacksonUtil.getObjectMapper(configuration);
}
use of com.nedap.archie.json.RMJacksonConfiguration in project openEHR_SDK by ehrbase.
the class ItemStructureVisitorTest method ehrVisitorTest.
@Test
public void ehrVisitorTest() throws Throwable {
String value = IOUtils.toString(ItemStruktureTestDataCanonicalJson.SIMPLE_EHR_OTHER_Details.getStream(), UTF_8);
RMJacksonConfiguration configuration = new RMJacksonConfiguration();
configuration.setTypePropertyName("_type");
ObjectMapper objectMapper = JacksonUtil.getObjectMapper(configuration);
ItemTree otherDetails = objectMapper.readValue(value, ItemTree.class);
EhrStatus ehrStatus = new EhrStatus("ehr_status", new DvText("ehr_status"), new PartySelf(new PartyRef()), true, true, otherDetails);
itemStructureVisitor.validate(ehrStatus);
assertEquals(3, itemStructureVisitor.getElementOccurrences());
}
Aggregations