Search in sources :

Example 1 with TestAllTypesEnV1Composition

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();
}
Also used : Composition(com.nedap.archie.rm.composition.Composition) EhrbaseBloodPressureSimpleDeV0Composition(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0Composition) EhrbaseMultiOccurrenceDeV1Composition(org.ehrbase.client.classgenerator.examples.ehrbasemultioccurrencedev1composition.EhrbaseMultiOccurrenceDeV1Composition) KorpergrosseComposition(org.ehrbase.client.classgenerator.examples.korpergrossecomposition.KorpergrosseComposition) EpisodeOfCareComposition(org.ehrbase.client.classgenerator.examples.episodeofcarecomposition.EpisodeOfCareComposition) AlternativeEventsComposition(org.ehrbase.client.classgenerator.examples.alternativeeventscomposition.AlternativeEventsComposition) BefundDerBlutgasanalyseComposition(org.ehrbase.client.classgenerator.examples.befundderblutgasanalysecomposition.BefundDerBlutgasanalyseComposition) TestAllTypesEnV1Composition(org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition) CoronaAnamneseComposition(org.ehrbase.client.classgenerator.examples.coronaanamnesecomposition.CoronaAnamneseComposition) TestAllTypesEnV1Composition(org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition) TestDataTemplateProvider(org.ehrbase.client.templateprovider.TestDataTemplateProvider) Test(org.junit.Test)

Example 2 with TestAllTypesEnV1Composition

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;
}
Also used : TestAllTypesEvaluation(org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.definition.TestAllTypesEvaluation) TestAllTypesEnV1Composition(org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition)

Example 3 with TestAllTypesEnV1Composition

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);
}
Also used : ArbitraryQuery(org.ehrbase.client.openehrclient.defaultrestclient.systematic.compositionquery.queries.arbitrary.ArbitraryQuery) 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) TestDataTemplateProvider(org.ehrbase.client.templateprovider.TestDataTemplateProvider) Before(org.junit.Before)

Example 4 with TestAllTypesEnV1Composition

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

TestAllTypesEnV1Composition (org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.TestAllTypesEnV1Composition)4 Composition (com.nedap.archie.rm.composition.Composition)3 TestDataTemplateProvider (org.ehrbase.client.templateprovider.TestDataTemplateProvider)3 Flattener (org.ehrbase.client.flattener.Flattener)2 CanonicalJson (org.ehrbase.serialisation.jsonencoding.CanonicalJson)2 CompositionTestDataCanonicalJson (org.ehrbase.test_data.composition.CompositionTestDataCanonicalJson)2 DvDateTime (com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime)1 AlternativeEventsComposition (org.ehrbase.client.classgenerator.examples.alternativeeventscomposition.AlternativeEventsComposition)1 BefundDerBlutgasanalyseComposition (org.ehrbase.client.classgenerator.examples.befundderblutgasanalysecomposition.BefundDerBlutgasanalyseComposition)1 CoronaAnamneseComposition (org.ehrbase.client.classgenerator.examples.coronaanamnesecomposition.CoronaAnamneseComposition)1 EhrbaseBloodPressureSimpleDeV0Composition (org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0Composition)1 EhrbaseMultiOccurrenceDeV1Composition (org.ehrbase.client.classgenerator.examples.ehrbasemultioccurrencedev1composition.EhrbaseMultiOccurrenceDeV1Composition)1 EpisodeOfCareComposition (org.ehrbase.client.classgenerator.examples.episodeofcarecomposition.EpisodeOfCareComposition)1 KorpergrosseComposition (org.ehrbase.client.classgenerator.examples.korpergrossecomposition.KorpergrosseComposition)1 TestAllTypesEvaluation (org.ehrbase.client.classgenerator.examples.testalltypesenv1composition.definition.TestAllTypesEvaluation)1 ArbitraryQuery (org.ehrbase.client.openehrclient.defaultrestclient.systematic.compositionquery.queries.arbitrary.ArbitraryQuery)1 Before (org.junit.Before)1 Test (org.junit.Test)1