Search in sources :

Example 1 with CompositionTestDataCanonicalJson

use of org.ehrbase.test_data.composition.CompositionTestDataCanonicalJson in project openEHR_SDK by ehrbase.

the class CanonicalCompoAllTypeQueryIT method setUp.

public void setUp(CompositionTestDataCanonicalJson testComposition) throws IOException {
    // manual test use
    // ehrUUID = UUID.fromString("ecc0de4d-eb29-40c2-ad7a-e2ab8d66a9f8");
    // compositionUUID = UUID.fromString("a9c22c37-8002-4486-932a-f3e1729efe57");
    actualDvDateTime = new DvDateTime(OffsetDateTime.now());
    // normal test run
    ehrUUID = openEhrClient.ehrEndpoint().createEhr();
    compositionEndpoint = openEhrClient.compositionEndpoint(ehrUUID);
    if (testComposition != null) {
        aComposition = new CanonicalJson().unmarshal(IOUtils.toString(testComposition.getStream(), StandardCharsets.UTF_8), Composition.class);
        Flattener flattener = new Flattener(new TestDataTemplateProvider());
        TestAllTypesEnV1Composition testAllTypesEnV1Composition = flattener.flatten(aComposition, TestAllTypesEnV1Composition.class);
        // create the composition
        TestAllTypesEnV1Composition comp = compositionEndpoint.mergeCompositionEntity(testAllTypesEnV1Composition);
        compositionUUID = comp.getVersionUid().getUuid();
    }
}
Also used : CanonicalJson(org.ehrbase.serialisation.jsonencoding.CanonicalJson) CompositionTestDataCanonicalJson(org.ehrbase.test_data.composition.CompositionTestDataCanonicalJson) Composition(com.nedap.archie.rm.composition.Composition) TestAllTypesEnV1Composition(org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition) Flattener(org.ehrbase.client.flattener.Flattener) TestAllTypesEnV1Composition(org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition) DvDateTime(com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime) TestDataTemplateProvider(org.ehrbase.client.templateprovider.TestDataTemplateProvider)

Aggregations

Composition (com.nedap.archie.rm.composition.Composition)1 DvDateTime (com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime)1 TestAllTypesEnV1Composition (org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition)1 Flattener (org.ehrbase.client.flattener.Flattener)1 TestDataTemplateProvider (org.ehrbase.client.templateprovider.TestDataTemplateProvider)1 CanonicalJson (org.ehrbase.serialisation.jsonencoding.CanonicalJson)1 CompositionTestDataCanonicalJson (org.ehrbase.test_data.composition.CompositionTestDataCanonicalJson)1