use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class ToCompositionWalker method extractRMChild.
@Override
protected Object extractRMChild(RMObject currentRM, WebTemplateNode currentNode, WebTemplateNode childNode, boolean isChoice, Integer count) {
Object newChild = WebTemplateSkeletonBuilder.build(childNode, false, Object.class);
WebTemplateSkeletonBuilder.insert(currentNode, currentRM, childNode, newChild);
return wrap(newChild);
}
use of com.nedap.archie.rm.RMObject in project fhir-bridge by ehrbase.
the class CompositionProducer method debugMapping.
private void debugMapping(CompositionEntity composition) {
ResourceTemplateProvider resourceTemplateProvider = new ResourceTemplateProvider("classpath:/opt/");
resourceTemplateProvider.afterPropertiesSet();
Unflattener unflattener = new Unflattener(resourceTemplateProvider);
RMObject rmObject = unflattener.unflatten(composition);
CanonicalJson canonicalJson = new CanonicalJson();
String compositionJson = canonicalJson.marshal(rmObject);
writeToFile(compositionJson);
}
use of com.nedap.archie.rm.RMObject in project fhir-bridge by ehrbase.
the class AbstractMappingTestSetupIT method compareCompositions.
public Diff compareCompositions(Javers javers, String paragonFilePath, CompositionEntity mappedComposition) throws IOException {
RMObject composition = new CanonicalJson().unmarshal(testFileLoader.loadResourceToString(paragonFilePath), com.nedap.archie.rm.composition.Composition.class);
ResourceTemplateProvider resourceTemplateProvider = new ResourceTemplateProvider("classpath:/opt/");
resourceTemplateProvider.afterPropertiesSet();
Flattener cut = new Flattener(resourceTemplateProvider);
CompositionEntity paragonComposition = cut.flatten(composition, mappedComposition.getClass());
Diff diff = javers.compare(paragonComposition, mappedComposition);
diff.getChanges().forEach(System.out::println);
return diff;
}
use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class CanonicalUtil method toRmObjectList.
public static List<RMObject> toRmObjectList(List<Object> rmObjectListAsMap) {
List<RMObject> objects = new ArrayList<>();
for (Object item : rmObjectListAsMap) {
if (item instanceof Map) {
Map<String, Object> mappedObject = (Map<String, Object>) item;
// get the type
String type = (String) mappedObject.get(AT_TYPE);
Class rmClass = ArchieRMInfoLookup.getInstance().getClass(type);
RMObject rmObject = toRmObject(mappedObject, rmClass);
objects.add(rmObject);
}
}
return objects;
}
use of com.nedap.archie.rm.RMObject in project openEHR_SDK by ehrbase.
the class CanonicalUtil method compareArbitraryRmClass.
public static Object compareArbitraryRmClass(Map<String, Object> anRmObjectAsMap, Class rmClass, RMObject compareExpectedObject) {
RMObject actualRmObject = toRmObject(anRmObjectAsMap, rmClass);
assertThat(actualRmObject).isEqualTo(compareExpectedObject);
return null;
}
Aggregations