Search in sources :

Example 1 with CompositionTestDataSimSDTJson

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

the class FlatJsonTest method roundTripVitalSigns.

@Test
public void roundTripVitalSigns() throws IOException {
    CompositionTestDataSimSDTJson testData = CompositionTestDataSimSDTJson.VITALSIGNS;
    String templateId = "EHRN Vital signs.v2";
    check(templateId, testData, new String[] {}, new String[] {});
}
Also used : CompositionTestDataSimSDTJson(org.ehrbase.test_data.composition.CompositionTestDataSimSDTJson) Test(org.junit.Test)

Example 2 with CompositionTestDataSimSDTJson

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

the class FlatJsonTest method roundMultiList.

@Test
public void roundMultiList() throws IOException {
    CompositionTestDataSimSDTJson testData = CompositionTestDataSimSDTJson.MULTI_LIST;
    String templateId = OperationalTemplateTestData.MULTI_LIST.getTemplateId();
    check(templateId, testData, new String[] {}, new String[] {});
}
Also used : CompositionTestDataSimSDTJson(org.ehrbase.test_data.composition.CompositionTestDataSimSDTJson) Test(org.junit.Test)

Example 3 with CompositionTestDataSimSDTJson

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

the class FlatJsonTest method roundTripMissingCount.

@Test
public void roundTripMissingCount() throws IOException {
    String templateId = "ehrbase_multi_occurrence.de.v1";
    CompositionTestDataSimSDTJson testData = CompositionTestDataSimSDTJson.MISSING_COUNT;
    String[] expectedMissing = { "Missing path: encounter/body_temperature:0/any_event:0/temperature|magnitude, value: 22.0", "Missing path: encounter/body_temperature:1/any_event:0/temperature|magnitude, value: 22.0", "Missing path: encounter/body_temperature:1/any_event:1/temperature|magnitude, value: 11.0", "Missing path: encounter/body_temperature:0/any_event:0/temperature|unit, value: Cel", "Missing path: encounter/body_temperature:0/any_event:0/body_exposure|terminology, value: local", "Missing path: encounter/body_temperature:0/any_event:0/body_exposure|value, value: Appropriate clothing/bedding", "Missing path: encounter/body_temperature:0/any_event:0/body_exposure|code, value: at0033", "Missing path: encounter/body_temperature:0/any_event:0/current_day_of_menstrual_cycle, value: 3", "Missing path: encounter/body_temperature:0/any_event:0/time, value: 2020-10-06T13:30:34.328873+02:00" };
    String[] expectedExtra = { "Extra path: encounter/body_temperature:0/any_event/temperature|magnitude, value: 22", "Extra path: encounter/body_temperature:0/any_event/temperature|unit, value: Cel", "Extra path: encounter/body_temperature:0/any_event/body_exposure|code, value: at0033", "Extra path: encounter/body_temperature:0/any_event/body_exposure|value, value: Appropriate clothing/bedding", "Extra path: encounter/body_temperature:0/any_event/body_exposure|terminology, value: local", "Extra path: encounter/body_temperature:0/any_event/current_day_of_menstrual_cycle, value: 3", "Extra path: encounter/body_temperature:0/any_event/time, value: 2020-10-06T13:30:34.328873+02:00", "Extra path: encounter/body_temperature:1/any_event:0/temperature|magnitude, value: 22", "Extra path: encounter/body_temperature:1/any_event:1/temperature|magnitude, value: 11" };
    check(templateId, testData, expectedMissing, expectedExtra);
}
Also used : CompositionTestDataSimSDTJson(org.ehrbase.test_data.composition.CompositionTestDataSimSDTJson) Test(org.junit.Test)

Example 4 with CompositionTestDataSimSDTJson

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

the class FlatJsonTest method roundTripMulti.

@Test
public void roundTripMulti() throws IOException {
    String templateId = "ehrbase_multi_occurrence.de.v1";
    CompositionTestDataSimSDTJson testData = CompositionTestDataSimSDTJson.MULTI_OCCURRENCE;
    String[] expectedMissing = { "Missing path: encounter/body_temperature:0/any_event:0/temperature|magnitude, value: 22.0", "Missing path: encounter/body_temperature:0/any_event:1/temperature|magnitude, value: 11.0", "Missing path: encounter/body_temperature:1/any_event:0/temperature|magnitude, value: 22.0", "Missing path: encounter/body_temperature:1/any_event:1/temperature|magnitude, value: 11.0" };
    String[] expectedExtra = { "Extra path: encounter/body_temperature:0/any_event:0/temperature|magnitude, value: 22", "Extra path: encounter/body_temperature:0/any_event:1/temperature|magnitude, value: 11", "Extra path: encounter/body_temperature:1/any_event:0/temperature|magnitude, value: 22", "Extra path: encounter/body_temperature:1/any_event:1/temperature|magnitude, value: 11" };
    check(templateId, testData, expectedMissing, expectedExtra);
}
Also used : CompositionTestDataSimSDTJson(org.ehrbase.test_data.composition.CompositionTestDataSimSDTJson) Test(org.junit.Test)

Example 5 with CompositionTestDataSimSDTJson

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

the class FlatJsonTest method roundTripAll.

@Test
public void roundTripAll() throws IOException {
    String templateId = "test_all_types.en.v1";
    CompositionTestDataSimSDTJson testData = CompositionTestDataSimSDTJson.ALL_TYPES;
    String[] expectedMissing = { "Missing path: test_all_types/test_all_types:0/identifier|id, value: 55175056", "Missing path: test_all_types/test_all_types:0/proportion_any|type, value: 1" };
    String[] expectedExtra = { "Extra path: test_all_types/test_all_types:0/identifier, value: 55175056", "Extra path: test_all_types/test_all_types:0/proportion_any|type, value: 1.0" };
    check(templateId, testData, expectedMissing, expectedExtra);
}
Also used : CompositionTestDataSimSDTJson(org.ehrbase.test_data.composition.CompositionTestDataSimSDTJson) Test(org.junit.Test)

Aggregations

CompositionTestDataSimSDTJson (org.ehrbase.test_data.composition.CompositionTestDataSimSDTJson)21 Test (org.junit.Test)21 CompositionTestDataStructuredJson (org.ehrbase.test_data.composition.CompositionTestDataStructuredJson)5 IOException (java.io.IOException)4 StandardCharsets (java.nio.charset.StandardCharsets)4 List (java.util.List)4 IOUtils (org.apache.commons.io.IOUtils)4 SoftAssertions (org.assertj.core.api.SoftAssertions)4 RMDataFormat (org.ehrbase.serialisation.RMDataFormat)4 FlatJsonMarshallerTest.compere (org.ehrbase.serialisation.flatencoding.std.marshal.FlatJsonMarshallerTest.compere)4 TestDataTemplateProvider (org.ehrbase.serialisation.templateprovider.TestDataTemplateProvider)4 OperationalTemplateTestData (org.ehrbase.test_data.operationaltemplate.OperationalTemplateTestData)4 Composition (com.nedap.archie.rm.composition.Composition)3 ArchieRMInfoLookup (com.nedap.archie.rminfo.ArchieRMInfoLookup)3 RMObjectValidator (com.nedap.archie.rmobjectvalidator.RMObjectValidator)3 FlatFormat (org.ehrbase.serialisation.flatencoding.FlatFormat)1 FlatJasonProvider (org.ehrbase.serialisation.flatencoding.FlatJasonProvider)1 JSONAssert (org.skyscreamer.jsonassert.JSONAssert)1 JSONCompareMode (org.skyscreamer.jsonassert.JSONCompareMode)1