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();
}
}
Aggregations