Search in sources :

Example 1 with Ehr

use of com.nedap.archie.rm.ehr.Ehr in project openEHR_SDK by ehrbase.

the class CanonicalJsonMarshallingTest method marshallEhr.

@Test
public void marshallEhr() {
    List<ObjectRef<? extends ObjectId>> compositions = new ArrayList<>();
    compositions.add(new ObjectRef<>(new HierObjectId("COMPOSITION"), "local", "b5c4aaed-2adc-4c56-9005-e21ff3cca62a::local.ehrbase.org::2"));
    List<ObjectRef<? extends ObjectId>> contributions = new ArrayList<>();
    contributions.add(new ObjectRef<>(new HierObjectId("COMPOSITION"), "local", "b5c4aaed-2adc-4c56-9005-e21ff3cca62a::local.ehrbase.org::2"));
    List<ObjectRef<? extends ObjectId>> folders = new ArrayList<>();
    folders.add(new ObjectRef<>(new HierObjectId("COMPOSITION"), "local", "b5c4aaed-2adc-4c56-9005-e21ff3cca62a::local.ehrbase.org::2"));
    Ehr expected = new Ehr();
    expected.setCompositions(compositions);
    expected.setContributions(contributions);
    expected.setFolders(folders);
    CanonicalJson cut = new CanonicalJson();
    String json = cut.marshal(expected);
    Ehr actual = cut.unmarshal(json, Ehr.class);
    Assert.assertEquals(actual, expected);
}
Also used : ObjectId(com.nedap.archie.rm.support.identification.ObjectId) HierObjectId(com.nedap.archie.rm.support.identification.HierObjectId) ArrayList(java.util.ArrayList) ObjectRef(com.nedap.archie.rm.support.identification.ObjectRef) HierObjectId(com.nedap.archie.rm.support.identification.HierObjectId) Ehr(com.nedap.archie.rm.ehr.Ehr) Test(org.junit.Test)

Aggregations

Ehr (com.nedap.archie.rm.ehr.Ehr)1 HierObjectId (com.nedap.archie.rm.support.identification.HierObjectId)1 ObjectId (com.nedap.archie.rm.support.identification.ObjectId)1 ObjectRef (com.nedap.archie.rm.support.identification.ObjectRef)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1