Search in sources :

Example 1 with MinimalEvaluationEnV1Composition

use of org.ehrbase.client.classgenerator.examples.minimalevaluationenv1composition.MinimalEvaluationEnV1Composition in project openEHR_SDK by ehrbase.

the class NumericTestsIT method setUp.

@Before
public void setUp() throws IOException {
    super.setUp(null);
    // build a number of compositions with different DvQuantity values and different names
    aComposition = new CanonicalJson().unmarshal(IOUtils.toString(CompositionTestDataCanonicalJson.MINIMAL_EVAL.getStream(), StandardCharsets.UTF_8), Composition.class);
    for (int i = 0; i < 10; i++) {
        Element element = (Element) aComposition.itemsAtPath("/content[openEHR-EHR-EVALUATION.minimal.v1]/data[at0001]/items[at0002]").get(0);
        element.setValue(new DvQuantity("kg", Double.valueOf("" + (i + 1)), 0L));
        element.setName(new DvText("value-" + i + 1));
        Flattener flattener = new Flattener(new TestDataTemplateProvider());
        MinimalEvaluationEnV1Composition minimalEvaluationEnV1Composition = flattener.flatten(aComposition, MinimalEvaluationEnV1Composition.class);
        // create the composition
        MinimalEvaluationEnV1Composition comp = compositionEndpoint.mergeCompositionEntity(minimalEvaluationEnV1Composition);
    }
    numericQuery = new NumericQuery(ehrUUID, openEhrClient);
}
Also used : NumericQuery(org.ehrbase.client.openehrclient.defaultrestclient.systematic.compositionquery.queries.arbitrary.NumericQuery) CanonicalJson(org.ehrbase.serialisation.jsonencoding.CanonicalJson) CompositionTestDataCanonicalJson(org.ehrbase.test_data.composition.CompositionTestDataCanonicalJson) Composition(com.nedap.archie.rm.composition.Composition) MinimalEvaluationEnV1Composition(org.ehrbase.client.classgenerator.examples.minimalevaluationenv1composition.MinimalEvaluationEnV1Composition) DvQuantity(com.nedap.archie.rm.datavalues.quantity.DvQuantity) Element(com.nedap.archie.rm.datastructures.Element) Flattener(org.ehrbase.client.flattener.Flattener) MinimalEvaluationEnV1Composition(org.ehrbase.client.classgenerator.examples.minimalevaluationenv1composition.MinimalEvaluationEnV1Composition) DvText(com.nedap.archie.rm.datavalues.DvText) TestDataTemplateProvider(org.ehrbase.client.templateprovider.TestDataTemplateProvider) Before(org.junit.Before)

Aggregations

Composition (com.nedap.archie.rm.composition.Composition)1 Element (com.nedap.archie.rm.datastructures.Element)1 DvText (com.nedap.archie.rm.datavalues.DvText)1 DvQuantity (com.nedap.archie.rm.datavalues.quantity.DvQuantity)1 MinimalEvaluationEnV1Composition (org.ehrbase.client.classgenerator.examples.minimalevaluationenv1composition.MinimalEvaluationEnV1Composition)1 Flattener (org.ehrbase.client.flattener.Flattener)1 NumericQuery (org.ehrbase.client.openehrclient.defaultrestclient.systematic.compositionquery.queries.arbitrary.NumericQuery)1 TestDataTemplateProvider (org.ehrbase.client.templateprovider.TestDataTemplateProvider)1 CanonicalJson (org.ehrbase.serialisation.jsonencoding.CanonicalJson)1 CompositionTestDataCanonicalJson (org.ehrbase.test_data.composition.CompositionTestDataCanonicalJson)1 Before (org.junit.Before)1