diff --git a/pom.xml b/pom.xml
index 95a8dc5c..739f8099 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,7 +108,6 @@
jjwt
${jjwt.version}
-
junit
@@ -116,7 +115,7 @@
${junit.version}
test
-
+
org.ehrbase.openehr.sdk
@@ -133,7 +132,7 @@
web-template
${ehrbase.version}
-
+
@@ -241,7 +240,7 @@
com.github.java-json-tools
json-schema-validator
-
+
org.pf4j
pf4j
3.11.0
@@ -251,6 +250,12 @@
openfhir-plugin-api
1.0.0
+
+ org.skyscreamer
+ jsonassert
+ 2.0-rc1
+ test
+
diff --git a/src/test/java/com/medblocks/openfhir/StandardsAsserter.java b/src/test/java/com/medblocks/openfhir/StandardsAsserter.java
new file mode 100644
index 00000000..f8d99021
--- /dev/null
+++ b/src/test/java/com/medblocks/openfhir/StandardsAsserter.java
@@ -0,0 +1,49 @@
+package com.medblocks.openfhir;
+
+import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.parser.IParser;
+import com.google.gson.*;
+import com.nedap.archie.rm.composition.Composition;
+import org.ehrbase.openehr.sdk.serialisation.jsonencoding.CanonicalJson;
+import org.hl7.fhir.r4.model.Bundle;
+import org.json.JSONObject;
+import org.junit.Assert;
+import org.skyscreamer.jsonassert.JSONAssert;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+
+public class StandardsAsserter {
+
+ private static final Gson GSON = new Gson();
+
+ public void assertComposition(Composition composition, String expectedClasspathJson) {
+ JSONObject actual = new JSONObject(new CanonicalJson().marshal(composition));
+ JSONObject expected = loadJsonObject(expectedClasspathJson);
+ JSONAssert.assertEquals(expected, actual, true);
+ }
+
+ public void assertBundle(Bundle bundle, String expectedClasspathJson) {
+ FhirContext ctx = FhirContext.forR4();
+ IParser parser = ctx.newJsonParser();
+ JSONObject actual = new JSONObject(parser.encodeResourceToString(bundle));
+
+ JSONObject expected = loadJsonObject(expectedClasspathJson);
+
+ JSONAssert.assertEquals(expected, actual, true);
+
+ }
+
+ private JSONObject loadJsonObject(String classpathLocation) {
+ InputStream is = getClass().getResourceAsStream(classpathLocation);
+ try {
+ String json = new String(is.readAllBytes(), StandardCharsets.UTF_8);
+ return new JSONObject(json);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse JSON file", e);
+ }
+ }
+
+}
diff --git a/src/test/java/com/medblocks/openfhir/kds/KdsBidirectionalTest.java b/src/test/java/com/medblocks/openfhir/kds/KdsBidirectionalTest.java
index a30633c9..c60d58ea 100644
--- a/src/test/java/com/medblocks/openfhir/kds/KdsBidirectionalTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/KdsBidirectionalTest.java
@@ -7,6 +7,7 @@
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.StandardsAsserter;
import com.medblocks.openfhir.OpenEhrRmWorker;
import com.medblocks.openfhir.TestOpenFhirMappingContext;
import com.medblocks.openfhir.fc.schema.context.FhirConnectContext;
@@ -29,9 +30,8 @@
import jakarta.annotation.Nullable;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.TimeZone;
+import java.util.*;
+
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.ehrbase.openehr.sdk.serialisation.flatencoding.std.marshal.FlatJsonMarshaller;
@@ -47,7 +47,7 @@
import org.openehr.schemas.v1.OPERATIONALTEMPLATE;
import org.openehr.schemas.v1.TemplateDocument;
import org.springframework.http.ResponseEntity;
-import org.yaml.snakeyaml.Yaml;
+
@Slf4j
public abstract class KdsBidirectionalTest {
@@ -57,27 +57,28 @@ public abstract class KdsBidirectionalTest {
* to automatically be created against a running (by yourself) EHRBase instance. Meant for an integration
* test and implicit validation of the mapped Composition.
*/
- final boolean TEST_AGAINST_EHRBASE = false;
- final String EHRBASE_BASIC_USERNAME = "ehrbase-user";
- final String EHRBASE_BASIC_PASSWORD = "SuperSecretPassword";
- final String EHRBASE_HOST = "http://localhost:8081";
+ public final boolean TEST_AGAINST_EHRBASE = false;
+ public final String EHRBASE_BASIC_USERNAME = "ehrbase-user";
+ public final String EHRBASE_BASIC_PASSWORD = "SuperSecretPassword";
+ public final String EHRBASE_HOST = "http://localhost:8081";
- final OpenFhirStringUtils openFhirStringUtils = new OpenFhirStringUtils();
- final OpenFhirMapperUtils openFhirMapperUtils = new OpenFhirMapperUtils();
- final FhirConnectModelMerger fhirConnectModelMerger = new FhirConnectModelMerger();
- final FhirPathR4 fhirPath = new FhirPathR4(FhirContext.forR4());
- final JsonParser jsonParser = (JsonParser) FhirContext.forR4().newJsonParser();
+ public final OpenFhirStringUtils openFhirStringUtils = new OpenFhirStringUtils();
+ public final OpenFhirMapperUtils openFhirMapperUtils = new OpenFhirMapperUtils();
+ public final FhirConnectModelMerger fhirConnectModelMerger = new FhirConnectModelMerger();
+ public final FhirPathR4 fhirPath = new FhirPathR4(FhirContext.forR4());
+ public final JsonParser jsonParser = (JsonParser) FhirContext.forR4().newJsonParser();
- TestOpenFhirMappingContext repo;
- OpenEhrToFhir openEhrToFhir;
- FhirToOpenEhr fhirToOpenEhr;
+ public TestOpenFhirMappingContext repo;
+ public OpenEhrToFhir openEhrToFhir;
+ public FhirToOpenEhr fhirToOpenEhr;
- FhirConnectContext context;
- OPERATIONALTEMPLATE operationaltemplate;
- String operationaltemplateSerialized;
- WebTemplate webTemplate;
+ public FhirConnectContext context;
+ public OPERATIONALTEMPLATE operationaltemplate;
+ public String operationaltemplateSerialized;
+ public WebTemplate webTemplate;
+ public StandardsAsserter standardsAsserter = new StandardsAsserter();
- protected abstract void prepareState();
+ public abstract void prepareState();
@Before
public void init() {
@@ -152,13 +153,13 @@ public void toOpenEhrTest() {
}
}
- protected abstract JsonObject toOpenEhr();
+ public abstract JsonObject toOpenEhr();
- protected boolean testAgainstEhrBase() {
+ boolean testAgainstEhrBase() {
return TEST_AGAINST_EHRBASE;
}
- protected String getFlat(final String path) {
+ protected String getFile(final String path) {
final InputStream inputStream = this.getClass().getResourceAsStream(path);
try {
return IOUtils.toString(inputStream);
@@ -167,7 +168,7 @@ protected String getFlat(final String path) {
}
}
- protected void compareJsonObjects(final JsonObject initial, final JsonObject expected) {
+ public void compareJsonObjects(final JsonObject initial, final JsonObject expected) {
for (Map.Entry initialEntrySet : expected.entrySet()) {
final String initialKey = initialEntrySet.getKey();
final String initialValue = initialEntrySet.getValue().getAsString();
@@ -179,12 +180,12 @@ protected void compareJsonObjects(final JsonObject initial, final JsonObject exp
}
}
- protected org.hl7.fhir.r4.model.Bundle getTestBundle(final String path) {
+ public org.hl7.fhir.r4.model.Bundle getTestBundle(final String path) {
final InputStream inputStream = this.getClass().getResourceAsStream(path);
return (org.hl7.fhir.r4.model.Bundle) jsonParser.parseResource(inputStream);
}
- protected FhirConnectContext getContext(final String path) {
+ public FhirConnectContext getContext(final String path) {
final ObjectMapper yaml = OpenFhirTestUtility.getYaml();
final InputStream inputStream = this.getClass().getResourceAsStream(path);
try {
@@ -194,11 +195,12 @@ protected FhirConnectContext getContext(final String path) {
}
}
- protected OPERATIONALTEMPLATE getOperationalTemplate() {
+ public OPERATIONALTEMPLATE getOperationalTemplate() {
try {
return TemplateDocument.Factory.parse(operationaltemplateSerialized).getTemplate();
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
+
}
diff --git a/src/test/java/com/medblocks/openfhir/kds/KdsTest.java b/src/test/java/com/medblocks/openfhir/kds/KdsTest.java
new file mode 100644
index 00000000..c7db1337
--- /dev/null
+++ b/src/test/java/com/medblocks/openfhir/kds/KdsTest.java
@@ -0,0 +1,182 @@
+package com.medblocks.openfhir.kds;
+
+import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.fhirpath.IFhirPathEvaluationContext;
+import ca.uhn.fhir.parser.JsonParser;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.medblocks.openfhir.*;
+import com.medblocks.openfhir.fc.schema.context.FhirConnectContext;
+import com.medblocks.openfhir.kds.ehrbase.EhrBaseTestClient;
+import com.medblocks.openfhir.tofhir.IntermediateCacheProcessing;
+import com.medblocks.openfhir.tofhir.OpenEhrToFhir;
+import com.medblocks.openfhir.toopenehr.FhirToOpenEhr;
+import com.medblocks.openfhir.util.*;
+import com.nedap.archie.rm.composition.Composition;
+import jakarta.annotation.Nonnull;
+import jakarta.annotation.Nullable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
+import org.ehrbase.openehr.sdk.serialisation.flatencoding.std.marshal.FlatJsonMarshaller;
+import org.ehrbase.openehr.sdk.serialisation.flatencoding.std.umarshal.FlatJsonUnmarshaller;
+import org.ehrbase.openehr.sdk.webtemplate.model.WebTemplate;
+import org.hl7.fhir.instance.model.api.IBase;
+import org.hl7.fhir.instance.model.api.IIdType;
+import org.hl7.fhir.r4.hapi.fluentpath.FhirPathR4;
+import org.hl7.fhir.r4.model.Reference;
+import org.junit.Before;
+import org.openehr.schemas.v1.OPERATIONALTEMPLATE;
+import org.openehr.schemas.v1.TemplateDocument;
+import org.springframework.http.ResponseEntity;
+
+@Slf4j
+public abstract class KdsTest {
+
+ // integration toggle
+ protected boolean TEST_AGAINST_EHRBASE = false;
+ protected String EHRBASE_BASIC_USERNAME = "ehrbase-user";
+ protected String EHRBASE_BASIC_PASSWORD = "SuperSecretPassword";
+ protected String EHRBASE_HOST = "http://localhost:8081";
+
+ protected final OpenFhirStringUtils openFhirStringUtils = new OpenFhirStringUtils();
+ protected final OpenFhirMapperUtils openFhirMapperUtils = new OpenFhirMapperUtils();
+ protected final FhirConnectModelMerger fhirConnectModelMerger = new FhirConnectModelMerger();
+
+ protected final FhirPathR4 fhirPath = new FhirPathR4(FhirContext.forR4());
+ protected final JsonParser jsonParser = (JsonParser) FhirContext.forR4().newJsonParser();
+
+ protected TestOpenFhirMappingContext repo;
+ protected OpenEhrToFhir openEhrToFhir;
+ protected FhirToOpenEhr fhirToOpenEhr;
+
+ protected FhirConnectContext context;
+ protected OPERATIONALTEMPLATE operationaltemplate;
+ protected String operationaltemplateSerialized;
+ protected WebTemplate webTemplate;
+
+ protected StandardsAsserter standardsAsserter = new StandardsAsserter();
+ protected final Gson gson = new Gson();
+ protected final FlatJsonUnmarshaller flatUnmarshaller = new FlatJsonUnmarshaller();
+ protected final FlatJsonMarshaller flatMarshaller = new FlatJsonMarshaller();
+
+ /** subclasses set context/template/webTemplate/etc here */
+ protected abstract void prepareState();
+
+ @Before
+ public void initBase() {
+ TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin"));
+
+ repo = new TestOpenFhirMappingContext(fhirPath, openFhirStringUtils, fhirConnectModelMerger);
+
+ fhirPath.setEvaluationContext(new IFhirPathEvaluationContext() {
+ @Override
+ public IBase resolveReference(@Nonnull IIdType theReference, @Nullable IBase theContext) {
+ return ((Reference) theContext).getResource();
+ }
+ });
+
+ final FhirInstanceCreatorUtility fhirInstanceCreatorUtility =
+ new FhirInstanceCreatorUtility(openFhirStringUtils);
+
+ openEhrToFhir =
+ new OpenEhrToFhir(
+ flatMarshaller,
+ repo,
+ new OpenEhrCachedUtils(null),
+ gson,
+ openFhirStringUtils,
+ new OpenEhrRmWorker(openFhirStringUtils, openFhirMapperUtils),
+ new OpenFhirMapperUtils(),
+ new FhirInstancePopulator(),
+ new FhirInstanceCreator(openFhirStringUtils, fhirInstanceCreatorUtility),
+ fhirInstanceCreatorUtility,
+ fhirPath,
+ new IntermediateCacheProcessing(openFhirStringUtils),
+ new OpenEhrConditionEvaluator(openFhirStringUtils));
+
+ fhirToOpenEhr =
+ new FhirToOpenEhr(
+ fhirPath,
+ new OpenFhirStringUtils(),
+ flatUnmarshaller,
+ gson,
+ new OpenEhrRmWorker(openFhirStringUtils, openFhirMapperUtils),
+ openFhirStringUtils,
+ repo,
+ new OpenEhrCachedUtils(null),
+ new OpenFhirMapperUtils(),
+ new OpenEhrPopulator(new OpenFhirMapperUtils()));
+
+ prepareState();
+ }
+
+ protected boolean testAgainstEhrBase() {
+ return TEST_AGAINST_EHRBASE;
+ }
+
+ protected void storeToEhrBaseOrFail(Composition composition) {
+ if (!testAgainstEhrBase()) return;
+
+ ResponseEntity result =
+ new EhrBaseTestClient(EHRBASE_HOST, EHRBASE_BASIC_USERNAME, EHRBASE_BASIC_PASSWORD)
+ .createComposition(composition, operationaltemplateSerialized);
+
+ int code = result.getStatusCode().value();
+ if (code != 204) {
+ String body = result.getBody();
+ if (body != null) Arrays.stream(body.split(", /")).forEach(log::error);
+ } else {
+ log.info("Successfully stored to EHRBase.");
+ }
+ org.junit.Assert.assertEquals(204, code);
+ }
+
+ protected String getFile(String path) {
+ InputStream is = getClass().getResourceAsStream(path);
+ try {
+ return IOUtils.toString(is);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected org.hl7.fhir.r4.model.Bundle getTestBundle(String path) {
+ InputStream is = getClass().getResourceAsStream(path);
+ return (org.hl7.fhir.r4.model.Bundle) jsonParser.parseResource(is);
+ }
+
+ protected FhirConnectContext getContext(String path) {
+ ObjectMapper yaml = OpenFhirTestUtility.getYaml();
+ InputStream is = getClass().getResourceAsStream(path);
+ try {
+ return yaml.readValue(is, FhirConnectContext.class);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected OPERATIONALTEMPLATE getOperationalTemplate() {
+ try {
+ return TemplateDocument.Factory.parse(operationaltemplateSerialized).getTemplate();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected void compareJsonObjects(JsonObject actual, JsonObject expected) {
+ for (Map.Entry e : expected.entrySet()) {
+ String key = e.getKey();
+ String expectedValue = e.getValue().getAsString();
+ String actualValue = actual.getAsJsonPrimitive(key).getAsString();
+ if (!expectedValue.equals(actualValue)) {
+ System.out.println(key);
+ }
+ org.junit.Assert.assertEquals(expectedValue, actualValue);
+ }
+ }
+}
diff --git a/src/test/java/com/medblocks/openfhir/kds/diagnose/DiagnoseToFHIRTest.java b/src/test/java/com/medblocks/openfhir/kds/diagnose/DiagnoseToFHIRTest.java
new file mode 100644
index 00000000..c3a73050
--- /dev/null
+++ b/src/test/java/com/medblocks/openfhir/kds/diagnose/DiagnoseToFHIRTest.java
@@ -0,0 +1,329 @@
+package com.medblocks.openfhir.kds.diagnose;
+
+import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
+import com.medblocks.openfhir.kds.KdsTest;
+import com.nedap.archie.json.JacksonUtil;
+import com.nedap.archie.rm.composition.Composition;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+
+import lombok.SneakyThrows;
+import org.apache.commons.io.IOUtils;
+import org.ehrbase.openehr.sdk.serialisation.flatencoding.std.umarshal.FlatJsonUnmarshaller;
+import org.ehrbase.openehr.sdk.webtemplate.parser.OPTParser;
+import org.hl7.fhir.r4.model.Bundle;
+import org.hl7.fhir.r4.model.CodeableConcept;
+import org.hl7.fhir.r4.model.Coding;
+import org.hl7.fhir.r4.model.Condition;
+import org.hl7.fhir.r4.model.DateTimeType;
+import org.hl7.fhir.r4.model.Encounter;
+import org.hl7.fhir.r4.model.Extension;
+import org.hl7.fhir.r4.model.Reference;
+import org.hl7.fhir.r4.model.Type;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+public class DiagnoseToFHIRTest extends KdsTest {
+
+ final String MODEL_MAPPINGS = "/kds_new/";
+ final String CONTEXT_MAPPING = "/kds_new/projects/org.highmed/KDS/diagnose/KDS_diagnose.context.yaml";
+ final String OPT = "/kds/diagnose/KDS_Diagnose.opt";
+ //INPUT
+ final String FLAT = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition.flat.json";
+ final String COMPOSITION_SINGLE = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle.json";
+ final String COMPOSITION_MULTIPLE = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle_whole.json";
+ final String FLAT_MULTIPLE = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_multiple_Composition.flat.json"; // todo change to multiple
+ final String OPENEHR_COMPOSITION_1 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-1-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_2 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-2-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_3 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-3-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_4 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-4-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_5 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-5-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_6 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-6-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_7 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-7-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_8 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-8-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_9 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-9-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_10 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-10-diagnose-1.json";
+ //OUTPUT
+ final String BUNDLE_MULTIPLE = "/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle_whole.json";
+ final String BUNDLE_SINGLE = "/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle.json";
+ final String FHIR_CONDITION_1 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-1-diagnose-1.json";
+ final String FHIR_CONDITION_2 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-2-diagnose-1.json";
+ final String FHIR_CONDITION_3 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-3-diagnose-1.json";
+ final String FHIR_CONDITION_4 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-4-diagnose-1.json";
+ final String FHIR_CONDITION_5 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-5-diagnose-1.json";
+ final String FHIR_CONDITION_6 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-6-diagnose-1.json";
+ final String FHIR_CONDITION_7 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-7-diagnose-1.json";
+ final String FHIR_CONDITION_8 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-8-diagnose-1.json";
+ final String FHIR_CONDITION_9 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-9-diagnose-1.json";
+ final String FHIR_CONDITION_10 = "/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-10-diagnose-1.json";
+
+
+ @SneakyThrows
+ @Override
+ public void prepareState() {
+ context = getContext(CONTEXT_MAPPING);
+ operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(OPT));
+ operationaltemplate = getOperationalTemplate();
+ repo.initRepository(context, operationaltemplate, getClass().getResource(MODEL_MAPPINGS).getFile());
+ webTemplate = new OPTParser(operationaltemplate).parse();
+ }
+
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIRBundle(){
+ Composition composition = JacksonUtil.getObjectMapper().readValue(getFile(COMPOSITION_SINGLE), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, BUNDLE_SINGLE);
+
+
+ }
+
+
+ @SneakyThrows
+ @Test
+ @Ignore // Needs major file clean up
+ public void assertToFHIRBundleWhole(){
+ Composition composition = JacksonUtil.getObjectMapper().readValue(getFile(COMPOSITION_MULTIPLE), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, BUNDLE_MULTIPLE);
+
+
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR1(){
+ Composition composition = JacksonUtil.getObjectMapper().readValue(getFile(OPENEHR_COMPOSITION_1), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_1);
+
+
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR2(){
+ Composition composition = JacksonUtil.getObjectMapper().readValue(getFile(OPENEHR_COMPOSITION_2), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_2);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR3(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_3), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_3);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR4(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_4), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_4);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR5(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_5), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_5);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR6(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_6), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_6);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR7(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_7), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_7);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR8(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_8), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_8);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR9(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_9), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_9);
+ }
+
+ @SneakyThrows
+ @Test
+ public void assertToFHIR10(){
+ Composition composition = JacksonUtil.getObjectMapper()
+ .readValue(getFile(OPENEHR_COMPOSITION_10), Composition.class);
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, composition, operationaltemplate);
+ standardsAsserter.assertBundle(bundle, FHIR_CONDITION_10);
+ }
+
+ private void assertCondition(final Condition condition, final boolean second) {
+ // - name: "contextStartTime"
+ final String expectedTime = second ? "2023-02-03T04:05:06+01:00" : "2022-02-03T04:05:06+01:00";
+// Assert.assertEquals(expectedTime, condition.getRecordedDateElssssement().getValueAsString());
+
+
+ // - name: "fallIdentifikationIdentifier"
+ if (!second) {
+ Assert.assertEquals("VN", ((Encounter) condition.getEncounter().getResource()).getIdentifier().get(0).getType().getCodingFirstRep().getCode());
+ Assert.assertEquals("Encounter/123", ((Encounter) condition.getEncounter().getResource()).getIdentifier().get(0).getValue());
+ }
+
+ // - name: "status"
+ if (!second) {
+ Assert.assertEquals("unconfirmed", condition.getVerificationStatus().getCodingFirstRep().getCode());
+ Assert.assertEquals("http://hl7.org/fhir/ValueSet/condition-ver-status",
+ condition.getVerificationStatus().getCodingFirstRep().getSystem());
+ }
+
+ // - name: "date"
+ final List assertedExtensions = condition.getExtensionsByUrl(
+ "http://hl7.org/fhir/StructureDefinition/condition-assertedDate");
+ Assert.assertEquals(1, assertedExtensions.size());
+ final String expectedAssertedTime = second ? "3022-02-03T04:05:06+01:00" : "2022-02-03T04:05:06+01:00";
+ Assert.assertEquals(expectedAssertedTime,
+ ((DateTimeType) assertedExtensions.get(0).getValue()).getValueAsString());
+
+ // dateTime, onset
+ final String expectedOnsetStartTime = second ? "3022-02-03T04:05:06+01:00" : "2022-02-03T04:05:06+01:00";
+ Assert.assertEquals(expectedOnsetStartTime, condition.getOnsetPeriod().getStartElement().getValueAsString());
+
+ //- name: "clinicalStatus"
+ Assert.assertEquals((second ? "referenced_" : "") + "Active", condition.getClinicalStatus().getText());
+ Assert.assertEquals((second ? "referenced_" : "") + "at0026",
+ condition.getClinicalStatus().getCodingFirstRep().getCode());
+
+ // - name: "lebensphase"
+ Assert.assertEquals((second ? "referenced_" : "") + "43",
+ ((CodeableConcept) condition.getOnsetPeriod().getStartElement()
+ .getExtensionsByUrl("http://fhir.de/StructureDefinition/lebensphase")
+ .get(0).getValue()).getCodingFirstRep().getCode());
+ Assert.assertEquals((second ? "referenced_" : "") + "44",
+ ((CodeableConcept) condition.getOnsetPeriod().getEndElement()
+ .getExtensionsByUrl("http://fhir.de/StructureDefinition/lebensphase")
+ .get(0).getValue()).getCodingFirstRep().getCode());
+
+// - name: "schweregrad"
+ Assert.assertEquals((second ? "referenced_" : "") + "42",
+ condition.getSeverity().getCodingFirstRep().getCode());
+ Assert.assertEquals(
+ (second ? "referenced_" : "")
+ + "No example for termínology '//fhir.hl7.org//ValueSet/$expand?url=http://hl7.org/fhir/ValueSet/condition-severity' available",
+ condition.getSeverity().getText());
+
+ // bodySite
+ final List bodySites = condition.getBodySite();
+ Assert.assertEquals(1, bodySites.size());
+ final CodeableConcept bodySite = bodySites.get(0);
+ Assert.assertEquals(1, bodySite.getCoding().size());
+ final List snomedBodySiteCodings = bodySite.getCoding().stream()
+ .filter(bsite -> bsite.getSystem()
+ .equals((second ? "referenced_" : "")
+ + "//fhir.hl7.org//ValueSet/$expand?url=http://hl7.org/fhir/ValueSet/body-site"))
+ .toList();
+ Assert.assertEquals(1, snomedBodySiteCodings.size());
+ Assert.assertEquals((second ? "referenced_" : "") + "42", snomedBodySiteCodings.get(0).getCode());
+
+ // bodySiteCluster; nothing to do here because the cluster is overwritten to be a unidiretional toopenehr only
+
+// - name: "problemDiagnose", - name: "problemDiagnoseNameCode"
+ Assert.assertEquals(2, condition.getCode().getCoding().size());
+ Coding icd10code = condition.getCode().getCoding().get(0);
+ Assert.assertEquals((second ? "referenced_" : "") + "kodierte_diagnose value", icd10code.getCode());
+// - name: "problemDiagnoseText"
+// Assert.assertEquals((second ? "referenced_" : "") + "freitextbeschreibung value",
+// condition.getCode().getText());
+// - name: "icd10ProblemDiagnose"
+
+ icd10code = condition.getCode().getCoding().get(1);
+ Assert.assertEquals("http://fhir.de/CodeSystem/bfarm/icd-10-gm", icd10code.getSystem());
+
+// - name: "codeIcd10Diagnosesicherheit"
+ final Coding diagnosessicherheit = (Coding) icd10code.getExtensionsByUrl(
+ "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit").stream()
+ .map(Extension::getValue).filter(value -> !value.isEmpty()).findAny().orElse(null);
+ Assert.assertEquals((second ? "referenced_" : "") + "diagnosesicherheit",
+ diagnosessicherheit.getCode());
+ Assert.assertEquals(
+ (second ? "referenced_" : "")
+ + "//fhir.hl7.org//ValueSet/$expand?url=https://fhir.kbv.de/ValueSet/KBV_VS_SFHIR_ICD_DIAGNOSESICHERHEIT",
+ diagnosessicherheit.getSystem());
+
+ // - name: "mehrfachcodierung"
+ final Coding mehrfachcodierung = (Coding) icd10code.getExtensionByUrl(
+ "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen").getValue();
+ Assert.assertEquals("!", mehrfachcodierung.getCode());
+ Assert.assertEquals("http://fhir.de/ValueSet/icd-10-gm-mehrfachcodierungs-kennzeichen", mehrfachcodierung.getSystem());
+ Assert.assertEquals("!", mehrfachcodierung.getDisplay());
+
+ // - name: "seitenlokalisation"
+ final Coding seitenlokalisation = (Coding) icd10code.getExtensionByUrl(
+ "http://fhir.de/StructureDefinition/seitenlokalisation").getValue();
+ Assert.assertEquals((second ? "referenced_" : "") + "at0003", seitenlokalisation.getCode());
+ Assert.assertEquals((second ? "referenced_" : "") + "local",
+ seitenlokalisation.getSystem());
+ Assert.assertEquals((second ? "referenced_" : "") + "Left",
+ seitenlokalisation.getDisplay());
+
+
+ Assert.assertEquals(3, icd10code.getExtension().size());
+ }
+
+ @Test
+ public void toFhir() {
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(
+ getFile(FLAT_MULTIPLE), new OPTParser(operationaltemplate).parse());
+ final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
+ final List allConditions = bundle.getEntry().stream()
+ .filter(en -> en.getResource() instanceof Condition).collect(Collectors.toList());
+ Assert.assertEquals(2, allConditions.size());
+ final Condition condition = (Condition) allConditions.get(0).getResource(); // first condition
+ final Condition conditionSecond = (Condition) allConditions.get(1).getResource(); // second condition
+
+ assertCondition(condition, false);
+// assertCondition(conditionSecond, true);
+
+ final Type referencedExtensionCondition = condition.getExtensionByUrl(
+ "http://hl7.org/fhir/StructureDefinition/condition-related")
+ .getValue();
+ Assert.assertNotNull(referencedExtensionCondition);
+ Assert.assertTrue(conditionSecond.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/condition-related")
+ .getValue().isEmpty());
+
+ assertCondition((Condition) ((Reference) referencedExtensionCondition).getResource(), true);
+
+ }
+
+}
diff --git a/src/test/java/com/medblocks/openfhir/kds/DiagnoseTest.java b/src/test/java/com/medblocks/openfhir/kds/diagnose/DiagnoseToOpenEHRTest.java
similarity index 72%
rename from src/test/java/com/medblocks/openfhir/kds/DiagnoseTest.java
rename to src/test/java/com/medblocks/openfhir/kds/diagnose/DiagnoseToOpenEHRTest.java
index 7f32e83c..05a757d0 100644
--- a/src/test/java/com/medblocks/openfhir/kds/DiagnoseTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/diagnose/DiagnoseToOpenEHRTest.java
@@ -1,46 +1,144 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.diagnose;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsTest;
import com.nedap.archie.rm.composition.Composition;
-import java.util.List;
-import java.util.stream.Collectors;
import lombok.SneakyThrows;
import org.apache.commons.io.IOUtils;
-import org.ehrbase.openehr.sdk.serialisation.flatencoding.std.umarshal.FlatJsonUnmarshaller;
import org.ehrbase.openehr.sdk.webtemplate.parser.OPTParser;
-import org.hl7.fhir.r4.model.Bundle;
-import org.hl7.fhir.r4.model.CodeableConcept;
-import org.hl7.fhir.r4.model.Coding;
-import org.hl7.fhir.r4.model.Condition;
-import org.hl7.fhir.r4.model.DateTimeType;
-import org.hl7.fhir.r4.model.Encounter;
-import org.hl7.fhir.r4.model.Extension;
-import org.hl7.fhir.r4.model.Reference;
-import org.hl7.fhir.r4.model.Type;
+import org.hl7.fhir.r4.model.*;
import org.junit.Assert;
import org.junit.Test;
-public class DiagnoseTest extends KdsBidirectionalTest {
+import java.util.List;
+
+public class DiagnoseToOpenEHRTest extends KdsTest {
+
final String MODEL_MAPPINGS = "/kds_new/";
final String CONTEXT_MAPPING = "/kds_new/projects/org.highmed/KDS/diagnose/KDS_diagnose.context.yaml";
- final String HELPER_LOCATION = "/kds/diagnose/";
- final String OPT = "KDS_Diagnose.opt";
- final String FLAT = "KDS_Diagnose_Composition.flat.json";
- final String FLAT_MULTIPLE = "KDS_Diagnose_multiple_Composition.flat.json"; // todo change to multiple
- final String BUNDLE = "KDS_Diagnose_bundle_whole.json";
- final String BUNDLE_SINGLE = "KDS_Diagnose_bundle.json";
+ final String OPT = "/kds/diagnose/KDS_Diagnose.opt";
+ final String BUNDLE = "/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle_whole.json";
+ final String BUNDLE_SINGLE = "/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle.json";
+ final String FHIR_CONDITION_1 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-1-diagnose-1.json";
+ final String FHIR_CONDITION_2 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-2-diagnose-1.json";
+ final String FHIR_CONDITION_3 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-3-diagnose-1.json";
+ final String FHIR_CONDITION_4 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-4-diagnose-1.json";
+ final String FHIR_CONDITION_5 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-5-diagnose-1.json";
+ final String FHIR_CONDITION_6 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-6-diagnose-1.json";
+ final String FHIR_CONDITION_7 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-7-diagnose-1.json";
+ final String FHIR_CONDITION_8 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-8-diagnose-1.json";
+ final String FHIR_CONDITION_9 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-9-diagnose-1.json";
+ final String FHIR_CONDITION_10 = "/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-10-diagnose-1.json";
+
+ final String FLAT = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition.flat.json";
+ final String COMPOSITION_SINGLE = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle.json";
+ final String COMPOSITION_MULTIPLE = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle_whole.json";
+ final String FLAT_MULTIPLE = "/kds/diagnose/toOpenEHR/output/KDS_Diagnose_multiple_Composition.flat.json"; // todo change to multiple
+ final String OPENEHR_COMPOSITION_1 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-1-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_2 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-2-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_3 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-3-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_4 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-4-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_5 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-5-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_6 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-6-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_7 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-7-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_8 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-8-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_9 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-9-diagnose-1.json";
+ final String OPENEHR_COMPOSITION_10 = "/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-10-diagnose-1.json";
+
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT_MAPPING);
- operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
+ operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream( OPT));
operationaltemplate = getOperationalTemplate();
repo.initRepository(context, operationaltemplate, getClass().getResource(MODEL_MAPPINGS).getFile());
webTemplate = new OPTParser(operationaltemplate).parse();
}
+ @Test
+ public void assertToOpenEHRBundle() {
+ final Composition composition = fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(BUNDLE_SINGLE), operationaltemplate);
+ standardsAsserter.assertComposition(composition, COMPOSITION_SINGLE);
+ }
+
+ @Test
+ public void assertToOpenEHRBundleWhole() {
+ final Composition composition = fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(BUNDLE), operationaltemplate);
+ standardsAsserter.assertComposition(composition, COMPOSITION_MULTIPLE);
+ }
+
+ @Test
+ public void assertToOpenEHR1() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_1), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_1);
+ }
+
+ @Test
+ public void assertToOpenEHR2() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_2), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_2);
+ }
+
+ @Test
+ public void assertToOpenEHR3() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_3), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_3);
+ }
+
+ @Test
+ public void assertToOpenEHR4() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_4), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_4);
+ }
+
+ @Test
+ public void assertToOpenEHR5() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_5), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_5);
+ }
+
+ @Test
+ public void assertToOpenEHR6() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_6), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_6);
+ }
+
+ @Test
+ public void assertToOpenEHR7() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_7), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_7);
+ }
+
+ @Test
+ public void assertToOpenEHR8() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_8), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_8);
+ }
+
+ @Test
+ public void assertToOpenEHR9() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_9), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_9);
+ }
+
+ @Test
+ public void assertToOpenEHR10() {
+ final Composition composition =
+ fhirToOpenEhr.fhirToCompositionRm(context, getTestBundle(FHIR_CONDITION_10), operationaltemplate);
+ standardsAsserter.assertComposition(composition, OPENEHR_COMPOSITION_10);
+ }
+
private void assertCondition(final Condition condition, final boolean second) {
// - name: "contextStartTime"
final String expectedTime = second ? "2023-02-03T04:05:06+01:00" : "2022-02-03T04:05:06+01:00";
@@ -153,34 +251,9 @@ private void assertCondition(final Condition condition, final boolean second) {
Assert.assertEquals(3, icd10code.getExtension().size());
}
- @Test
- public void toFhir() {
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(
- getFlat(HELPER_LOCATION + FLAT_MULTIPLE), new OPTParser(operationaltemplate).parse());
- final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
- final List allConditions = bundle.getEntry().stream()
- .filter(en -> en.getResource() instanceof Condition).collect(Collectors.toList());
- Assert.assertEquals(2, allConditions.size());
- final Condition condition = (Condition) allConditions.get(0).getResource(); // first condition
- final Condition conditionSecond = (Condition) allConditions.get(1).getResource(); // second condition
-
- assertCondition(condition, false);
-// assertCondition(conditionSecond, true);
-
- final Type referencedExtensionCondition = condition.getExtensionByUrl(
- "http://hl7.org/fhir/StructureDefinition/condition-related")
- .getValue();
- Assert.assertNotNull(referencedExtensionCondition);
- Assert.assertTrue(conditionSecond.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/condition-related")
- .getValue().isEmpty());
-
- assertCondition((Condition) ((Reference) referencedExtensionCondition).getResource(), true);
-
- }
-
@Test
public void toOpenEhr_single() {
- final Bundle testBundle = getTestBundle(HELPER_LOCATION + BUNDLE_SINGLE);
+ final Bundle testBundle = getTestBundle(BUNDLE_SINGLE);
final JsonObject jsonObject = fhirToOpenEhr.fhirToFlatJsonObject(context, testBundle, operationaltemplate);
Assert.assertEquals("2022-02-03T01:00:00", jsonObject.get("diagnose/context/start_time").getAsString());
@@ -200,12 +273,12 @@ public void toOpenEhr_single() {
"diagnose/diagnose:0/mehrfachkodierungskennzeichen_icd-10-gm/mehrfachkodierungkennzeichen|terminology").getAsString());
Assert.assertEquals("†", jsonObject.get(
"diagnose/diagnose:0/mehrfachkodierungskennzeichen_icd-10-gm/mehrfachkodierungkennzeichen|value").getAsString());
- Assert.assertEquals("L", jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|code")
+ Assert.assertEquals("321667001", jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|code")
.getAsString());
- Assert.assertEquals("http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
+ Assert.assertEquals("http://snomed.info/sct",
jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|terminology")
.getAsString());
- Assert.assertEquals("Left side",
+ Assert.assertEquals("Respiratory tract, Upper lobe, bronchus or lung",
jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|value")
.getAsString());
// Assert.assertEquals("Secondary malignant neoplasm of lymph node",
@@ -215,15 +288,15 @@ public void toOpenEhr_single() {
Assert.assertEquals("2024-12-24T16:13:43",
jsonObject.get("diagnose/diagnose:0/klinisch_relevanter_zeitraum_zeitpunkt_des_auftretens")
.getAsString());
- Assert.assertEquals("424144002", jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|code").getAsString());
+ Assert.assertEquals("41847000", jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|code").getAsString());
Assert.assertEquals("http://snomed.info/sct",
jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|terminology").getAsString());
- Assert.assertEquals("Start of adulthood phase",
+ Assert.assertEquals("Adulthood",
jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|value").getAsString());
- Assert.assertEquals("367640001", jsonObject.get("diagnose/diagnose:0/lebensphase/ende|code").getAsString());
+ Assert.assertEquals("271872005", jsonObject.get("diagnose/diagnose:0/lebensphase/ende|code").getAsString());
Assert.assertEquals("http://snomed.info/sct",
jsonObject.get("diagnose/diagnose:0/lebensphase/ende|terminology").getAsString());
- Assert.assertEquals("End of middle age phase",
+ Assert.assertEquals("Old age",
jsonObject.get("diagnose/diagnose:0/lebensphase/ende|value").getAsString());
Assert.assertEquals("24484000", jsonObject.get("diagnose/diagnose:0/schweregrad|code").getAsString());
Assert.assertEquals("http://terminology.hl7.org/CodeSystem/condition-severity",
@@ -244,7 +317,7 @@ public void toOpenEhr_single() {
public JsonObject toOpenEhr() {
- final Bundle testBundle = getTestBundle(HELPER_LOCATION + BUNDLE);
+ final Bundle testBundle = getTestBundle(BUNDLE);
final JsonObject jsonObject = fhirToOpenEhr.fhirToFlatJsonObject(context, testBundle, operationaltemplate);
Assert.assertEquals("2022-02-03T01:00:00", jsonObject.get("diagnose/context/start_time").getAsString());
@@ -262,27 +335,27 @@ public JsonObject toOpenEhr() {
"diagnose/diagnose:0/mehrfachkodierungskennzeichen_icd-10-gm/mehrfachkodierungkennzeichen|terminology").getAsString());
Assert.assertEquals("†", jsonObject.get(
"diagnose/diagnose:0/mehrfachkodierungskennzeichen_icd-10-gm/mehrfachkodierungkennzeichen|value").getAsString());
- Assert.assertEquals("L", jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|code")
+ Assert.assertEquals("321667001", jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|code")
.getAsString());
- Assert.assertEquals("http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
+ Assert.assertEquals("http://snomed.info/sct",
jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|terminology")
.getAsString());
- Assert.assertEquals("Left side",
+ Assert.assertEquals("Respiratory tract, Upper lobe, bronchus or lung",
jsonObject.get("diagnose/diagnose:0/anatomische_lokalisation/name_der_körperstelle|value")
.getAsString());
// Assert.assertEquals("Secondary malignant neoplasm of lymph node",
// jsonObject.get("diagnose/diagnose:0/freitextbeschreibung").getAsString());
Assert.assertEquals("Patient confirmed for secondary malignant neoplasm of lymph node.",
jsonObject.get("diagnose/diagnose:0/diagnoseerläuterung").getAsString());
- Assert.assertEquals("424144002", jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|code").getAsString());
+ Assert.assertEquals("41847000", jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|code").getAsString());
Assert.assertEquals("http://snomed.info/sct",
jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|terminology").getAsString());
- Assert.assertEquals("Start of adulthood phase",
+ Assert.assertEquals("Adulthood",
jsonObject.get("diagnose/diagnose:0/lebensphase/beginn|value").getAsString());
Assert.assertEquals("367640001", jsonObject.get("diagnose/diagnose:0/lebensphase/ende|code").getAsString());
Assert.assertEquals("http://snomed.info/sct",
jsonObject.get("diagnose/diagnose:0/lebensphase/ende|terminology").getAsString());
- Assert.assertEquals("End of middle age phase",
+ Assert.assertEquals("Old age",
jsonObject.get("diagnose/diagnose:0/lebensphase/ende|value").getAsString());
Assert.assertEquals("24484000", jsonObject.get("diagnose/diagnose:0/schweregrad|code").getAsString());
Assert.assertEquals("http://terminology.hl7.org/CodeSystem/condition-severity",
@@ -311,10 +384,10 @@ public JsonObject toOpenEhr() {
Assert.assertEquals("ref_C34.1", jsonObject.get("diagnose/diagnose:1/kodierte_diagnose|code").getAsString());
Assert.assertEquals("Malignant neoplasm of upper lobe, bronchus or lung", jsonObject.get("diagnose/diagnose:1/kodierte_diagnose|value").getAsString());
Assert.assertEquals("http://fhir.de/CodeSystem/bfarm/icd-10-gm", jsonObject.get("diagnose/diagnose:1/kodierte_diagnose|terminology").getAsString());
- Assert.assertEquals("ref_S", jsonObject.get("diagnose/diagnose:1/diagnosesicherheit|code").getAsString());
+ Assert.assertEquals("V", jsonObject.get("diagnose/diagnose:1/diagnosesicherheit|code").getAsString());
Assert.assertEquals("http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
jsonObject.get("diagnose/diagnose:1/diagnosesicherheit|terminology").getAsString());
- Assert.assertEquals("ref_Suspected diagnosis",
+ Assert.assertEquals("Verdacht auf Diagnose",
jsonObject.get("diagnose/diagnose:1/diagnosesicherheit|value").getAsString());
Assert.assertEquals("at0003", jsonObject.get(
"diagnose/diagnose:1/mehrfachkodierungskennzeichen_icd-10-gm/mehrfachkodierungkennzeichen|code").getAsString());
@@ -322,12 +395,12 @@ public JsonObject toOpenEhr() {
"diagnose/diagnose:1/mehrfachkodierungskennzeichen_icd-10-gm/mehrfachkodierungkennzeichen|terminology").getAsString());
Assert.assertEquals("*", jsonObject.get(
"diagnose/diagnose:1/mehrfachkodierungskennzeichen_icd-10-gm/mehrfachkodierungkennzeichen|value").getAsString());
- Assert.assertEquals("ref_U", jsonObject.get("diagnose/diagnose:1/anatomische_lokalisation/name_der_körperstelle|code")
+ Assert.assertEquals("ref_368209003", jsonObject.get("diagnose/diagnose:1/anatomische_lokalisation/name_der_körperstelle|code")
.getAsString());
- Assert.assertEquals("http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
+ Assert.assertEquals("http://snomed.info/sct",
jsonObject.get("diagnose/diagnose:1/anatomische_lokalisation/name_der_körperstelle|terminology")
.getAsString());
- Assert.assertEquals("ref_Upper lobe",
+ Assert.assertEquals("Entire cardiovascular system",
jsonObject.get("diagnose/diagnose:1/anatomische_lokalisation/name_der_körperstelle|value")
.getAsString());
// Assert.assertEquals("Malignant neoplasm of upper lobe, bronchus or lung",
diff --git a/src/test/java/com/medblocks/openfhir/kds/FallTest.java b/src/test/java/com/medblocks/openfhir/kds/fall/FallTest.java
similarity index 98%
rename from src/test/java/com/medblocks/openfhir/kds/FallTest.java
rename to src/test/java/com/medblocks/openfhir/kds/fall/FallTest.java
index 611fe01b..b4cc33b0 100644
--- a/src/test/java/com/medblocks/openfhir/kds/FallTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/fall/FallTest.java
@@ -1,6 +1,7 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.fall;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
import java.util.List;
import java.util.stream.Collectors;
@@ -32,7 +33,7 @@ public class FallTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT_MAPPING);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -43,7 +44,7 @@ protected void prepareState() {
@Test
public void toFhir() {
final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(
- getFlat(HELPER_LOCATION + FLAT), new OPTParser(operationaltemplate).parse());
+ getFile(HELPER_LOCATION + FLAT), new OPTParser(operationaltemplate).parse());
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
final List allEncounters = bundle.getEntry().stream()
.filter(en -> en.getResource() instanceof Encounter).collect(Collectors.toList());
diff --git a/src/test/java/com/medblocks/openfhir/kds/LaborauftragTest.java b/src/test/java/com/medblocks/openfhir/kds/laborauftrag/LaborauftragTest.java
similarity index 97%
rename from src/test/java/com/medblocks/openfhir/kds/LaborauftragTest.java
rename to src/test/java/com/medblocks/openfhir/kds/laborauftrag/LaborauftragTest.java
index ec1a6c93..0c65226a 100644
--- a/src/test/java/com/medblocks/openfhir/kds/LaborauftragTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/laborauftrag/LaborauftragTest.java
@@ -1,9 +1,10 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.laborauftrag;
import static org.junit.Assert.assertEquals;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
import java.io.IOException;
import java.util.List;
@@ -35,7 +36,7 @@ public class LaborauftragTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -47,7 +48,7 @@ protected void prepareState() {
public void kdsServiceRequest_toFhir_toOpenEhr() throws IOException {
// openEHR to FHIR
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFlat(HELPER_LOCATION + FLAT),
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFile(HELPER_LOCATION + FLAT),
webTemplate);
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
@@ -125,7 +126,7 @@ public JsonObject toOpenEhr() {
@Test
public void toFhir() {
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFlat(HELPER_LOCATION + FLAT),
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFile(HELPER_LOCATION + FLAT),
new OPTParser(
operationaltemplate).parse());
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
diff --git a/src/test/java/com/medblocks/openfhir/kds/LaborberichtTest.java b/src/test/java/com/medblocks/openfhir/kds/laborbericht/LaborberichtTest.java
similarity index 98%
rename from src/test/java/com/medblocks/openfhir/kds/LaborberichtTest.java
rename to src/test/java/com/medblocks/openfhir/kds/laborbericht/LaborberichtTest.java
index e44e0fed..a7e53856 100644
--- a/src/test/java/com/medblocks/openfhir/kds/LaborberichtTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/laborbericht/LaborberichtTest.java
@@ -1,8 +1,9 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.laborbericht;
import static org.junit.Assert.assertEquals;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
import java.util.List;
import java.util.stream.Collectors;
@@ -15,7 +16,6 @@
import org.hl7.fhir.r4.model.Observation;
import org.hl7.fhir.r4.model.Specimen;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
public class LaborberichtTest extends KdsBidirectionalTest {
@@ -31,7 +31,7 @@ public class LaborberichtTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -116,7 +116,7 @@ public JsonObject toOpenEhr() {
@Test
public void toFhir() {
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFlat(HELPER_LOCATION + FLAT),
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFile(HELPER_LOCATION + FLAT),
new OPTParser(
operationaltemplate).parse());
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
@@ -250,7 +250,7 @@ public void toFhir() {
@Test
public void toFhir_multiples() {
final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(
- getFlat(HELPER_LOCATION + "KDS_Laborbericht_multiples.flat.json"),
+ getFile(HELPER_LOCATION + "KDS_Laborbericht_multiples.flat.json"),
new OPTParser(operationaltemplate).parse());
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
final List allDiagnosticReports = bundle.getEntry().stream()
diff --git a/src/test/java/com/medblocks/openfhir/kds/DebugMedikationseintragPrintTest.java b/src/test/java/com/medblocks/openfhir/kds/medikationseintrag/DebugMedikationseintragPrintTest.java
similarity index 91%
rename from src/test/java/com/medblocks/openfhir/kds/DebugMedikationseintragPrintTest.java
rename to src/test/java/com/medblocks/openfhir/kds/medikationseintrag/DebugMedikationseintragPrintTest.java
index 6367cb15..bb4f0984 100644
--- a/src/test/java/com/medblocks/openfhir/kds/DebugMedikationseintragPrintTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/medikationseintrag/DebugMedikationseintragPrintTest.java
@@ -1,7 +1,8 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.medikationseintrag;
import ca.uhn.fhir.context.FhirContext;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import org.hl7.fhir.r4.model.Bundle;
import org.junit.Test;
@@ -17,7 +18,7 @@ public class DebugMedikationseintragPrintTest extends KdsBidirectionalTest {
final String BUNDLE = "KDS_Medikationseintrag_v1-Fhir-Bundle-input.json";
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
try {
operationaltemplateSerialized = new String(
@@ -47,7 +48,7 @@ public void printFlatForDebug() {
}
@Override
- protected JsonObject toOpenEhr() {
+ public JsonObject toOpenEhr() {
return null; // not used in this debug test
}
}
diff --git a/src/test/java/com/medblocks/openfhir/kds/MedikationseintragTest.java b/src/test/java/com/medblocks/openfhir/kds/medikationseintrag/MedikationseintragTest.java
similarity index 96%
rename from src/test/java/com/medblocks/openfhir/kds/MedikationseintragTest.java
rename to src/test/java/com/medblocks/openfhir/kds/medikationseintrag/MedikationseintragTest.java
index 9f4d6e02..76ace873 100644
--- a/src/test/java/com/medblocks/openfhir/kds/MedikationseintragTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/medikationseintrag/MedikationseintragTest.java
@@ -1,30 +1,21 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.medikationseintrag;
import ca.uhn.fhir.context.FhirContext;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.nio.charset.StandardCharsets;
import lombok.SneakyThrows;
-import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
-import org.apache.xmlbeans.XmlException;
-import org.bson.types.Code;
import org.ehrbase.openehr.sdk.serialisation.flatencoding.std.umarshal.FlatJsonUnmarshaller;
import org.ehrbase.openehr.sdk.webtemplate.parser.OPTParser;
import org.hl7.fhir.r4.model.*;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
-import java.util.TimeZone;
-import java.text.SimpleDateFormat;
import java.util.List;
import java.util.stream.Collectors;
-import org.openehr.schemas.v1.TemplateDocument;
public class MedikationseintragTest extends KdsBidirectionalTest {
@@ -39,7 +30,7 @@ public class MedikationseintragTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -50,7 +41,7 @@ protected void prepareState() {
@Test
public void kdsMedicationList_toFhir() throws IOException {
// openEHR to FHIR
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFlat(HELPER_LOCATION + FLAT), webTemplate);
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFile(HELPER_LOCATION + FLAT), webTemplate);
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
final List requests = bundle.getEntry().stream()
@@ -160,7 +151,7 @@ public void kdsMedicationList_toFhir() throws IOException {
@Test
public void kdsMedicationList_toFhir_testOpenEhrCondition() throws IOException {
// openEHR to FHIR
- final String flat = getFlat(HELPER_LOCATION + FLAT);
+ final String flat = getFile(HELPER_LOCATION + FLAT);
final Gson gson = new Gson();
final JsonObject flatJsonObject = gson.fromJson(flat, JsonObject.class);
diff --git a/src/test/java/com/medblocks/openfhir/kds/MedikamentenverabreichungenTest.java b/src/test/java/com/medblocks/openfhir/kds/medikationsverabreichung/MedikamentenverabreichungenTest.java
similarity index 97%
rename from src/test/java/com/medblocks/openfhir/kds/MedikamentenverabreichungenTest.java
rename to src/test/java/com/medblocks/openfhir/kds/medikationsverabreichung/MedikamentenverabreichungenTest.java
index 448e323a..2ce41754 100644
--- a/src/test/java/com/medblocks/openfhir/kds/MedikamentenverabreichungenTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/medikationsverabreichung/MedikamentenverabreichungenTest.java
@@ -1,6 +1,7 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.medikationsverabreichung;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
import lombok.SneakyThrows;
import org.apache.commons.io.IOUtils;
@@ -8,7 +9,6 @@
import org.ehrbase.openehr.sdk.webtemplate.parser.OPTParser;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CodeableConcept;
-import org.hl7.fhir.r4.model.Medication;
import org.hl7.fhir.r4.model.MedicationAdministration;
import org.hl7.fhir.r4.model.MedicationRequest;
import org.hl7.fhir.r4.model.Period;
@@ -30,7 +30,7 @@ public class MedikamentenverabreichungenTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -41,7 +41,7 @@ protected void prepareState() {
@Test
public void toFhir() {
// openEHR to FHIR
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFlat(HELPER_LOCATION + FLAT), webTemplate);
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFile(HELPER_LOCATION + FLAT), webTemplate);
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
final List administrations = bundle.getEntry().stream()
diff --git a/src/test/java/com/medblocks/openfhir/kds/PersonTest.java b/src/test/java/com/medblocks/openfhir/kds/person/PersonTest.java
similarity index 99%
rename from src/test/java/com/medblocks/openfhir/kds/PersonTest.java
rename to src/test/java/com/medblocks/openfhir/kds/person/PersonTest.java
index 653b6fc9..d742f347 100644
--- a/src/test/java/com/medblocks/openfhir/kds/PersonTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/person/PersonTest.java
@@ -1,6 +1,7 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.person;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
import java.util.List;
import java.util.stream.Collectors;
@@ -36,7 +37,7 @@ public class PersonTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -47,7 +48,7 @@ protected void prepareState() {
@Test
public void kdsPerson_toFhir() {
// openEHR to FHIR
- final String initialFlat = getFlat(HELPER_LOCATION + FLAT);
+ final String initialFlat = getFile(HELPER_LOCATION + FLAT);
final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(initialFlat, webTemplate);
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
diff --git a/src/test/java/com/medblocks/openfhir/kds/ProcedureTest.java b/src/test/java/com/medblocks/openfhir/kds/procedure/ProcedureTest.java
similarity index 97%
rename from src/test/java/com/medblocks/openfhir/kds/ProcedureTest.java
rename to src/test/java/com/medblocks/openfhir/kds/procedure/ProcedureTest.java
index a80305c6..0f544ad2 100644
--- a/src/test/java/com/medblocks/openfhir/kds/ProcedureTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/procedure/ProcedureTest.java
@@ -1,6 +1,7 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.procedure;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
import java.util.List;
import java.util.stream.Collectors;
@@ -27,7 +28,7 @@ public class ProcedureTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -37,7 +38,7 @@ protected void prepareState() {
@Test
public void toFhir() {
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFlat(HELPER_LOCATION + FLAT),
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFile(HELPER_LOCATION + FLAT),
new OPTParser(
operationaltemplate).parse());
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
diff --git a/src/test/java/com/medblocks/openfhir/kds/StudienteilnahmeTest.java b/src/test/java/com/medblocks/openfhir/kds/studienteilnahme/StudienteilnahmeTest.java
similarity index 95%
rename from src/test/java/com/medblocks/openfhir/kds/StudienteilnahmeTest.java
rename to src/test/java/com/medblocks/openfhir/kds/studienteilnahme/StudienteilnahmeTest.java
index 3d45a17a..ba82f578 100644
--- a/src/test/java/com/medblocks/openfhir/kds/StudienteilnahmeTest.java
+++ b/src/test/java/com/medblocks/openfhir/kds/studienteilnahme/StudienteilnahmeTest.java
@@ -1,8 +1,9 @@
-package com.medblocks.openfhir.kds;
+package com.medblocks.openfhir.kds.studienteilnahme;
import static org.junit.Assert.assertEquals;
import com.google.gson.JsonObject;
+import com.medblocks.openfhir.kds.KdsBidirectionalTest;
import com.nedap.archie.rm.composition.Composition;
import java.util.List;
import java.util.stream.Collectors;
@@ -27,7 +28,7 @@ public class StudienteilnahmeTest extends KdsBidirectionalTest {
@SneakyThrows
@Override
- protected void prepareState() {
+ public void prepareState() {
context = getContext(CONTEXT);
operationaltemplateSerialized = IOUtils.toString(this.getClass().getResourceAsStream(HELPER_LOCATION + OPT));
operationaltemplate = getOperationalTemplate();
@@ -37,7 +38,7 @@ protected void prepareState() {
@Test
public void toFhir() {
- final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFlat(HELPER_LOCATION + FLAT),
+ final Composition compositionFromFlat = new FlatJsonUnmarshaller().unmarshal(getFile(HELPER_LOCATION + FLAT),
new OPTParser(
operationaltemplate).parse());
final Bundle bundle = openEhrToFhir.compositionToFhir(context, compositionFromFlat, operationaltemplate);
diff --git a/src/test/resources/file_generator.sh b/src/test/resources/file_generator.sh
new file mode 100644
index 00000000..ad3f9d6d
--- /dev/null
+++ b/src/test/resources/file_generator.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+URL="http://localhost:8080/openfhir/toopenehr"
+ROOT="${1:-.}"
+
+tmp_resp="$(mktemp)"
+
+cleanup() {
+ rm -f "$tmp_resp"
+}
+trap cleanup EXIT
+
+find "$ROOT" -type d -name kds -print0 | while IFS= read -r -d '' kds_dir; do
+ find "$kds_dir" -type f -name "*.json" ! -name "Composition-*.json" -print0 \
+ | while IFS= read -r -d '' f; do
+ dir="$(dirname "$f")"
+ base="$(basename "$f")"
+ out_file="$dir/Composition-${base#*-}"
+
+ echo "POST: $f"
+
+ code="$(
+ curl -sS \
+ -o "$tmp_resp" \
+ -w '%{http_code}' \
+ -H 'Content-Type: application/json' \
+ --data-binary "@$f" \
+ "$URL" \
+ || echo "000"
+ )"
+
+ if [[ "$code" == "200" ]]; then
+ mv "$tmp_resp" "$out_file"
+ echo " ✔ wrote $out_file"
+ else
+ echo " ✘ skipped (HTTP $code)"
+ fi
+ done
+done
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-1-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-1-diagnose-1.json
new file mode 100644
index 00000000..5f040261
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-1-diagnose-1.json
@@ -0,0 +1,96 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "clinicalStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
+ "code": "active"
+ }
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I29578",
+ "display": "Masern mit Otitis"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "13420004",
+ "display": "Post measles otitis media (disorder)"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "B05.3",
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
+ "valueCoding": {
+ "system": "https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_ICD_DIAGNOSESICHERHEIT",
+ "code": "G",
+ "display": "gesicherte Diagnose"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
+ "valueCoding": {
+ "system": "http://fhir.de/ValueSet/icd-10-gm-mehrfachcodierungs-kennzeichen",
+ "code": "!",
+ "display": "!"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/seitenlokalisation",
+ "valueCoding": {
+ "system": "https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_ICD_SEITENLOKALISATION",
+ "code": "B",
+ "display": "beiderseits"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "code": "confirmed",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "25342003",
+ "display": "Middle ear structure (body structure)"
+ }
+ ],
+ "text": "Middle ear structure (body structure)"
+ }
+ ],
+ "onsetDateTime": "2024-02-21T00:00:00+01:00",
+ "recordedDate": "2024-02-21T00:00:00+01:00",
+ "note": [
+ {
+ "text": "Masernotitis"
+ }
+ ]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-10-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-10-diagnose-1.json
new file mode 100644
index 00000000..4ded1e81
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-10-diagnose-1.json
@@ -0,0 +1,69 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "G43.9",
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I18412",
+ "display": "Migräne"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "37796009",
+ "display": "Migraine (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Migräne, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "281231009",
+ "display": "Vascular structure of head (body structure)"
+ }
+ ],
+ "text": "Vascular structure of head (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2019-05-14T00:00:00+02:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-2-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-2-diagnose-1.json
new file mode 100644
index 00000000..c938bb90
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-2-diagnose-1.json
@@ -0,0 +1,69 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C34.1"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I30011",
+ "display": "Bösartige Neubildung des Lungenoberlappens"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "254637007",
+ "display": "Non-small cell lung cancer (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Bösartige Neubildung: Oberlappen-Bronchus"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "45653009",
+ "display": "Structure of upper lobe of lung (body structure)"
+ }
+ ],
+ "text": "Structure of upper lobe of lung (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "code": "confirmed",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2024-03-02T00:00:00+01:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-3-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-3-diagnose-1.json
new file mode 100644
index 00000000..669db905
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-3-diagnose-1.json
@@ -0,0 +1,69 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C21.8"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I29975",
+ "display": "Bösartige anorektale Neubildung"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "447886005",
+ "display": "Adenocarcinoma of anorectum (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Bösartige anorektale Neubildung"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "281088000",
+ "display": "Structure of anus and/or rectum (body structure)"
+ }
+ ],
+ "text": "Structure of anus and/or rectum (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2022-04-02T00:00:00+02:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-4-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-4-diagnose-1.json
new file mode 100644
index 00000000..000216fb
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-4-diagnose-1.json
@@ -0,0 +1,47 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C16.9"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Bösartige Neubildung des Magens nicht näher bezeichnet"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2022-11-30T00:00:00+01:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-5-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-5-diagnose-1.json
new file mode 100644
index 00000000..528b11a1
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-5-diagnose-1.json
@@ -0,0 +1,67 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [{
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "N80.1"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I133980"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "129103003",
+ "display": "Endometriosis (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Endometriose des Ovars"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "15497006",
+ "display": "Ovarian structure (body structure)"
+ }
+ ],
+ "text": "Ovarian structure (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2023-07-10T00:00:00+02:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-6-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-6-diagnose-1.json
new file mode 100644
index 00000000..577c740a
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-6-diagnose-1.json
@@ -0,0 +1,69 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "K29.5"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I30016",
+ "display": "Chronische Gastritis"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "4556007",
+ "display": "Gastritis (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Chronische Gastritis, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "69695003",
+ "display": "Stomach structure (body structure)"
+ }
+ ],
+ "text": "Stomach structure (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2022-03-12T00:00:00+01:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-7-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-7-diagnose-1.json
new file mode 100644
index 00000000..3907b89f
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-7-diagnose-1.json
@@ -0,0 +1,69 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "J20.9"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I25780",
+ "display": "Akute Bronchitis"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "10509002",
+ "display": "Acute bronchitis (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Akute Bronchitis, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "955009",
+ "display": "Bronchial structure (body structure)"
+ }
+ ],
+ "text": "Bronchial structure (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2024-01-08T00:00:00+01:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-8-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-8-diagnose-1.json
new file mode 100644
index 00000000..5e1a0a29
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-8-diagnose-1.json
@@ -0,0 +1,69 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "I25.9"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I26852",
+ "display": "Chronische ischämische Herzkrankheit"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "413838009",
+ "display": "Chronic ischemic heart disease (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Chronische ischämische Herzkrankheit, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "80891009",
+ "display": "Heart structure (body structure)"
+ }
+ ],
+ "text": "Heart structure (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2023-11-10T00:00:00+01:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-9-diagnose-1.json b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-9-diagnose-1.json
new file mode 100644
index 00000000..cd8a7287
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/Condition-mii-exa-test-data-patient-9-diagnose-1.json
@@ -0,0 +1,69 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "N83.2"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I20743",
+ "display": "Ovarialzyste"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "79883001",
+ "display": "Cyst of ovary (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Sonstige und nicht näher bezeichnete Ovarialzysten"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "15497006",
+ "display": "Ovarian structure (body structure)"
+ }
+ ],
+ "text": "Ovarian structure (body structure)"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "recordedDate": "2024-02-20T00:00:00+01:00"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle.json b/src/test/resources/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle.json
new file mode 100644
index 00000000..5a240924
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle.json
@@ -0,0 +1,214 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "contained": [
+ {
+ "resourceType": "Encounter",
+ "id": "1",
+ "identifier": [
+ {
+ "type": {
+ "coding": [
+ {
+ "code": "VN"
+ }
+ ]
+ },
+ "value": "encounter-id-1245"
+ }
+ ]
+ }
+ ],
+ "extension": [
+ {
+ "url": "http://hl7.org/fhir/StructureDefinition/condition-related",
+ "valueReference": {
+ "reference": "Condition/reference-condition",
+ "type": "Condition",
+ "identifier": {
+ "type": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
+ "code": "MR",
+ "display": "Medical record number"
+ }
+ ],
+ "text": "Medical record number"
+ },
+ "system": "http://hospital.smarthealthit.org/conditions",
+ "value": "CON123456",
+ "period": {
+ "start": "1993-09-08",
+ "end": "1993-12-13"
+ }
+ },
+ "display": "Related Condition"
+ }
+ },
+ {
+ "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate",
+ "valueDateTime": "2025-02-03T04:05:06Z"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
+ "code": "active",
+ "display": "Active"
+ }
+ ],
+ "text": "Active"
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "code": "confirmed",
+ "display": "Confirmed"
+ }
+ ]
+ },
+ "severity": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-severity",
+ "code": "24484000",
+ "display": "Severe"
+ }
+ ],
+ "text": "Severe"
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C34.1",
+ "display": "Malignant neoplasm of the upper lobe of the lung",
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm-mc",
+ "code": "†",
+ "display": "Primary code in multiple coding"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/seitenlokalisation",
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
+ "code": "L",
+ "display": "Left side"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
+ "code": "G",
+ "display": "Confirmed diagnosis"
+ }
+ }
+ ]
+ },
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
+ "code": "C77.0",
+ "display": "Malignant neoplasm of lymph nodes"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "057E3",
+ "display": "secondary malignant neoplasm of lymph nodes"
+ },
+ {
+ "system": "http://www.orpha.net",
+ "code": "1777",
+ "display": "lung cancer associated with hereditary syndromes"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "128462008",
+ "display": "Secondary malignant neoplasm of lymph node"
+ }
+ ],
+ "text": "Secondary malignant neoplasm of lymph node"
+ },
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "321667001",
+ "display": "Respiratory tract, Upper lobe, bronchus or lung"
+ },
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
+ "code": "C34.1",
+ "display": "Upper lobe, bronchus or lung"
+ }
+ ],
+ "text": "Respiratory tract, Upper lobe, bronchus or lung"
+ }
+ ],
+ "encounter": {
+ "reference": "#1"
+ },
+ "onsetPeriod": {
+ "start": "2024-12-24T16:13:43+01:00",
+ "_start": {
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/lebensphase",
+ "valueCodeableConcept": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "41847000",
+ "display": "Adulthood"
+ }
+ ],
+ "text": "Adulthood"
+ }
+ }
+ ]
+ },
+ "_end": {
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/lebensphase",
+ "valueCodeableConcept": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "271872005",
+ "display": "Old age"
+ }
+ ],
+ "text": "Old age"
+ }
+ }
+ ]
+ }
+ },
+ "recordedDate": "2022-02-03T01:00:00+01:00",
+ "note": [
+ {
+ "text": "Patient confirmed for secondary malignant neoplasm of lymph node."
+ }
+ ]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle_whole.json b/src/test/resources/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle_whole.json
new file mode 100644
index 00000000..1940a264
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toFHIR/output/KDS_Diagnose_bundle_whole.json
@@ -0,0 +1,472 @@
+{
+ "resourceType": "Bundle",
+ "type": "collection",
+ "entry": [
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "id": "reference-condition",
+ "contained": {
+ "resourceType": "Encounter",
+ "id": "2",
+ "identifier": [
+ {
+ "type": {
+ "coding": [
+ {
+ "code": "VN"
+ }
+ ]
+ },
+ "value": "encounter-id-1245"
+ }
+ ]
+ },
+ "identifier": [
+ {
+ "system": "http://localhost:8888/fhir-bridge/fhir/identifiers/conditions",
+ "value": "COND-123456",
+ "use": "official",
+ "type": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
+ "code": "MR",
+ "display": "Medical record number"
+ }
+ ],
+ "text": "Medical Record Number"
+ },
+ "assigner": {
+ "display": "Example Hospital"
+ }
+ }
+ ],
+ "extension": [
+ {
+ "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate",
+ "valueDateTime": "2125-02-03T05:05:06+01:00"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
+ "code": "active",
+ "display": "Active"
+ }
+ ],
+ "text": "active"
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "code": "confirmed",
+ "display": "Confirmed"
+ }
+ ],
+ "text": "confirmed"
+ },
+ "severity": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "24484000",
+ "display": "Severe"
+ }
+ ],
+ "text": "Severe"
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C34.1",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung",
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
+ "valueCoding": {
+ "system": "local",
+ "code": "*",
+ "display": "Primary code in multiple coding"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/seitenlokalisation",
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
+ "code": "B",
+ "display": "Beiderseits"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
+ "code": "V",
+ "display": "Verdacht auf Diagnose"
+ }
+ }
+ ]
+ },
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
+ "code": "C34.1",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "098H5",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung, unspecified"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "254626006",
+ "display": "Malignant neoplasm of the upper lobe of lung"
+ },
+ {
+ "system": "http://www.orpha.net",
+ "code": "830",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung"
+ }
+ ],
+ "text": "Malignant neoplasm of upper lobe, bronchus or lung"
+ },
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "321667001",
+ "display": "Respiratory tract, Upper lobe, bronchus or lung"
+ },
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
+ "code": "C34.1",
+ "display": "Upper lobe, bronchus or lung"
+ }
+ ],
+ "text": "Respiratory tract, Upper lobe, bronchus or lung"
+ }
+ ],
+ "encounter": {
+ "reference": "#2"
+ },
+ "onsetPeriod": {
+ "start": {
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/lebensphase",
+ "valueCodeableConcept": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "424144002",
+ "display": "Adulthood"
+ }
+ ],
+ "text": "Adulthood"
+ }
+ }
+ ]
+ },
+ "end": {
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/lebensphase",
+ "valueCodeableConcept": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "367640001",
+ "display": "Middle age"
+ }
+ ],
+ "text": "End of middle age phase"
+ }
+ }
+ ]
+ }
+ },
+ "recordedDate": "2027-05-02T00:00:00Z",
+ "stage": [
+ {
+ "summary": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "258219007",
+ "display": "Stage 2"
+ }
+ ],
+ "text": "Stage 2"
+ }
+ }
+ ],
+ "evidence": [
+ {
+ "code": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "164729004",
+ "display": "Blood pressure measurement"
+ }
+ ],
+ "text": "Blood pressure measurement"
+ }
+ ]
+ }
+ ],
+ "note": [
+ {
+ "text": "The patient has a history of high blood pressure, now presenting with severe hypertension."
+ }
+ ]
+ }
+ },
+ {
+ "resource": {
+ "resourceType": "Condition",
+ "meta": {
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "extension": [
+ {
+ "url": "http://hl7.org/fhir/StructureDefinition/condition-related",
+ "valueReference": {
+ "reference": "#1"
+ }
+ },
+ {
+ "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate",
+ "valueDateTime": "2025-02-03T04:05:06Z"
+ }
+ ],
+ "identifier": [
+ {
+ "system": "http://localhost:8888/fhir-bridge/fhir/identifiers/conditions",
+ "value": "1234567890",
+ "use": "official",
+ "type": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
+ "code": "MR",
+ "display": "Medical record number"
+ }
+ ],
+ "text": "Medical Record Number"
+ },
+ "assigner": {
+ "display": "Example Hospital"
+ },
+ "period": {
+ "start": "2023-01-01",
+ "end": "2024-01-01"
+ }
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
+ "code": "active",
+ "display": "Active"
+ }
+ ],
+ "text": "active"
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
+ "code": "confirmed",
+ "display": "Confirmed"
+ }
+ ],
+ "text": "Confirmed"
+ },
+ "category": [
+ {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-category",
+ "code": "problem-list-item",
+ "display": "Problem List Item"
+ }
+ ],
+ "text": "Problem List Item"
+ }
+ ],
+ "severity": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/condition-severity",
+ "code": "24484000",
+ "display": "Severe"
+ }
+ ],
+ "text": "Severe"
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C34.1",
+ "display": "Malignant neoplasm of the upper lobe of the lung",
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
+ "valueCoding": {
+ "system": "local",
+ "code": "†",
+ "display": "Primary code in multiple coding"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/seitenlokalisation",
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
+ "code": "L",
+ "display": "Left side"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
+ "code": "G",
+ "display": "Confirmed diagnosis"
+ }
+ }
+ ]
+ },
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
+ "code": "C77.0",
+ "display": "Malignant neoplasm of lymph nodes"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "057E3",
+ "display": "secondary malignant neoplasm of lymph nodes"
+ },
+ {
+ "system": "http://www.orpha.net",
+ "code": "1777",
+ "display": "lung cancer associated with hereditary syndromes"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "128462008",
+ "display": "Secondary malignant neoplasm of lymph node"
+ }
+ ],
+ "text": "Secondary malignant neoplasm of lymph node"
+ },
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "321667001",
+ "display": "Respiratory tract"
+ },
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
+ "code": "C34.1",
+ "display": "Upper lobe, bronchus or lung"
+ }
+ ],
+ "text": "Respiratory tract, Upper lobe, bronchus or lung"
+ }
+ ],
+ "encounter": {
+ "reference": "Encounter/encounter-12345",
+ "display": "Inpatient Encounter for Asthma",
+ "type": "Encounter",
+ "identifier": {
+ "system": "http://hospital.smarthealthit.org/encounters",
+ "value": "ENC123456",
+ "use": "official",
+ "type": {
+ "coding": [
+ {
+ "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
+ "code": "VN",
+ "display": "Visit Number"
+ }
+ ],
+ "text": "Visit Number"
+ },
+ "assigner": {
+ "display": "Example Hospital"
+ },
+ "period": {
+ "start": "2024-01-01T08:00:00Z",
+ "end": "2024-01-01T10:00:00Z"
+ }
+ }
+ },
+ "subject": {
+ "reference": "/Patient?identifier=urn:ietf:rfc:4122|07f602e0-579e-4fe3-95af-381728bf0d49",
+ "identifier": {
+ "system": "urn:ietf:rfc:4122",
+ "value": "4c7d0173-7378-42b2-a9fa-64cd2664674f"
+ }
+ },
+ "onsetPeriod": {
+ "start": {
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/lebensphase",
+ "valueCodeableConcept": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "424144002",
+ "display": "Adulthood"
+ }
+ ],
+ "text": "Adulthood"
+ }
+ }
+ ]
+ },
+ "end": {
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/lebensphase",
+ "valueCodeableConcept": {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "367640001",
+ "display": "Middle age"
+ }
+ ],
+ "text": "End of middle age phase"
+ }
+ }
+ ]
+ }
+ },
+ "onsetDateTime": "2024-02-08T00:00:00Z",
+ "recordedDate": "2022-02-03T00:00:00Z",
+ "note": [
+ {
+ "text": "Patient confirmed for secondary malignant neoplasm of lymph node.",
+ "time": "2024-02-09T12:00:00Z"
+ }
+ ]
+ }
+ }
+
+ ]
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-1-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-1-diagnose-1.json
new file mode 100644
index 00000000..f5160294
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-1-diagnose-1.json
@@ -0,0 +1,124 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:51:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-1-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-1-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "extension": [
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
+ "valueCoding": {
+ "code": "†",
+ "system": "http://fhir.de/CodeSystem/icd-10-gm-mehrfachcodierungs-kennzeichen"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/seitenlokalisation",
+ "valueCoding": {
+ "code": "B",
+ "system": "https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_ICD_SEITENLOKALISATION",
+ "display": "beiderseits"
+ }
+ },
+ {
+ "url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
+ "valueCoding": {
+ "code": "G",
+ "system": "https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_ICD_DIAGNOSESICHERHEIT",
+ "display": "gesicherte Diagnose"
+ }
+ }
+ ],
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "B05.3",
+ "version": "2023"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I29578",
+ "version": "2023",
+ "display": "Masern mit Otitis"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "13420004",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Post measles otitis media (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Masernotitis"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "25342003",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Middle ear structure (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-1"
+ },
+ "recordedDate": "2024-02-21",
+ "onsetDateTime": "2024-02-21"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-10-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-10-diagnose-1.json
new file mode 100644
index 00000000..5bb562dc
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-10-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-10",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T14:00:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-10-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-10-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "G43.9",
+ "version": "2019"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I18412",
+ "version": "2019",
+ "display": "Migräne"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "37796009",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Migraine (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Migräne, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "281231009",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Vascular structure of head (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-10"
+ },
+ "recordedDate": "2019-05-14"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-2-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-2-diagnose-1.json
new file mode 100644
index 00000000..3360647c
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-2-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-2",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:53:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-2-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-2-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C34.1",
+ "version": "2024"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I30011",
+ "version": "2024",
+ "display": "Bösartige Neubildung des Lungenoberlappens"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "254637007",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Non-small cell lung cancer (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Bösartige Neubildung: Oberlappen-Bronchus"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "45653009",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Structure of upper lobe of lung (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-2"
+ },
+ "recordedDate": "2024-03-02"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-3-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-3-diagnose-1.json
new file mode 100644
index 00000000..0640e64d
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-3-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-3",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:51:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-3-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-3-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C21.8",
+ "version": "2022"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I29975",
+ "version": "2022",
+ "display": "Bösartige anorektale Neubildung"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "447886005",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Adenocarcinoma of anorectum (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Bösartige anorektale Neubildung"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "281088000",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Structure of anus and/or rectum (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-3"
+ },
+ "recordedDate": "2022-04-02"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-4-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-4-diagnose-1.json
new file mode 100644
index 00000000..15b3eac4
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-4-diagnose-1.json
@@ -0,0 +1,74 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-4",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:54:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-4-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-4-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "C16.9",
+ "version": "2022"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Bösartige Neubildung des Magens nicht näher bezeichnet"
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-4"
+ },
+ "recordedDate": "2022-11-30"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-5-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-5-diagnose-1.json
new file mode 100644
index 00000000..296975cc
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-5-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-5",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:55:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-5-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-5-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "N80.1",
+ "version": "2023"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I133980",
+ "version": "2023",
+ "display": "Endometriose des Ovars"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "129103003",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Endometriosis (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Endometriose des Ovars"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "15497006",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Ovarian structure (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-5"
+ },
+ "recordedDate": "2023-07-10"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-6-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-6-diagnose-1.json
new file mode 100644
index 00000000..14f9a6f0
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-6-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-6",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:56:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-6-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-6-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "K29.5",
+ "version": "2022"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I30016",
+ "version": "2022",
+ "display": "Chronische Gastritis"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "4556007",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Gastritis (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Chronische Gastritis, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "69695003",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Stomach structure (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-6"
+ },
+ "recordedDate": "2022-03-12"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-7-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-7-diagnose-1.json
new file mode 100644
index 00000000..e9c6ca4e
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-7-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-7",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:57:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-7-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-7-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "J20.9",
+ "version": "2024"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I25780",
+ "version": "2024",
+ "display": "Akute Bronchitis"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "10509002",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Acute bronchitis (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Akute Bronchitis, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "955009",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Bronchial structure (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-7"
+ },
+ "recordedDate": "2024-01-08"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-8-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-8-diagnose-1.json
new file mode 100644
index 00000000..0678da28
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-8-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-8",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:58:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-8-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-8-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "I25.9",
+ "version": "2023"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I26852",
+ "version": "2023",
+ "display": "Chronische ischämische Herzkrankheit"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "413838009",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Chronic ischemic heart disease (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Chronische ischämische Herzkrankheit, nicht näher bezeichnet"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "80891009",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Heart structure (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-8"
+ },
+ "recordedDate": "2023-11-10"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-9-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-9-diagnose-1.json
new file mode 100644
index 00000000..74fa0fb5
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/Condition-mii-exa-test-data-patient-9-diagnose-1.json
@@ -0,0 +1,98 @@
+{
+ "resourceType": "Bundle",
+ "id": "mii-exa-test-data-bundle-pat-9",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ]
+ },
+ "type": "transaction",
+ "timestamp": "2025-06-18T13:59:00+02:00",
+ "entry": [
+ {
+ "request": {
+ "method": "POST",
+ "url": "Condition"
+ },
+ "fullUrl": "https://www.medizininformatik-initiative.de/Condition/mii-exa-test-data-patient-9-diagnose-1",
+ "resource": {
+ "resourceType": "Condition",
+ "id": "mii-exa-test-data-patient-9-diagnose-1",
+ "meta": {
+ "security": [
+ {
+ "code": "HTEST",
+ "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
+ "display": "test health data"
+ }
+ ],
+ "profile": [
+ "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
+ ]
+ },
+ "code": {
+ "coding": [
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
+ "code": "N83.2",
+ "version": "2024"
+ },
+ {
+ "system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
+ "code": "I20743",
+ "version": "2024",
+ "display": "Ovarialzyste"
+ },
+ {
+ "system": "http://snomed.info/sct",
+ "code": "79883001",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Cyst of ovary (disorder)"
+ }
+ ]
+ },
+ "note": [
+ {
+ "text": "Sonstige und nicht näher bezeichnete Ovarialzysten"
+ }
+ ],
+ "bodySite": [
+ {
+ "coding": [
+ {
+ "system": "http://snomed.info/sct",
+ "code": "15497006",
+ "version": "http://snomed.info/sct/900000000000207008/version/20230731",
+ "display": "Ovarian structure (body structure)"
+ }
+ ]
+ }
+ ],
+ "clinicalStatus": {
+ "coding": [
+ {
+ "code": "active",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ }
+ ]
+ },
+ "verificationStatus": {
+ "coding": [
+ {
+ "code": "confirmed",
+ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status"
+ }
+ ]
+ },
+ "subject": {
+ "reference": "Patient/mii-exa-test-data-patient-9"
+ },
+ "recordedDate": "2024-02-20"
+ }
+ }
+ ]
+}
diff --git a/src/test/resources/kds/diagnose/KDS_Diagnose_bundle.json b/src/test/resources/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle.json
similarity index 91%
rename from src/test/resources/kds/diagnose/KDS_Diagnose_bundle.json
rename to src/test/resources/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle.json
index 8c51be15..8400e43b 100644
--- a/src/test/resources/kds/diagnose/KDS_Diagnose_bundle.json
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle.json
@@ -121,41 +121,26 @@
"extension": [
{
"url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
- "valueCodeableConcept": {
- "coding": [
- {
+ "valueCoding": {
"system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm-mc",
"code": "†",
"display": "Primary code in multiple coding"
- }
- ],
- "text": "Primary code in multiple coding"
}
},
{
"url": "http://fhir.de/StructureDefinition/seitenlokalisation",
- "valueCodeableConcept": {
- "coding": [
- {
+ "valueCoding": {
"system": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
"code": "L",
"display": "Left side"
}
- ],
- "text": "Left side"
- }
- },
+ },
{
"url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
- "valueCodeableConcept": {
- "coding": [
- {
+ "valueCoding": {
"system": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
"code": "G",
"display": "Confirmed diagnosis"
- }
- ],
- "text": "Confirmed diagnosis"
}
}
]
@@ -246,11 +231,11 @@
"coding": [
{
"system": "http://snomed.info/sct",
- "code": "424144002",
+ "code": "41847000",
"display": "Adulthood"
}
],
- "text": "Start of adulthood phase"
+ "text": "Adulthood"
}
}
]
@@ -263,11 +248,11 @@
"coding": [
{
"system": "http://snomed.info/sct",
- "code": "367640001",
- "display": "Middle age"
+ "code": "271872005",
+ "display": "Old age"
}
],
- "text": "End of middle age phase"
+ "text": "Old age"
}
}
]
diff --git a/src/test/resources/kds/diagnose/KDS_Diagnose_bundle_whole.json b/src/test/resources/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle_whole.json
similarity index 83%
rename from src/test/resources/kds/diagnose/KDS_Diagnose_bundle_whole.json
rename to src/test/resources/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle_whole.json
index 06cd3440..35c42ef5 100644
--- a/src/test/resources/kds/diagnose/KDS_Diagnose_bundle_whole.json
+++ b/src/test/resources/kds/diagnose/toOpenEHR/input/KDS_Diagnose_bundle_whole.json
@@ -121,41 +121,27 @@
"extension": [
{
"url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
- "valueCodeableConcept": {
- "coding": [
+ "valueCoding":
{
"system": "local",
"code": "†",
"display": "Primary code in multiple coding"
}
- ],
- "text": "Primary code in multiple coding"
- }
},
{
"url": "http://fhir.de/StructureDefinition/seitenlokalisation",
- "valueCodeableConcept": {
- "coding": [
- {
+ "valueCoding": {
"system": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
"code": "L",
"display": "Left side"
}
- ],
- "text": "Left side"
- }
},
{
"url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
- "valueCodeableConcept": {
- "coding": [
- {
- "system": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
- "code": "G",
- "display": "Confirmed diagnosis"
- }
- ],
- "text": "Confirmed diagnosis"
+ "valueCoding": {
+ "system": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
+ "code": "G",
+ "display": "Confirmed diagnosis"
}
}
]
@@ -249,7 +235,7 @@
"display": "Adulthood"
}
],
- "text": "Start of adulthood phase"
+ "text": "Adulthood"
}
}
]
@@ -320,111 +306,98 @@
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
- "code": "ref_active",
- "display": "ref_Active"
+ "code": "active",
+ "display": "Active"
}
],
- "text": "ref_active"
+ "text": "active"
},
"verificationStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
- "code": "ref_confirmed",
- "display": "ref_Confirmed"
+ "code": "confirmed",
+ "display": "Confirmed"
}
],
- "text": "ref_confirmed"
+ "text": "confirmed"
},
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-category",
- "code": "ref_problem-list-item",
- "display": "ref_Problem List Item"
+ "code": "problem-list-item",
+ "display": "Problem List Item"
}
],
- "text": "ref_Problem List Item"
+ "text": "Problem List Item"
}
],
"severity": {
"coding": [
{
"system": "http://snomed.info/sct",
- "code": "ref_24484000",
- "display": "ref_Severe"
+ "code": "24484000",
+ "display": "Severe"
}
],
- "text": "ref_Severe"
+ "text": "Severe"
},
"code": {
"coding": [
{
"system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
- "code": "ref_C34.1",
- "display": "ref_Malignant neoplasm of upper lobe, bronchus or lung",
+ "code": "C34.1",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung",
"extension": [
{
"url": "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen",
- "valueCodeableConcept": {
- "coding": [
- {
+ "valueCoding": {
+
"system": "local",
"code": "*",
- "display": "ref_Primary code in multiple coding"
- }
- ],
- "text": "ref_Primary code in multiple coding"
- }
- },
+ "display": "Primary code in multiple coding"
+
+ }},
{
"url": "http://fhir.de/StructureDefinition/seitenlokalisation",
- "valueCodeableConcept": {
- "coding": [
- {
+ "valueCoding": {
"system": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation",
- "code": "ref_U",
- "display": "ref_Upper lobe"
- }
- ],
- "text": "ref_Upper lobe"
+ "code": "B",
+ "display": "Beiderseits"
}
},
{
"url": "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit",
- "valueCodeableConcept": {
- "coding": [
+ "valueCoding":
{
"system": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit",
- "code": "ref_S",
- "display": "ref_Suspected diagnosis"
+ "code": "V",
+ "display": "Verdacht auf Diagnose"
}
- ],
- "text": "ref_Suspected diagnosis"
- }
}
]
},
{
"system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
- "code": "ref_C34.1",
- "display": "ref_Malignant neoplasm of upper lobe, bronchus or lung"
+ "code": "C34.1",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung"
},
{
"system": "http://fhir.de/CodeSystem/bfarm/alpha-id",
- "code": "ref_098H5",
- "display": "ref_Malignant neoplasm of upper lobe, bronchus or lung, unspecified"
+ "code": "098H5",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung, unspecified"
},
{
"system": "http://snomed.info/sct",
- "code": "ref_254626006",
- "display": "ref_Malignant neoplasm of the upper lobe of lung"
+ "code": "254626006",
+ "display": "Malignant neoplasm of the upper lobe of lung"
},
{
"system": "http://www.orpha.net",
- "code": "ref_830",
- "display": "ref_Malignant neoplasm of upper lobe, bronchus or lung"
+ "code": "830",
+ "display": "Malignant neoplasm of upper lobe, bronchus or lung"
}
],
"text": "Malignant neoplasm of upper lobe, bronchus or lung"
@@ -434,14 +407,14 @@
"coding": [
{
"system": "http://snomed.info/sct",
- "code": "ref_368209003",
- "display": "ref_Entire cardiovascular system"
+ "code": "368209003",
+ "display": "Entire cardiovascular system"
},
{
"system": "http://terminology.hl7.org/CodeSystem/icd-o-3",
"version": "2022",
- "code": "ref_C34.1",
- "display": "ref_Upper lobe, bronchus or lung"
+ "code": "C34.1",
+ "display": "Upper lobe, bronchus or lung"
}
],
"text": "Entire cardiovascular system"
@@ -490,11 +463,11 @@
"coding": [
{
"system": "http://snomed.info/sct",
- "code": "ref_424144002",
- "display": "ref_Adulthood"
+ "code": "424144002",
+ "display": "Adulthood"
}
],
- "text": "ref_Start of adulthood phase"
+ "text": "Adulthood"
}
}
]
@@ -507,11 +480,11 @@
"coding": [
{
"system": "http://snomed.info/sct",
- "code": "ref_367640001",
- "display": "ref_Middle age"
+ "code": "367640001",
+ "display": "Middle age"
}
],
- "text": "ref_End of middle age phase"
+ "text": "End of middle age phase"
}
}
]
@@ -580,7 +553,7 @@
],
"note": [
{
- "text": "ref_The patient has a history of high blood pressure, now presenting with severe hypertension."
+ "text": "The patient has a history of high blood pressure, now presenting with severe hypertension."
}
]
}
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-1-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-1-diagnose-1.json
new file mode 100644
index 00000000..facfd571
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-1-diagnose-1.json
@@ -0,0 +1,370 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2024-02-21T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I29578",
+ "preferred_term": "Masern mit Otitis"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "13420004",
+ "preferred_term": "Post measles otitis media (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "B05.3"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Middle ear structure (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "25342003"
+ }
+ },
+ "archetype_node_id": "at0001"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Lateralität"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "beiderseits",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_ICD_SEITENLOKALISATION"
+ },
+ "code_string": "B"
+ }
+ },
+ "archetype_node_id": "at0002"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinisch relevanter Zeitraum (Zeitpunkt des Auftretens)"
+ },
+ "value": {
+ "_type": "DV_DATE_TIME",
+ "value": "2024-02-21T00:00:00"
+ },
+ "archetype_node_id": "at0077"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungskennzeichen_ICD-10-GM"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungkennzeichen"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "†",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0002"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosesicherheit"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "gesicherte Diagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_ICD_DIAGNOSESICHERHEIT"
+ },
+ "code_string": "G"
+ }
+ },
+ "archetype_node_id": "at0073"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Masernotitis"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-10-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-10-diagnose-1.json
new file mode 100644
index 00000000..53b479ea
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-10-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2019-05-14T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I18412",
+ "preferred_term": "Migräne"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "37796009",
+ "preferred_term": "Migraine (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "G43.9"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Vascular structure of head (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "281231009"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Migräne, nicht näher bezeichnet"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-2-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-2-diagnose-1.json
new file mode 100644
index 00000000..077c0485
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-2-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2024-03-02T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I30011",
+ "preferred_term": "Bösartige Neubildung des Lungenoberlappens"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "254637007",
+ "preferred_term": "Non-small cell lung cancer (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "C34.1"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Structure of upper lobe of lung (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "45653009"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Bösartige Neubildung: Oberlappen-Bronchus"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-3-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-3-diagnose-1.json
new file mode 100644
index 00000000..393db4f8
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-3-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2022-04-02T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I29975",
+ "preferred_term": "Bösartige anorektale Neubildung"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "447886005",
+ "preferred_term": "Adenocarcinoma of anorectum (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "C21.8"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Structure of anus and/or rectum (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "281088000"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Bösartige anorektale Neubildung"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-4-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-4-diagnose-1.json
new file mode 100644
index 00000000..5635c787
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-4-diagnose-1.json
@@ -0,0 +1,218 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2022-11-30T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "C16.9"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Bösartige Neubildung des Magens nicht näher bezeichnet"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-5-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-5-diagnose-1.json
new file mode 100644
index 00000000..5c5956ae
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-5-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2023-07-10T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I133980",
+ "preferred_term": "Endometriose des Ovars"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "129103003",
+ "preferred_term": "Endometriosis (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "N80.1"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Ovarian structure (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "15497006"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Endometriose des Ovars"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-6-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-6-diagnose-1.json
new file mode 100644
index 00000000..de4a4982
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-6-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2022-03-12T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I30016",
+ "preferred_term": "Chronische Gastritis"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "4556007",
+ "preferred_term": "Gastritis (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "K29.5"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Stomach structure (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "69695003"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Chronische Gastritis, nicht näher bezeichnet"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-7-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-7-diagnose-1.json
new file mode 100644
index 00000000..87a94425
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-7-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2024-01-08T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I25780",
+ "preferred_term": "Akute Bronchitis"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "10509002",
+ "preferred_term": "Acute bronchitis (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "J20.9"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Bronchial structure (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "955009"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Akute Bronchitis, nicht näher bezeichnet"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-8-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-8-diagnose-1.json
new file mode 100644
index 00000000..95fc144b
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-8-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2023-11-10T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I26852",
+ "preferred_term": "Chronische ischämische Herzkrankheit"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "413838009",
+ "preferred_term": "Chronic ischemic heart disease (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "I25.9"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Heart structure (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "80891009"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Chronische ischämische Herzkrankheit, nicht näher bezeichnet"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-9-diagnose-1.json b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-9-diagnose-1.json
new file mode 100644
index 00000000..0f9b8243
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/Composition-mii-exa-test-data-patient-9-diagnose-1.json
@@ -0,0 +1,282 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2024-02-20T00:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "I20743",
+ "preferred_term": "Ovarialzyste"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "79883001",
+ "preferred_term": "Cyst of ovary (disorder)"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "N83.2"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Ovarian structure (body structure)",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "15497006"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Sonstige und nicht näher bezeichnete Ovarialzysten"
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/KDS_Diagnose_Composition.flat.json b/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition.flat.json
similarity index 100%
rename from src/test/resources/kds/diagnose/KDS_Diagnose_Composition.flat.json
rename to src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition.flat.json
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle.json b/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle.json
new file mode 100644
index 00000000..0cb361c3
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle.json
@@ -0,0 +1,539 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2022-02-03T01:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ },
+ "other_context": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Tree"
+ },
+ "items": [
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Fallidentifikation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.case_identification.v0"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Fall-Kennung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "encounter-id-1245"
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.case_identification.v0"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Secondary malignant neoplasm of lymph node",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/icd-o-3"
+ },
+ "code_string": "C77.0",
+ "preferred_term": "Malignant neoplasm of lymph nodes"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "057E3",
+ "preferred_term": "secondary malignant neoplasm of lymph nodes"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://www.orpha.net"
+ },
+ "code_string": "1777",
+ "preferred_term": "lung cancer associated with hereditary syndromes"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "128462008",
+ "preferred_term": "Secondary malignant neoplasm of lymph node"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "C34.1"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Respiratory tract, Upper lobe, bronchus or lung",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/icd-o-3"
+ },
+ "code_string": "C34.1",
+ "preferred_term": "Upper lobe, bronchus or lung"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "321667001"
+ }
+ },
+ "archetype_node_id": "at0001"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Lateralität"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Left side",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation"
+ },
+ "code_string": "L"
+ }
+ },
+ "archetype_node_id": "at0002"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinisch relevanter Zeitraum (Zeitpunkt des Auftretens)"
+ },
+ "value": {
+ "_type": "DV_DATE_TIME",
+ "value": "2024-12-24T16:13:43"
+ },
+ "archetype_node_id": "at0077"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Feststellungsdatum"
+ },
+ "value": {
+ "_type": "DV_DATE_TIME",
+ "value": "2025-02-03T05:05:06"
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Schweregrad"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Severe",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-severity"
+ },
+ "code_string": "24484000"
+ }
+ },
+ "archetype_node_id": "at0005"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Lebensphase"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.lebensphase.v0"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Beginn"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Adulthood",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "41847000"
+ }
+ },
+ "archetype_node_id": "at0001"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Ende"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Old age",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "271872005"
+ }
+ },
+ "archetype_node_id": "at0002"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.lebensphase.v0"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungskennzeichen_ICD-10-GM"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungkennzeichen"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "†",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0002"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Active",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Nebendiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0066"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosesicherheit"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Confirmed diagnosis",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit"
+ },
+ "code_string": "G"
+ }
+ },
+ "archetype_node_id": "at0073"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Patient confirmed for secondary malignant neoplasm of lymph node."
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle_whole.json b/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle_whole.json
new file mode 100644
index 00000000..4504307c
--- /dev/null
+++ b/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_Composition_bundle_whole.json
@@ -0,0 +1,947 @@
+{
+ "_type": "COMPOSITION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-COMPOSITION.report.v1"
+ },
+ "template_id": {
+ "value": "KDS_Diagnose"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "territory": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_3166-1"
+ },
+ "code_string": "DE"
+ },
+ "category": {
+ "_type": "DV_CODED_TEXT",
+ "value": "event",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "433"
+ }
+ },
+ "composer": {
+ "_type": "PARTY_SELF"
+ },
+ "context": {
+ "_type": "EVENT_CONTEXT",
+ "start_time": {
+ "_type": "DV_DATE_TIME",
+ "value": "2022-02-03T01:00:00"
+ },
+ "setting": {
+ "_type": "DV_CODED_TEXT",
+ "value": "other care",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "openehr"
+ },
+ "code_string": "238"
+ }
+ },
+ "other_context": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Tree"
+ },
+ "items": [
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Fallidentifikation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.case_identification.v0"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Fall-Kennung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "encounter-id-1245"
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.case_identification.v0"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ }
+ },
+ "content": [
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Secondary malignant neoplasm of lymph node",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/icd-o-3"
+ },
+ "code_string": "C77.0",
+ "preferred_term": "Malignant neoplasm of lymph nodes"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "057E3",
+ "preferred_term": "secondary malignant neoplasm of lymph nodes"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://www.orpha.net"
+ },
+ "code_string": "1777",
+ "preferred_term": "lung cancer associated with hereditary syndromes"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "128462008",
+ "preferred_term": "Secondary malignant neoplasm of lymph node"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "C34.1"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Respiratory tract, Upper lobe, bronchus or lung",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/icd-o-3"
+ },
+ "code_string": "C34.1",
+ "preferred_term": "Upper lobe, bronchus or lung"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "321667001"
+ }
+ },
+ "archetype_node_id": "at0001"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Lateralität"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Left side",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation"
+ },
+ "code_string": "L"
+ }
+ },
+ "archetype_node_id": "at0002"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Feststellungsdatum"
+ },
+ "value": {
+ "_type": "DV_DATE_TIME",
+ "value": "2025-02-03T05:05:06"
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Schweregrad"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Severe",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-severity"
+ },
+ "code_string": "24484000"
+ }
+ },
+ "archetype_node_id": "at0005"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Lebensphase"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.lebensphase.v0"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Beginn"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Adulthood",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "424144002"
+ }
+ },
+ "archetype_node_id": "at0001"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Ende"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "End of middle age phase",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "367640001"
+ }
+ },
+ "archetype_node_id": "at0002"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.lebensphase.v0"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungskennzeichen_ICD-10-GM"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungkennzeichen"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "†",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0002"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "active",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Nebendiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0066"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosesicherheit"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Confirmed diagnosis",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit"
+ },
+ "code_string": "G"
+ }
+ },
+ "archetype_node_id": "at0073"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "Patient confirmed for secondary malignant neoplasm of lymph node."
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ {
+ "_type": "EVALUATION",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnose"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "language": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "ISO_639-1"
+ },
+ "code_string": "de"
+ },
+ "encoding": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "IANA_character-sets"
+ },
+ "code_string": "UTF-8"
+ },
+ "subject": {
+ "_type": "PARTY_SELF"
+ },
+ "data": {
+ "_type": "ITEM_TREE",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Structure"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Kodierte Diagnose"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Malignant neoplasm of upper lobe, bronchus or lung",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/icd-o-3"
+ },
+ "code_string": "C34.1",
+ "preferred_term": "Malignant neoplasm of upper lobe, bronchus or lung"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/alpha-id"
+ },
+ "code_string": "098H5",
+ "preferred_term": "Malignant neoplasm of upper lobe, bronchus or lung, unspecified"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "254626006",
+ "preferred_term": "Malignant neoplasm of the upper lobe of lung"
+ }
+ },
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://www.orpha.net"
+ },
+ "code_string": "830",
+ "preferred_term": "Malignant neoplasm of upper lobe, bronchus or lung"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/bfarm/icd-10-gm"
+ },
+ "code_string": "C34.1"
+ }
+ },
+ "archetype_node_id": "at0002"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Anatomische Lokalisation"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Name der Körperstelle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Entire cardiovascular system",
+ "mappings": [
+ {
+ "_type": "TERM_MAPPING",
+ "match": "?",
+ "target": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/icd-o-3"
+ },
+ "code_string": "C34.1",
+ "preferred_term": "Upper lobe, bronchus or lung"
+ }
+ }
+ ],
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "368209003"
+ }
+ },
+ "archetype_node_id": "at0001"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Lateralität"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Beiderseits",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/dimdi/seitenlokalisation"
+ },
+ "code_string": "B"
+ }
+ },
+ "archetype_node_id": "at0002"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.anatomical_location.v1"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Feststellungsdatum"
+ },
+ "value": {
+ "_type": "DV_DATE_TIME",
+ "value": "2125-02-03T05:05:06"
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Schweregrad"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Severe",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "24484000"
+ }
+ },
+ "archetype_node_id": "at0005"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Lebensphase"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.lebensphase.v0"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Beginn"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Adulthood",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "424144002"
+ }
+ },
+ "archetype_node_id": "at0001"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Ende"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "End of middle age phase",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://snomed.info/sct"
+ },
+ "code_string": "367640001"
+ }
+ },
+ "archetype_node_id": "at0002"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.lebensphase.v0"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungskennzeichen_ICD-10-GM"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Mehrfachkodierungkennzeichen"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "*",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0003"
+ }
+ },
+ "archetype_node_id": "at0001"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1"
+ },
+ {
+ "_type": "CLUSTER",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "archetype_details": {
+ "archetype_id": {
+ "value": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ "rm_version": "1.0.4"
+ },
+ "items": [
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosestatus"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Festgestellt",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0018"
+ }
+ },
+ "archetype_node_id": "at0004"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Klinischer Status"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "active",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://terminology.hl7.org/CodeSystem/condition-clinical"
+ },
+ "code_string": "active"
+ }
+ },
+ "archetype_node_id": "at0003"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoserolle"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Hauptdiagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "local"
+ },
+ "code_string": "at0064"
+ }
+ },
+ "archetype_node_id": "at0063"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-CLUSTER.problem_qualifier.v2"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnosesicherheit"
+ },
+ "value": {
+ "_type": "DV_CODED_TEXT",
+ "value": "Verdacht auf Diagnose",
+ "defining_code": {
+ "_type": "CODE_PHRASE",
+ "terminology_id": {
+ "_type": "TERMINOLOGY_ID",
+ "value": "http://fhir.de/CodeSystem/dimdi/diagnosesicherheit"
+ },
+ "code_string": "V"
+ }
+ },
+ "archetype_node_id": "at0073"
+ },
+ {
+ "_type": "ELEMENT",
+ "name": {
+ "_type": "DV_TEXT",
+ "value": "Diagnoseerläuterung"
+ },
+ "value": {
+ "_type": "DV_TEXT",
+ "value": "The patient has a history of high blood pressure, now presenting with severe hypertension."
+ },
+ "archetype_node_id": "at0069"
+ }
+ ],
+ "archetype_node_id": "at0001"
+ },
+ "archetype_node_id": "openEHR-EHR-EVALUATION.problem_diagnosis.v1"
+ }
+ ],
+ "archetype_node_id": "openEHR-EHR-COMPOSITION.report.v1"
+}
\ No newline at end of file
diff --git a/src/test/resources/kds/diagnose/KDS_Diagnose_multiple_Composition.flat.json b/src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_multiple_Composition.flat.json
similarity index 100%
rename from src/test/resources/kds/diagnose/KDS_Diagnose_multiple_Composition.flat.json
rename to src/test/resources/kds/diagnose/toOpenEHR/output/KDS_Diagnose_multiple_Composition.flat.json
diff --git a/src/test/resources/kds/medikationseintrag/old/Composition-Fhir-Bundle-input.json b/src/test/resources/kds/medikationseintrag/old/Composition-Fhir-Bundle-input.json
new file mode 100644
index 00000000..acb02c40
--- /dev/null
+++ b/src/test/resources/kds/medikationseintrag/old/Composition-Fhir-Bundle-input.json
@@ -0,0 +1 @@
+Couldn't find any Context mapper for the given Resource. Make sure at least one Context mapper exists where fhir.resourceType is of this type (Bundle) and condition within the context mapper allows for it to be applied on this specific resource.
\ No newline at end of file
diff --git a/src/test/resources/kds/medikationseintrag/old/Composition-KDSMedicationRequest.flat.json b/src/test/resources/kds/medikationseintrag/old/Composition-KDSMedicationRequest.flat.json
new file mode 100644
index 00000000..6cde70e6
--- /dev/null
+++ b/src/test/resources/kds/medikationseintrag/old/Composition-KDSMedicationRequest.flat.json
@@ -0,0 +1 @@
+{"timestamp":1769173414511,"status":500,"error":"Internal Server Error","message":"HAPI-1838: Invalid JSON content detected, missing required element: 'resourceType'","path":"/openfhir/toopenehr"}
\ No newline at end of file
diff --git a/src/test/resources/kds/medikationseintrag/old/Composition-jsonobject-from-flat.json b/src/test/resources/kds/medikationseintrag/old/Composition-jsonobject-from-flat.json
new file mode 100644
index 00000000..5583ccac
--- /dev/null
+++ b/src/test/resources/kds/medikationseintrag/old/Composition-jsonobject-from-flat.json
@@ -0,0 +1 @@
+{"timestamp":1769173414487,"status":500,"error":"Internal Server Error","message":"HAPI-1838: Invalid JSON content detected, missing required element: 'resourceType'","path":"/openfhir/toopenehr"}
\ No newline at end of file
diff --git a/src/test/resources/kds_new/model/admin_entry/org.highmed/person_data.v0.yml b/src/test/resources/kds_new/model/admin_entry/org.highmed/person_data.v0.yml
index 002d04fa..93362057 100644
--- a/src/test/resources/kds_new/model/admin_entry/org.highmed/person_data.v0.yml
+++ b/src/test/resources/kds_new/model/admin_entry/org.highmed/person_data.v0.yml
@@ -12,12 +12,17 @@ spec:
fhirConfig:
structureDefinition: http://hl7.org/fhir/StructureDefinition/Patient
-preprocessor:
- fhirCondition:
- targetRoot: "$resource"
- targetAttribute: "active" # exclude non-active patients
- operator: "one of"
- criteria: "false"
+#preprocessor: Logic not supported yet
+# fhirCondition:
+# - targetRoot: "$resource"
+# targetAttribute: "active" # exclude non-active patients
+# operator: "not empty"
+# if yes:
+# fhirCondition:
+# targetRoot: "$resource"
+# targetAttribute: "active" # exclude non-active patients
+# operator: "one of"
+# criteria: "true"
mappings:
- name: "personData"
@@ -30,7 +35,7 @@ mappings:
with:
fhir: "$resource.deceased.as(Boolean)"
openehr: "$archetype/data[at0001]/items[at0024]/items[at0025]"
-
+
- name: "deathDateTime"
with:
@@ -39,7 +44,7 @@ mappings:
manual:
- name: "deathboolean"
openehr:
- - path: "items[at0025]/value"
+ - path: "items[at0025]"
value: "True"
fhirCondition:
targetRoot: "$resource"
diff --git a/src/test/resources/kds_new/model/admin_entry/org.highmed/versicherungsinformationen.v0.yml b/src/test/resources/kds_new/model/admin_entry/org.highmed/versicherungsinformationen.v0.yml
index d7775f20..203729a6 100644
--- a/src/test/resources/kds_new/model/admin_entry/org.highmed/versicherungsinformationen.v0.yml
+++ b/src/test/resources/kds_new/model/admin_entry/org.highmed/versicherungsinformationen.v0.yml
@@ -1,16 +1,16 @@
grammar: FHIRConnect/v0.9.0
type: model
metadata:
- name: ADMIN_ENTRY.versicherungsinformationen.v0
- version: 0.0.1-alpha
-spec:
+ name: ADMIN_ENTRY.versicherungsinformationen.v0
+ version: 0.0.1-alpha
+spec:
system: FHIR
version: R4
openEhrConfig:
archetype: openEHR-EHR-ADMIN_ENTRY.versicherungsinformationen.v0
revision: 0.0.1-alpha
fhirConfig:
- structureDefinition: http://hl7.org/fhir/StructureDefinition/BackboneElement
+ structureDefinition: http://hl7.org/fhir/StructureDefinition/Identifier
mappings:
- name: "versicherungsId"
diff --git a/src/test/resources/kds_new/model/cluster/org.highmed/multiple_coding_icd10gm.v1.yml b/src/test/resources/kds_new/model/cluster/org.highmed/multiple_coding_icd10gm.v1.yml
index 5eb2c0ee..b88f4894 100644
--- a/src/test/resources/kds_new/model/cluster/org.highmed/multiple_coding_icd10gm.v1.yml
+++ b/src/test/resources/kds_new/model/cluster/org.highmed/multiple_coding_icd10gm.v1.yml
@@ -15,7 +15,7 @@ spec:
mappings:
- name: "mehrfachcodierung"
with:
- fhir: "$fhirRoot.value.as(CodeableConcept).coding" #fhir.extension
+ fhir: "$fhirRoot.value.as(Coding)" #fhir.extension
openehr: "$archetype/items[at0001]"
manual:
- name: "manifestation"
@@ -27,7 +27,7 @@ mappings:
- path: "value"
value: "*"
fhirCondition:
- targetRoot: "$fhirRoot.value.as(CodeableConcept).coding"
+ targetRoot: "$fhirRoot.value.as(Coding)"
targetAttribute: "code"
operator: "one of"
criteria: "*"
@@ -39,7 +39,7 @@ mappings:
- path: "system"
value: "http://fhir.de/ValueSet/icd-10-gm-mehrfachcodierungs-kennzeichen"
openehrCondition:
- targetRoot: "$openehrRoot"
+ targetRoot: "$openehrRoot/items[at0001]"
targetAttribute: "defining_code/code_string"
operator: "one of"
criteria: "at0003"
@@ -53,7 +53,7 @@ mappings:
- path: "value"
value: "†"
fhirCondition:
- targetRoot: "$fhirRoot.value.as(CodeableConcept).coding"
+ targetRoot: "$fhirRoot.value.as(Coding)"
targetAttribute: "code"
operator: "one of"
criteria: "†"
@@ -65,24 +65,12 @@ mappings:
- path: "system"
value: "http://fhir.de/ValueSet/icd-10-gm-mehrfachcodierungs-kennzeichen"
openehrCondition:
- targetRoot: "$openehrRoot"
+ targetRoot: "$openehrRoot/items[at0001]"
targetAttribute: "defining_code/code_string"
operator: "one of"
criteria: "at0002"
- name: "additionalInformation"
- openehr:
- - path: "defining_code/terminology_id"
- value: "local"
- - path: "defining_code/code_string"
- value: "at0004"
- - path: "value"
- value: "!"
- fhirCondition:
- targetRoot: "$fhirRoot.value.as(CodeableConcept).coding"
- targetAttribute: "code"
- operator: "one of"
- criteria: "!"
fhir:
- path: "code"
value: "!"
@@ -91,7 +79,20 @@ mappings:
- path: "system"
value: "http://fhir.de/ValueSet/icd-10-gm-mehrfachcodierungs-kennzeichen"
openehrCondition:
- targetRoot: "$openehrRoot"
+ targetRoot: "$openehrRoot/items[at0001]"
targetAttribute: "defining_code/code_string"
operator: "one of"
criteria: "at0004"
+
+ openehr:
+ - path: "defining_code/terminology_id"
+ value: "local"
+ - path: "defining_code/code_string"
+ value: "at0004"
+ - path: "value"
+ value: "!"
+ fhirCondition:
+ targetRoot: "$fhirRoot.value.as(Coding)"
+ targetAttribute: "code"
+ operator: "one of"
+ criteria: "!"
diff --git a/src/test/resources/kds_new/model/cluster/org.openehr/anatomical_location.v1.yml b/src/test/resources/kds_new/model/cluster/org.openehr/anatomical_location.v1.yml
index d575d9bb..c5d46690 100644
--- a/src/test/resources/kds_new/model/cluster/org.openehr/anatomical_location.v1.yml
+++ b/src/test/resources/kds_new/model/cluster/org.openehr/anatomical_location.v1.yml
@@ -13,33 +13,33 @@ spec:
structureDefinition: http://hl7.org/fhir/StructureDefinition/CodeableConcept
mappings:
- - name: "bodySiteCoding" # parent only used to condition on a certain fhir type
- with:
- fhir: "$resource"
- openehr: "$archetype"
- type: "NONE"
- fhirCondition:
- targetRoot: "$fhirRoot"
- operator: "type"
- criteria: "CodeableConcept"
- followedBy:
- mappings:
- - name: "bodySiteText"
- with:
- fhir: "text"
- openehr: "items[at0001]" #Name of body site
- fhirCondition:
- targetRoot: "$fhirRoot"
- targetAttribute: "coding"
- operator: "empty"
- #
+# - name: "bodySiteCoding" # parent only used to condition on a certain fhir type
+# with:
+# fhir: "$resource"
+# openehr: "$archetype"
+# type: "NONE"
+# openehrCondition:
+# targetRoot: "$archetype"
+# targetAttribute: "items[at0001]"
+# operator: "type"
+# criteria: "CodeableConcept"
+# followedBy:
+# mappings:
+# - name: "bodySiteText"
+# with:
+# fhir: "text"
+# openehr: "items[at0001]" #Name of body site
+# fhirCondition:
+# targetRoot: "$fhirRoot"
+# targetAttribute: "coding"
+# operator: "empty"
+
- name: "bodySiteCoded"
with:
fhir: "$fhirRoot"
openehr: "$archetype/items[at0001]" #Name of body site
-
- openehrCondition:
- targetRoot: "$archetype"
- targetAttribute: "items[at0001]"
- operator: "type"
- criteria: "DV_CODED_TEXT"
+# openehrCondition:
+# targetRoot: "$archetype"
+# targetAttribute: "items[at0001]"
+# operator: "type"
+# criteria: "DV_CODED_TEXT"
diff --git a/src/test/resources/kds_new/model/cluster/org.openehr/problem_qualifier.v2.yml b/src/test/resources/kds_new/model/cluster/org.openehr/problem_qualifier.v2.yml
index 3efc8b17..43c8c30d 100644
--- a/src/test/resources/kds_new/model/cluster/org.openehr/problem_qualifier.v2.yml
+++ b/src/test/resources/kds_new/model/cluster/org.openehr/problem_qualifier.v2.yml
@@ -31,9 +31,8 @@ mappings:
value: "at0017"
- path: "value"
value: "Working"
-
fhirCondition:
- targetRoot: "$fhirRoot"
+ targetRoot: "$resource.verificationStatus.coding"
targetAttribute: "code"
operator: "one of"
criteria: "provisional"
@@ -44,10 +43,10 @@ mappings:
- path: "display"
value: "Provisional"
- path: "system"
- value: "http://hl7.org/fhir/ValueSet/condition-ver-status"
+ value: "http://terminology.hl7.org/CodeSystem/condition-ver-status"
openehrCondition:
targetRoot: "$archetype"
- targetAttribute: "items[at0004]/code_string"
+ targetAttribute: "items[at0004]/defining_code/code_string"
operator: "one of"
criteria: "at0017"
@@ -60,7 +59,7 @@ mappings:
- path: "value"
value: "Working"
fhirCondition:
- targetRoot: "$fhirRoot"
+ targetRoot: "$resource.verificationStatus.coding"
targetAttribute: "code"
operator: "one of"
criteria: "differential"
@@ -71,14 +70,14 @@ mappings:
- path: "display"
value: "Differential"
- path: "system"
- value: "http://hl7.org/fhir/ValueSet/condition-ver-status"
+ value: "http://terminology.hl7.org/CodeSystem/condition-ver-status"
openehrCondition:
targetRoot: "$archetype"
- targetAttribute: "items[at0004]/code_string"
+ targetAttribute: "items[at0004]/defining_code/code_string"
operator: "one of"
criteria: "at0017"
- - name: "preliminary"
+ - name: "preliminary"#TODO this is wrong
openehr:
- path: "defining_code/terminology_id"
value: "local"
@@ -87,7 +86,7 @@ mappings:
- path: "value"
value: "Preliminary"
fhirCondition:
- targetRoot: "$fhirRoot"
+ targetRoot: "$resource.verificationStatus.coding"
targetAttribute: "code"
operator: "one of"
criteria: "unconfirmed"
@@ -98,10 +97,10 @@ mappings:
- path: "display"
value: "Unconfirmed"
- path: "system"
- value: "http://hl7.org/fhir/ValueSet/condition-ver-status"
+ value: "http://terminology.hl7.org/CodeSystem/condition-ver-status"
openehrCondition:
targetRoot: "$archetype"
- targetAttribute: "items[at0004]/code_string"
+ targetAttribute: "items[at0004]/defining_code/code_string"
operator: "one of"
criteria: "at0016"
@@ -112,9 +111,9 @@ mappings:
- path: "defining_code/code_string"
value: "at0018"
- path: "value"
- value: "Established"
+ value: "Festgestellt"
fhirCondition:
- targetRoot: "$fhirRoot"
+ targetRoot: "$resource.verificationStatus.coding"
targetAttribute: "code"
operator: "one of"
criteria: "confirmed"
@@ -125,10 +124,10 @@ mappings:
- path: "display"
value: "Confirmed"
- path: "system"
- value: "http://hl7.org/fhir/ValueSet/condition-ver-status"
+ value: "http://terminology.hl7.org/CodeSystem/condition-ver-status"
openehrCondition:
targetRoot: "$archetype"
- targetAttribute: "items[at0004]/code_string"
+ targetAttribute: "items[at0004]/defining_code/code_string"
operator: "one of"
criteria: "at0018"
@@ -141,7 +140,7 @@ mappings:
- path: "value"
value: "Refuted"
fhirCondition:
- targetRoot: "$fhirRoot"
+ targetRoot: "$resource.verificationStatus.coding"
targetAttribute: "code"
operator: "one of"
criteria: "refuted"
@@ -152,9 +151,9 @@ mappings:
- path: "display"
value: "Refuted"
- path: "system"
- value: "http://hl7.org/fhir/ValueSet/condition-ver-status"
+ value: "http://terminology.hl7.org/CodeSystem/condition-ver-status"
openehrCondition:
targetRoot: "$archetype"
- targetAttribute: "items[at0004]/code_string"
+ targetAttribute: "items[at0004]/defining_code/code_string"
operator: "one of"
criteria: "at0088"
diff --git a/src/test/resources/kds_new/model/evaluation/org.openehr/gender.v1.yml b/src/test/resources/kds_new/model/evaluation/org.openehr/gender.v1.yml
index db5db9fb..99103833 100644
--- a/src/test/resources/kds_new/model/evaluation/org.openehr/gender.v1.yml
+++ b/src/test/resources/kds_new/model/evaluation/org.openehr/gender.v1.yml
@@ -2,21 +2,22 @@ grammar: FHIRConnect/v0.9.0
type: model
metadata:
name: EVALUATION.gender.v1
- version: 0.0.1-alpha
-spec:
+ version: 0.0.1-alpha
+spec:
system: FHIR
version: R4
openEhrConfig:
archetype: openEHR-EHR-EVALUATION.gender.v1
revision: 1.1.1
+ fhirConfig:
+ structureDefinition: "http://hl7.org/fhir/StructureDefinition/Code"
mappings:
- name: "gender"
with:
- fhir: "$fhirRoot"
+ fhir: "$resource.gender"
openehr: "$archetype/data[at0002]/items[at0022]"
-
#
# - name: "sex"
# with:
diff --git a/src/test/resources/kds_new/model/evaluation/org.openehr/vital_status.v1.yml b/src/test/resources/kds_new/model/evaluation/org.openehr/vital_status.v1.yml
index 479ab4e1..cfe89dc1 100644
--- a/src/test/resources/kds_new/model/evaluation/org.openehr/vital_status.v1.yml
+++ b/src/test/resources/kds_new/model/evaluation/org.openehr/vital_status.v1.yml
@@ -73,7 +73,7 @@ mappings:
# with:
# fhir: "$fhirRoot"
# openehr: "$openEHRRoot" # reference to party_identified NOT SUPPORTED since 1..1 whole mapping is commented out
- -
+
- name: "effective"
with:
fhir: "$resource.effective"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_anatomical_location.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_anatomical_location.yml
index cad41f95..4541f558 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_anatomical_location.yml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_anatomical_location.yml
@@ -12,7 +12,7 @@ mappings:
- name: "seitenlokalisation"
extension: "add"
with:
- fhir: "$fhirRoot.value.as(CodeableConcept)"
+ fhir: "$fhirRoot.value.as(Coding)"
openehr: "items[at0002]"
fhirCondition:
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_problem_diagnose.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_problem_diagnose.yml
index 64afccf2..354e4601 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_problem_diagnose.yml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/diagnose/KDS_problem_diagnose.yml
@@ -65,34 +65,99 @@ mappings:
- path: "url"
value: "http://hl7.org/fhir/StructureDefinition/condition-assertedDate"
- - name: "bodySiteCluster"
- extension: "overwrite"
- with:
- fhir: "$resource"
- openehr: "$archetype/data[at0001]/items[openEHR-EHR-CLUSTER.anatomical_location.v1]"
- unidirectional: "fhir->openehr" # only if importing, for fhir export openEHR wont check for icd-10 and will just use the archetypes where the icd-10 was mapped to.
- slotArchetype: "CLUSTER.anatomical_location.v1"
- fhirCondition:
- targetRoot: "$resource.code.coding"
- targetAttribute: "system"
- operator: "not contains"
- criteria: "http://fhir.de/CodeSystem/bfarm/icd-10-gm" # execute cluster here if no icd-10 code is provided, otherwise the cluster is below specified
-
- # because we're overwriting bodySiteCluster altogether above, meaning when going to openehr to fhir, we're missing out on bodySite mappings
- - name: "bodySiteClusterToFhir"
+ - name: "metaURL"
extension: "add"
- with:
- fhir: "$resource.bodySite"
- openehr: "$archetype/data[at0001]/items[openEHR-EHR-CLUSTER.anatomical_location.v1]"
unidirectional: "openEHR->fhir"
- slotArchetype: "CLUSTER.anatomical_location.v1"
+ with:
+ fhir: "$resource.meta"
+ manual:
+ - name: "profileUrl"
+ fhir:
+ - path: "profile"
+ value: "https://www.medizininformatik-initiative.de/fhir/core/modul-diagnose/StructureDefinition/Diagnose"
- # - name: "problemDiagnoseNameCode"
- # extension: "overwrite"
- # with:
- # fhir: "$fhirRoot"
- # openehr: "$archetype/data[at0001]/items[at0002]"
- #
+# - name: "problemDiagnose2" # THIS SHOULD be for the export from openehr->fhir but it does not work since i cannot work on the codings since the transformation does not allow it
+# extension: "add"
+# unidirectional: "openEHR->fhir"
+# with:
+# fhir: "$resource.code.coding"
+# openehr: "$archetype/data[at0001]/items[at0002]"
+# followedBy:
+# mappings:
+# - name: "multipleCoding"
+# with:
+# fhir: "extension"
+# openehr: "$archetype"
+# type: "NONE"
+# followedBy:
+# mappings:
+# - name: "extensionValue"
+# with:
+# fhir: "$fhirRoot"
+# openehr: "data[at0001]/items[openEHR-EHR-CLUSTER.multiple_coding_icd10gm.v1]"
+# slotArchetype: "CLUSTER.multiple_coding_icd10gm.v1"
+# - name: "extensionUrl"
+# with:
+# fhir: "$fhirRoot" #since we want to access extension here
+# manual:
+# - name: "extensionUrl"
+# fhir:
+# - path: "url"
+# value: "http://fhir.de/StructureDefinition/icd-10-gm-mehrfachcodierungs-kennzeichen"
+#
+# - name: "bodySiteClusterIcd10" # is here added too, in case the icd-10 is present in fhir so we map the localization
+# with:
+# fhir: "extension"
+# openehr: "$archetype"
+# type: "NONE"
+# followedBy:
+# mappings:
+# - name: "extensionValue"
+# with:
+# fhir: "$fhirRoot"
+# openehr: "data[at0001]/items[openEHR-EHR-CLUSTER.anatomical_location.v1]"
+# slotArchetype: "CLUSTER.anatomical_location.v1"
+# - name: "extension"
+# with:
+# fhir: "$fhirRoot"
+# manual:
+# - name: "extensionUrl"
+# fhir:
+# - path: "url"
+# value: "http://fhir.de/StructureDefinition/seitenlokalisation"
+#
+# - name: "codeIcd10Diagnosesicherheit"
+# with:
+# fhir: "extension"
+# openehr: "$archetype"
+# type: "NONE"
+# fhirCondition:
+# targetRoot: "extension"
+# targetAttribute: "url"
+# operator: "one of"
+# criteria: "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit"
+# followedBy:
+# mappings:
+# - name: "extensionValue"
+# with:
+# fhir: "value"
+# openehr: "data[at0001]/items[at0073]"
+# type: "CODING"
+# - name: "extensionUrl"
+# with:
+# fhir: "$fhirRoot" #since we want to access extension here
+# manual:
+# - name: "extensionUrl"
+# fhir:
+# - path: "url"
+# value: "http://fhir.de/StructureDefinition/icd-10-gm-diagnosesicherheit"
+#
+# - name: "extensionValue"
+# with:
+# fhir: "value"
+# openehr: "data[at0001]/items[at0073]"
+# type: "CODING"
+#
- name: "icd10ProblemDiagnose"
extension: "append"
@@ -136,7 +201,13 @@ mappings:
with:
fhir: "value"
openehr: "data[at0001]/items[at0073]"
-
+ type: "CODING"
+ - name: "extensionValue"#TODO Bugfix since Coding maps no display
+ unidirectional: "fhir->openEHR"
+ with:
+ fhir: "value"
+ openehr: "data[at0001]/items[at0073]"
+
- name: "extensionUrl"
with:
fhir: "$fhirRoot" #since we want to access extension here
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.context.yaml b/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.context.yaml
index e76fa5ad..615b9230 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.context.yaml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.context.yaml
@@ -2,14 +2,14 @@ grammar: FHIRConnect/v0.9.0
type: context
metadata:
name: KDS_medikationseintrag.context
- version: 0.0.1a
-spec:
+ version: 0.0.1a
+spec:
system: FHIR
version: R4
context:
profile:
- url: "https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/MedicationStatement"
+ url: "https://www.medizininformatik-initiative.de/fhir/core/modul-medikation/StructureDefinition/MedicationStatement"
version: "2025.0.0"
template:
id: "KDS_Medikationseintrag"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.yml
index 44b6dc14..53a3a784 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.yml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/medikationseintrag/KDS_medikationseintrag.yml
@@ -9,18 +9,18 @@ spec:
extends: OBSERVATION.medication_statement.v0
mappings:
- #todo: where is this supposed to be mapped to? No encounter on MedicationStatement
+ # Dokumentationsdatum
- name: "fallIdentifikationIdentifier"
extension: "add"
with:
- fhir: "$resource.context.as(Reference).identifier"
- openehr: "$composition/context/other_context[at0005]/items[openEHR-EHR-CLUSTER.case_identification.v0]"
+ fhir: "$resource.encounter.identifier"
+ openehr: "$composition/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]"
slotArchetype: "CLUSTER.case_identification.v0"
- name: "fallIdentifikationReference" # if reference is accessible overwrite fallIdentifikationIdentifier
extension: "add"
with:
- fhir: "$resource.context.as(Encounter)"
+ fhir: "$resource.encounter"
openehr: "$reference"
reference:
resourceType: "Encounter"
@@ -28,15 +28,15 @@ mappings:
- name: "identifierInReference"
with:
fhir: "$fhirRoot.identifier"
- openehr: "$composition/context/other_context[at0005]/items[openEHR-EHR-CLUSTER.case_identification.v0]"
+ openehr: "$composition/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]"
slotArchetype: "CLUSTER.case_identification.v0"
-# - name: "encounterMapping"
-# with:
-# fhir: "$fhirRoot"
-# openehr: "$composition/context/other_context[at0005]/items[openEHR-EHR-CLUSTER.case_identification.v0]/links" # will use link
-# openehrLink:
-# meaning: "the case this composition relates to"
-# type: "case"
+ # - name: "encounterMapping"
+ # with:
+ # fhir: "$fhirRoot"
+ # openehr: "$composition/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]/links" # will use link
+ # openehrLink:
+ # meaning: "the case this composition relates to"
+ # type: "case"
- name: "protocol0004Parent"
extension: "add"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/medikationsverabreichung/KDS_medikamentenverabreichung.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/medikationsverabreichung/KDS_medikamentenverabreichung.yml
index e9a23f15..9d79fe59 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/medikationsverabreichung/KDS_medikamentenverabreichung.yml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/medikationsverabreichung/KDS_medikamentenverabreichung.yml
@@ -23,33 +23,35 @@ mappings:
openehr: "$composition/context/other_context[at0001]/items[at0005]" # this status is mandatory, because it's 1...1 in the template
+ # Dokumentationsdatum
- name: "fallIdentifikationIdentifier"
extension: "add"
with:
- fhir: "$resource.context.as(Reference).identifier"
+ fhir: "$resource.context.identifier"
openehr: "$composition/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]"
slotArchetype: "CLUSTER.case_identification.v0"
- name: "fallIdentifikationReference" # if reference is accessible overwrite fallIdentifikationIdentifier
extension: "add"
with:
- fhir: "$resource.encounter"
+ fhir: "$resource.context"
openehr: "$reference"
- reference: #type None
+ reference:
resourceType: "Encounter"
mappings:
- name: "identifierInReference"
with:
fhir: "$fhirRoot.identifier"
- openehr: "$archetype/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]"
+ openehr: "$composition/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]"
slotArchetype: "CLUSTER.case_identification.v0"
-# - name: "encounterMapping"
-# with:
-# fhir: "$fhirRoot"
-# openehr: "$archetype/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]/links" # will use link
-# openehrLink:
-# meaning: "the case this composition relates to"
-# type: "case"
+ # - name: "encounterMapping"
+ # with:
+ # fhir: "$fhirRoot"
+ # openehr: "$composition/context/other_context[at0001]/items[openEHR-EHR-CLUSTER.case_identification.v0]/links" # will use link
+ # openehrLink:
+ # meaning: "the case this composition relates to"
+ # type: "case"
+
- name: "medicationCode"
extension: "overwrite"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/person/KDS_address.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/person/KDS_address.yml
new file mode 100644
index 00000000..ef1ebd46
--- /dev/null
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/person/KDS_address.yml
@@ -0,0 +1,104 @@
+grammar: FHIRConnect/v0.9.0
+type: extension
+metadata:
+ name: KDS_address
+ version: 0.0.1-alpha
+spec:
+ system: FHIR
+ version: R4
+ extends: CLUSTER.address.v1
+
+mappings:
+ - name: "streetaddress"
+ extension: "overwrite"
+ with:
+ fhir: "$fhirRoot"
+ openehr: "$archetype"
+ followedBy:
+ mappings:
+ - name: "city"
+ with:
+ fhir: "city"
+ openehr: "items[at0002]"
+
+ - name: "postalCode"
+ with:
+ fhir: "postalCode"
+ openehr: "items[at0005]"
+
+ - name: "line"
+ with:
+ fhir: "line"
+ openehr: "items[at0001]"
+
+ - name: "type"
+ with:
+ fhir: "type"
+ openehr: "items[at0010]"
+ manual:
+ - name: "physical"
+ openehr:
+ - path: "defining_code/terminology_id"
+ value: "local"
+ - path: "defining_code/code_string"
+ value: "at0011"
+ - path: "value"
+ value: "Physical"
+ fhirCondition:
+ targetRoot: "$fhirRoot"
+ targetAttribute: "code"
+ operator: "one of"
+ criteria: "physical"
+
+ fhir:
+ - path: "code"
+ value: "physical"
+ openehrCondition:
+ targetRoot: "$openehrRoot"
+ targetAttribute: "defining_code/code_string"
+ operator: "one of"
+ criteria: "at0011"
+
+ - name: "postal"
+ openehr:
+ - path: "defining_code/terminology_id"
+ value: "local"
+ - path: "defining_code/code_string"
+ value: "at0012"
+ - path: "value"
+ value: "Postal"
+ fhirCondition:
+ targetRoot: "$fhirRoot"
+ targetAttribute: "code"
+ operator: "one of"
+ criteria: "postal"
+ fhir:
+ - path: "code"
+ value: "postal"
+ openehrCondition:
+ targetRoot: "$openehrRoot"
+ targetAttribute: "defining_code/code_string"
+ operator: "one of"
+ criteria: "at0012"
+
+ - name: "both"
+ openehr:
+ - path: "defining_code/terminology_id"
+ value: "local"
+ - path: "defining_code/code_string"
+ value: "at0013"
+ - path: "value"
+ value: "Both"
+ fhirCondition:
+ targetRoot: "$fhirRoot"
+ targetAttribute: "code"
+ operator: "one of"
+ criteria: "both"
+ fhir:
+ - path: "code"
+ value: "both"
+ openehrCondition:
+ targetRoot: "$openehrRoot"
+ targetAttribute: "defining_code/code_string"
+ operator: "one of"
+ criteria: "at0013"
\ No newline at end of file
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/person/KDS_admin_entry_person.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/person/KDS_admin_entry_person.yml
index bd5298c6..8fb985d1 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/person/KDS_admin_entry_person.yml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/person/KDS_admin_entry_person.yml
@@ -14,7 +14,7 @@ mappings:
with:
fhir: "$resource.identifier"
openehr: "$composition/context/other_context[at0003]/items[at0004]"
-
+
fhirCondition:
targetRoot: "$resource.identifier"
targetAttribute: "type.coding.code"
@@ -34,6 +34,7 @@ mappings:
value: "MR"
- name: "versicherungsInformationen"
+ extension: "add"
with:
fhir: "$resource.identifier"
openehr: "$composition/content[openEHR-EHR-ADMIN_ENTRY.versicherungsinformationen.v0]"
@@ -42,7 +43,7 @@ mappings:
- name: "gender"
extension: "add"
with:
- fhir: "$resource.gender"
+ fhir: "$resource"
openehr: "$composition/content[openEHR-EHR-EVALUATION.gender.v1]"
slotArchetype: "EVALUATION.gender.v1"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/person/person.context.yaml b/src/test/resources/kds_new/projects/org.highmed/KDS/person/person.context.yaml
index f6406dc5..93e825f4 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/person/person.context.yaml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/person/person.context.yaml
@@ -2,8 +2,8 @@ grammar: FHIRConnect/v0.9.0
type: context
metadata:
name: KDS_Person.context
- version: 0.0.1a
-spec:
+ version: 0.0.1a
+spec:
system: FHIR
version: R4
@@ -20,13 +20,15 @@ context:
- "CLUSTER.person.v1"
- "CLUSTER.structured_name.v1"
- "CLUSTER.address.v1"
+ - "CLUSTER.organisation.v1"
- "CLUSTER.person_birth_data_iso.v0"
- "CLUSTER.death_details.v1"
- - "CLUSTER.observation_status_fhir.v1"
+ - "ADMIN_ENTRY.versicherungsinformationen.v0"
extensions:
- "KDS_person_data.v0"
- "KDS_gender.v1"
- "KDS_cluster_person.v1"
+ - "KDS_address"
- "KDS_structured_name.v1.person_name-structured_name"
- "KDS_admin_entry_person.v0"
start: "ADMIN_ENTRY.person_data.v0"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/KDS_address.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/KDS_address.yml
new file mode 100644
index 00000000..86d73c0d
--- /dev/null
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/KDS_address.yml
@@ -0,0 +1,105 @@
+grammar: FHIRConnect/v0.9.0
+type: extension
+metadata:
+ name: KDS_address_pseudo
+ version: 0.0.1-alpha
+spec:
+ system: FHIR
+ version: R4
+ extends: CLUSTER.address.v1
+
+mappings:
+ - name: "streetaddress"
+ extension: "overwrite"
+ with:
+ fhir: "$fhirRoot"
+ openehr: "$archetype"
+ followedBy:
+ mappings:
+ - name: "city"
+ with:
+ fhir: "city"
+ openehr: "items[at0002]"
+
+ - name: "postalCode"
+ with:
+ fhir: "postalCode"
+ openehr: "items[at0005]"
+
+ - name: "line"
+ with:
+ fhir: "line"
+ openehr: "items[at0001]"
+
+
+ - name: "type"
+ with:
+ fhir: "type"
+ openehr: "items[at0010]"
+ manual:
+ - name: "physical"
+ openehr:
+ - path: "defining_code/terminology_id"
+ value: "local"
+ - path: "defining_code/code_string"
+ value: "at0011"
+ - path: "value"
+ value: "Physical"
+ fhirCondition:
+ targetRoot: "$fhirRoot"
+ targetAttribute: "code"
+ operator: "one of"
+ criteria: "physical"
+
+ fhir:
+ - path: "code"
+ value: "physical"
+ openehrCondition:
+ targetRoot: "$openehrRoot"
+ targetAttribute: "defining_code/code_string"
+ operator: "one of"
+ criteria: "at0011"
+
+ - name: "postal"
+ openehr:
+ - path: "defining_code/terminology_id"
+ value: "local"
+ - path: "defining_code/code_string"
+ value: "at0012"
+ - path: "value"
+ value: "Postal"
+ fhirCondition:
+ targetRoot: "$fhirRoot"
+ targetAttribute: "code"
+ operator: "one of"
+ criteria: "postal"
+ fhir:
+ - path: "code"
+ value: "postal"
+ openehrCondition:
+ targetRoot: "$openehrRoot"
+ targetAttribute: "defining_code/code_string"
+ operator: "one of"
+ criteria: "at0012"
+
+ - name: "both"
+ openehr:
+ - path: "defining_code/terminology_id"
+ value: "local"
+ - path: "defining_code/code_string"
+ value: "at0013"
+ - path: "value"
+ value: "Both"
+ fhirCondition:
+ targetRoot: "$fhirRoot"
+ targetAttribute: "code"
+ operator: "one of"
+ criteria: "both"
+ fhir:
+ - path: "code"
+ value: "both"
+ openehrCondition:
+ targetRoot: "$openehrRoot"
+ targetAttribute: "defining_code/code_string"
+ operator: "one of"
+ criteria: "at0013"
\ No newline at end of file
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/KDS_gender.yml b/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/KDS_gender.yml
index 1022bbe9..a088bcff 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/KDS_gender.yml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/KDS_gender.yml
@@ -1,7 +1,7 @@
grammar: FHIRConnect/v0.9.0
type: extension
metadata:
- name: KDS_gender.v1
+ name: KDS_gender_pseudo.v1
version: 0.0.1-alpha
spec:
system: FHIR
@@ -14,7 +14,7 @@ mappings:
with:
fhir: "$fhirRoot.extension"
openehr: "$archetype/data[at0002]/items[at0014]"
-
+
fhirCondition:
targetRoot: "$fhirRoot.extension"
targetAttribute: "url"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/pseudo_person.context.yaml b/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/pseudo_person.context.yaml
index df8f489e..4167dc95 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/pseudo_person.context.yaml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/person_pseudo/pseudo_person.context.yaml
@@ -21,6 +21,7 @@ context:
- "CLUSTER.address.v1"
- "CLUSTER.person_birth_data_iso.v0"
extensions:
+ - "KDS_address_pseudo"
- "KDS_admin_entry_perso_pseudo"
- "KDS_person_pseudo_cluster.v1"
- "KDS_gender.v1"
diff --git a/src/test/resources/kds_new/projects/org.highmed/KDS/vitalstatus/KDS_Vitalstatus.context.yaml b/src/test/resources/kds_new/projects/org.highmed/KDS/vitalstatus/KDS_Vitalstatus.context.yaml
index facfc1e9..ef9c9d04 100644
--- a/src/test/resources/kds_new/projects/org.highmed/KDS/vitalstatus/KDS_Vitalstatus.context.yaml
+++ b/src/test/resources/kds_new/projects/org.highmed/KDS/vitalstatus/KDS_Vitalstatus.context.yaml
@@ -2,8 +2,8 @@ grammar: FHIRConnect/v0.9.0
type: context
metadata:
name: KDS_Vitalstatus.context
- version: 0.0.1a
-spec:
+ version: 0.0.1a
+spec:
system: FHIR
version: R4
@@ -17,7 +17,6 @@ context:
archetypes:
- "EVALUATION.vital_status.v1"
- "CLUSTER.case_identification.v0"
- - "CLUSTER.observation_status_fhir.v1"
extensions:
- "KDS_vital_status"
start: "EVALUATION.vital_status.v1"