use of org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition in project openEHR_SDK by ehrbase.
the class UnflattenerTest method testUnflattenInterval.
@Test
public void testUnflattenInterval() {
TestDataTemplateProvider templateProvider = new TestDataTemplateProvider();
Unflattener cut = new Unflattener(templateProvider);
TestAllTypesEnV1Composition dto = buildTestAllTypesEnV1Composition();
Composition rmObject = (Composition) cut.unflatten(dto);
assertThat(rmObject).isNotNull();
assertThat(rmObject.itemAtPath("/content[openEHR-EHR-EVALUATION.test_all_types.v1]/data[at0001]/items[at0003]/value/upper_included")).isEqualTo(true);
TestAllTypesEnV1Composition actual = new Flattener(new TestDataTemplateProvider()).flatten(rmObject, TestAllTypesEnV1Composition.class);
assertThat(actual.getTestAllTypes2().get(0).isIntervalCountUpperIncluded()).isTrue();
}
use of org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition in project openEHR_SDK by ehrbase.
the class TestData method buildTestAllTypesEnV1Composition.
public static TestAllTypesEnV1Composition buildTestAllTypesEnV1Composition() {
TestAllTypesEnV1Composition composition = new TestAllTypesEnV1Composition();
composition.setTestAllTypes2(new ArrayList<>());
TestAllTypesEvaluation evaluation = new TestAllTypesEvaluation();
composition.getTestAllTypes2().add(evaluation);
evaluation.setIntervalCountLowerIncluded(true);
evaluation.setIntervalCountUpperIncluded(true);
evaluation.setUpperMagnitude(20l);
evaluation.setLowerMagnitude(10l);
return composition;
}
use of org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition in project openEHR_SDK by ehrbase.
the class ArbitraryQueryFeederAuditIT method setUp.
@Before
public void setUp() throws IOException {
ehrUUID = openEhrClient.ehrEndpoint().createEhr();
compositionEndpoint = openEhrClient.compositionEndpoint(ehrUUID);
aComposition = new CanonicalJson().unmarshal(IOUtils.toString(CompositionTestDataCanonicalJson.FEEDER_AUDIT_DETAILS.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();
arbitraryQuery = new ArbitraryQuery(ehrUUID, openEhrClient);
}
use of org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition 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