Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit a3d3e82

Browse files
committed
Merge remote-tracking branch 'origin/develop' into
issues/25_fTTP_proxy_configuration
2 parents 6cca376 + 070c4fc commit a3d3e82

5 files changed

Lines changed: 42 additions & 12 deletions

File tree

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/service/ReadData.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class ReadData extends AbstractServiceDelegate
5858
{
5959
private static final String NUM_CODEX_STRUCTURE_DEFINITION_PREFIX = "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition";
6060
private static final String MII_LAB_STRUCTURED_DEFINITION = "https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/ObservationLab";
61+
private static final String NUM_CODEX_DO_NOT_RESUSCITAT_ORDER = "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/do-not-resuscitate-order";
6162

6263
private static final Logger logger = LoggerFactory.getLogger(ReadData.class);
6364

@@ -249,6 +250,35 @@ else if (resource instanceof Condition)
249250
+ c.getRecordedDateElement().getValueAsString() + "&patient:identifier="
250251
+ ConstantsDataTransfer.NAMING_SYSTEM_NUM_CODEX_DIC_PSEUDONYM + "|" + pseudonym;
251252
}
253+
else if (resource instanceof Consent)
254+
{
255+
Consent c = (Consent) resource;
256+
String profileUrl = getProfileUrl(resource, v -> v.startsWith(NUM_CODEX_STRUCTURE_DEFINITION_PREFIX));
257+
258+
if (NUM_CODEX_DO_NOT_RESUSCITAT_ORDER.equals(profileUrl))
259+
{
260+
boolean scopePresent = c.getScope().getCoding().stream().filter(co -> co.hasSystem())
261+
.filter(co -> "http://terminology.hl7.org/CodeSystem/consentscope".equals(co.getSystem()))
262+
.filter(co -> co.hasCode()).filter(co -> "adr".equals(co.getCode())).findAny().isPresent();
263+
boolean categoryPresent = c.getCategory().stream().flatMap(coc -> coc.getCoding().stream())
264+
.filter(co -> co.hasSystem())
265+
.filter(co -> "http://terminology.hl7.org/CodeSystem/consentcategorycodes"
266+
.equals(co.getSystem()))
267+
.filter(co -> co.hasCode()).filter(co -> "dnr".equals(co.getCode())).findAny().isPresent();
268+
269+
if (scopePresent && categoryPresent)
270+
return "Consent?_profile=" + profileUrl
271+
+ "&scope=http://terminology.hl7.org/CodeSystem/consentscope|adr"
272+
+ "&category=http://terminology.hl7.org/CodeSystem/consentcategorycodes|dnr"
273+
+ "&patient:identifier=" + ConstantsDataTransfer.NAMING_SYSTEM_NUM_CODEX_DIC_PSEUDONYM + "|"
274+
+ pseudonym;
275+
else
276+
throw new RuntimeException("Resource of type Consent with profile " + profileUrl
277+
+ " is missing scope: http://terminology.hl7.org/CodeSystem/consentscope|adr and/or category: http://terminology.hl7.org/CodeSystem/consentcategorycodes|dnr");
278+
}
279+
else
280+
throw new RuntimeException("Resource of type Consent with profile " + profileUrl + " not supported");
281+
}
252282
else if (resource instanceof DiagnosticReport)
253283
{
254284
DiagnosticReport dr = (DiagnosticReport) resource;

codex-process-data-transfer/src/test/resources/fhir/Task/TaskStartDataSendWithAbsoluteReference.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<meta>
33
<profile value="http://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/task-start-data-send"/>
44
</meta>
5-
<instantiatesUri value="http://highmed.org/bpe/Process/dataSend/0.3.3"/>
5+
<instantiatesUri value="http://highmed.org/bpe/Process/dataSend/0.3.4"/>
66
<status value="requested"/>
77
<intent value="order"/>
8-
<authoredOn value="2021-04-07T12:30:00+01:00"/>
8+
<authoredOn value="2021-07-07T13:40:00+01:00"/>
99
<requester>
1010
<type value="Organization"/>
1111
<identifier>
@@ -54,7 +54,7 @@
5454
<code value="export-to"/>
5555
</coding>
5656
</type>
57-
<valueInstant value="2021-06-03T34:46:00+01:00"/>
57+
<valueInstant value="2021-07-07T13:40:00+01:00"/>
5858
</input>
5959
<!-- optional parameter specifying GECCO resources should be send starting
6060
at the defined date, resources older than the specified date will not be
@@ -66,6 +66,6 @@
6666
<code value="export-from"/>
6767
</coding>
6868
</type>
69-
<valueDateTime value="2021-04-07"/>
69+
<valueDateTime value="2021-01-01"/>
7070
</input> -->
7171
</Task>

codex-process-data-transfer/src/test/resources/fhir/Task/TaskStartDataSendWithIdentifierReference.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<meta>
33
<profile value="http://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/task-start-data-send"/>
44
</meta>
5-
<instantiatesUri value="http://highmed.org/bpe/Process/dataSend/0.3.3"/>
5+
<instantiatesUri value="http://highmed.org/bpe/Process/dataSend/0.3.4"/>
66
<status value="requested"/>
77
<intent value="order"/>
8-
<authoredOn value="2021-06-03T23:46:00+01:00"/>
8+
<authoredOn value="2021-07-07T13:40:00+01:00"/>
99
<requester>
1010
<type value="Organization"/>
1111
<identifier>
@@ -58,7 +58,7 @@
5858
<code value="export-to"/>
5959
</coding>
6060
</type>
61-
<valueInstant value="2021-06-03T23:46:00+01:00"/>
61+
<valueInstant value="2021-07-07T13:40:00+01:00"/>
6262
</input>
6363
<!-- optional parameter specifying GECCO resources should be send starting
6464
at the defined date, resources older than the specified date will not be
@@ -70,6 +70,6 @@
7070
<code value="export-from"/>
7171
</coding>
7272
</type>
73-
<valueDateTime value="2021-04-07"/>
73+
<valueDateTime value="2021-01-01"/>
7474
</input> -->
7575
</Task>

codex-process-data-transfer/src/test/resources/fhir/Task/TaskStartDataTrigger.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<meta>
33
<profile value="http://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/task-start-data-trigger"/>
44
</meta>
5-
<instantiatesUri value="http://highmed.org/bpe/Process/dataTrigger/0.3.3"/>
5+
<instantiatesUri value="http://highmed.org/bpe/Process/dataTrigger/0.3.4"/>
66
<status value="requested"/>
77
<intent value="order"/>
8-
<authoredOn value="2021-04-07T12:30:00+01:00"/>
8+
<authoredOn value="2021-07-07T13:40:00+01:00"/>
99
<requester>
1010
<type value="Organization"/>
1111
<identifier>

codex-process-data-transfer/src/test/resources/fhir/Task/TaskStopDataTrigger.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<meta>
33
<profile value="http://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/task-stop-data-trigger"/>
44
</meta>
5-
<instantiatesUri value="http://highmed.org/bpe/Process/dataTrigger/0.3.3"/>
5+
<instantiatesUri value="http://highmed.org/bpe/Process/dataTrigger/0.3.4"/>
66
<status value="requested"/>
77
<intent value="order"/>
8-
<authoredOn value="2021-04-07T12:30:00+01:00"/>
8+
<authoredOn value="2021-07-07T13:40:00+01:00"/>
99
<requester>
1010
<type value="Organization"/>
1111
<identifier>

0 commit comments

Comments
 (0)