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

Commit 513e01c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into issues/26_dnr_consent
2 parents 850a46d + 4b12c71 commit 513e01c

9 files changed

Lines changed: 371 additions & 13 deletions

File tree

Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
<StructureDefinition xmlns="http://hl7.org/fhir">
2+
<meta>
3+
<tag>
4+
<system value="http://highmed.org/fhir/CodeSystem/authorization-role" />
5+
<code value="REMOTE" />
6+
</tag>
7+
</meta>
8+
<url value="http://highmed.org/fhir/StructureDefinition/task-base" />
9+
<version value="0.4.0" />
10+
<name value="TaskBase" />
11+
<status value="active" />
12+
<experimental value="false" />
13+
<date value="2021-01-26" />
14+
<fhirVersion value="4.0.1" />
15+
<kind value="resource" />
16+
<abstract value="true" />
17+
<type value="Task" />
18+
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Task" />
19+
<derivation value="constraint" />
20+
<differential>
21+
<element id="Task.instantiatesUri">
22+
<path value="Task.instantiatesUri" />
23+
<min value="1" />
24+
</element>
25+
<element id="Task.intent">
26+
<path value="Task.intent" />
27+
<fixedCode value="order" />
28+
</element>
29+
<element id="Task.authoredOn">
30+
<path value="Task.authoredOn" />
31+
<min value="1" />
32+
</element>
33+
<element id="Task.requester">
34+
<path value="Task.requester" />
35+
<min value="1" />
36+
<type>
37+
<code value="Reference" />
38+
<targetProfile value="http://highmed.org/fhir/StructureDefinition/organization" />
39+
</type>
40+
</element>
41+
<element id="Task.requester.reference">
42+
<path value="Task.requester.reference" />
43+
<max value="0" />
44+
</element>
45+
<element id="Task.requester.identifier">
46+
<path value="Task.requester.identifier" />
47+
<min value="1" />
48+
</element>
49+
<element id="Task.requester.identifier.system">
50+
<path value="Task.requester.identifier.system" />
51+
<min value="1" />
52+
<fixedUri value="http://highmed.org/fhir/NamingSystem/organization-identifier" />
53+
</element>
54+
<element id="Task.requester.identifier.value">
55+
<path value="Task.requester.identifier.value" />
56+
<min value="1" />
57+
</element>
58+
<element id="Task.restriction">
59+
<path value="Task.restriction" />
60+
<min value="1" />
61+
</element>
62+
<element id="Task.restriction.recipient">
63+
<path value="Task.restriction.recipient" />
64+
<min value="1" />
65+
<max value="1" />
66+
<type>
67+
<code value="Reference" />
68+
<targetProfile value="http://highmed.org/fhir/StructureDefinition/organization" />
69+
</type>
70+
</element>
71+
<element id="Task.restriction.recipient.reference">
72+
<path value="Task.restriction.recipient.reference" />
73+
<max value="0" />
74+
</element>
75+
<element id="Task.restriction.recipient.identifier">
76+
<path value="Task.restriction.recipient.identifier" />
77+
<min value="1" />
78+
</element>
79+
<element id="Task.restriction.recipient.identifier.system">
80+
<path value="Task.restriction.recipient.identifier.system" />
81+
<min value="1" />
82+
<fixedUri value="http://highmed.org/fhir/NamingSystem/organization-identifier" />
83+
</element>
84+
<element id="Task.restriction.recipient.identifier.value">
85+
<path value="Task.restriction.recipient.identifier.value" />
86+
<min value="1" />
87+
</element>
88+
<element id="Task.input">
89+
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
90+
<valueString value="Parameter" />
91+
</extension>
92+
<path value="Task.input" />
93+
<slicing>
94+
<discriminator>
95+
<type value="value" />
96+
<path value="type.coding.system" />
97+
</discriminator>
98+
<discriminator>
99+
<type value="value" />
100+
<path value="type.coding.code" />
101+
</discriminator>
102+
<rules value="openAtEnd" />
103+
</slicing>
104+
<min value="1" />
105+
</element>
106+
<element id="Task.input:message-name">
107+
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
108+
<valueString value="Parameter" />
109+
</extension>
110+
<path value="Task.input" />
111+
<sliceName value="message-name" />
112+
<min value="1" />
113+
<max value="1" />
114+
</element>
115+
<element id="Task.input:message-name.type">
116+
<path value="Task.input.type" />
117+
<binding>
118+
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
119+
<valueString value="TaskInputParameterType" />
120+
</extension>
121+
<strength value="required" />
122+
<valueSet value="http://highmed.org/fhir/ValueSet/bpmn-message" />
123+
</binding>
124+
</element>
125+
<element id="Task.input:message-name.type.coding">
126+
<path value="Task.input.type.coding" />
127+
<min value="1" />
128+
<max value="1" />
129+
</element>
130+
<element id="Task.input:message-name.type.coding.system">
131+
<path value="Task.input.type.coding.system" />
132+
<min value="1" />
133+
<fixedUri value="http://highmed.org/fhir/CodeSystem/bpmn-message" />
134+
</element>
135+
<element id="Task.input:message-name.type.coding.code">
136+
<path value="Task.input.type.coding.code" />
137+
<min value="1" />
138+
<fixedCode value="message-name" />
139+
</element>
140+
<element id="Task.input:message-name.value[x]">
141+
<path value="Task.input.value[x]" />
142+
<type>
143+
<code value="string" />
144+
</type>
145+
</element>
146+
<element id="Task.input:business-key">
147+
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
148+
<valueString value="Parameter" />
149+
</extension>
150+
<path value="Task.input" />
151+
<sliceName value="business-key" />
152+
<max value="1" />
153+
</element>
154+
<element id="Task.input:business-key.type">
155+
<path value="Task.input.type" />
156+
<binding>
157+
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
158+
<valueString value="TaskInputParameterType" />
159+
</extension>
160+
<strength value="required" />
161+
<valueSet value="http://highmed.org/fhir/ValueSet/bpmn-message" />
162+
</binding>
163+
</element>
164+
<element id="Task.input:business-key.type.coding">
165+
<path value="Task.input.type.coding" />
166+
<min value="1" />
167+
<max value="1" />
168+
</element>
169+
<element id="Task.input:business-key.type.coding.system">
170+
<path value="Task.input.type.coding.system" />
171+
<min value="1" />
172+
<fixedUri value="http://highmed.org/fhir/CodeSystem/bpmn-message" />
173+
</element>
174+
<element id="Task.input:business-key.type.coding.code">
175+
<path value="Task.input.type.coding.code" />
176+
<min value="1" />
177+
<fixedCode value="business-key" />
178+
</element>
179+
<element id="Task.input:business-key.value[x]">
180+
<path value="Task.input.value[x]" />
181+
<type>
182+
<code value="string" />
183+
</type>
184+
</element>
185+
<element id="Task.input:correlation-key">
186+
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
187+
<valueString value="Parameter" />
188+
</extension>
189+
<path value="Task.input" />
190+
<sliceName value="correlation-key" />
191+
<max value="1" />
192+
</element>
193+
<element id="Task.input:correlation-key.type">
194+
<path value="Task.input.type" />
195+
<binding>
196+
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
197+
<valueString value="TaskInputParameterType" />
198+
</extension>
199+
<strength value="required" />
200+
<valueSet value="http://highmed.org/fhir/ValueSet/bpmn-message" />
201+
</binding>
202+
</element>
203+
<element id="Task.input:correlation-key.type.coding">
204+
<path value="Task.input.type.coding" />
205+
<min value="1" />
206+
<max value="1" />
207+
</element>
208+
<element id="Task.input:correlation-key.type.coding.system">
209+
<path value="Task.input.type.coding.system" />
210+
<min value="1" />
211+
<fixedUri value="http://highmed.org/fhir/CodeSystem/bpmn-message" />
212+
</element>
213+
<element id="Task.input:correlation-key.type.coding.code">
214+
<path value="Task.input.type.coding.code" />
215+
<min value="1" />
216+
<fixedCode value="correlation-key" />
217+
</element>
218+
<element id="Task.input:correlation-key.value[x]">
219+
<path value="Task.input.value[x]" />
220+
<type>
221+
<code value="string" />
222+
</type>
223+
</element>
224+
<element id="Task.output">
225+
<path value="Task.output" />
226+
<slicing>
227+
<discriminator>
228+
<type value="value" />
229+
<path value="type.coding.system" />
230+
</discriminator>
231+
<discriminator>
232+
<type value="value" />
233+
<path value="type.coding.code" />
234+
</discriminator>
235+
<rules value="openAtEnd" />
236+
</slicing>
237+
</element>
238+
<element id="Task.output:error">
239+
<path value="Task.output" />
240+
<sliceName value="error" />
241+
</element>
242+
<element id="Task.output:error.type">
243+
<path value="Task.output.type" />
244+
<binding>
245+
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
246+
<valueString value="TaskOutputParameterType" />
247+
</extension>
248+
<strength value="required" />
249+
<valueSet value="http://highmed.org/fhir/ValueSet/bpmn-message" />
250+
</binding>
251+
</element>
252+
<element id="Task.output:error.type.coding">
253+
<path value="Task.output.type.coding" />
254+
<min value="1" />
255+
<max value="1" />
256+
</element>
257+
<element id="Task.output:error.type.coding.system">
258+
<path value="Task.output.type.coding.system" />
259+
<min value="1" />
260+
<fixedUri value="http://highmed.org/fhir/CodeSystem/bpmn-message" />
261+
</element>
262+
<element id="Task.output:error.type.coding.code">
263+
<path value="Task.output.type.coding.code" />
264+
<min value="1" />
265+
<fixedCode value="error" />
266+
</element>
267+
<element id="Task.output:error.value[x]">
268+
<path value="Task.output.value[x]" />
269+
<type>
270+
<code value="string" />
271+
</type>
272+
</element>
273+
</differential>
274+
</StructureDefinition>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package de.netzwerk_universitaetsmedizin.codex.processes;
2+
3+
import org.hl7.fhir.r4.model.Bundle;
4+
5+
import ca.uhn.fhir.context.FhirContext;
6+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.FhirClientFactory;
7+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.HapiFhirClientFactory;
8+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.fhir.FhirBridgeClient;
9+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.fhir.FhirClientBuilder;
10+
11+
public class FhirBridgeTest
12+
{
13+
private static final String BUNDLE_STRING = "{\"resourceType\":\"Bundle\",\"type\":\"transaction\",\"entry\":[{\"fullUrl\":\"urn:uuid:d2a06354-4514-482d-bdc9-26def09912b8\",\"resource\":{\"resourceType\":\"Patient\",\"meta\":{\"profile\":[\"https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/Patient\"]},\"text\":{\"status\":\"generated\",\"div\":\"<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><table class=\\\"hapiPropertyTable\\\"><tbody><tr><td>Identifier</td><td>0682c5f2076f099c34cfdd15a9e063849ed437a49677e6fcc5b4198c76575be5</td></tr><tr><td>Date of birth</td><td><span>30 September 1953</span></td></tr></tbody></table></div>\"},\"extension\":[{\"url\":\"https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/ethnic-group\",\"valueCoding\":{\"system\":\"http://snomed.info/sct\",\"code\":\"186019001\",\"display\":\"Other ethnic, mixed origin\"}},{\"url\":\"https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age\",\"extension\":[{\"url\":\"dateTimeOfDocumentation\",\"valueDateTime\":\"2020-10-01\"},{\"url\":\"age\",\"valueAge\":{\"value\":67,\"unit\":\"years\",\"system\":\"http://unitsofmeasure.org\",\"code\":\"a\"}}]}],\"identifier\":[{\"system\":\"http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym\",\"value\":\"0682c5f2076f099c34cfdd15a9e063849ed437a49677e6fcc5b4198c76575be5\"}],\"birthDate\":\"1953-09-30\"},\"request\":{\"method\":\"PUT\",\"url\":\"Patient?identifier=http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym|0682c5f2076f099c34cfdd15a9e063849ed437a49677e6fcc5b4198c76575be5\"}},{\"fullUrl\":\"urn:uuid:fb4584cb-cc6e-4987-ad0e-fd62641b51c6\",\"resource\":{\"resourceType\":\"Condition\",\"meta\":{\"profile\":[\"https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/chronic-lung-diseases\"]},\"clinicalStatus\":{\"coding\":[{\"system\":\"http://terminology.hl7.org/CodeSystem/condition-clinical\",\"code\":\"active\",\"display\":\"Active\"}]},\"verificationStatus\":{\"coding\":[{\"system\":\"http://terminology.hl7.org/CodeSystem/condition-ver-status\",\"code\":\"confirmed\",\"display\":\"Confirmed\"},{\"system\":\"http://snomed.info/sct\",\"code\":\"410605003\",\"display\":\"Confirmed present (qualifier value)\"}]},\"category\":[{\"coding\":[{\"system\":\"http://snomed.info/sct\",\"code\":\"418112009\",\"display\":\"Pulmonary medicine\"}]}],\"code\":{\"coding\":[{\"system\":\"http://snomed.info/sct\",\"code\":\"413839001\",\"display\":\"Chronic lung disease\"}]},\"subject\":{\"identifier\":{\"system\":\"http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym\",\"value\":\"0682c5f2076f099c34cfdd15a9e063849ed437a49677e6fcc5b4198c76575be5\"}},\"recordedDate\":\"2020-11-10T15:50:41.000+01:00\"},\"request\":{\"method\":\"PUT\",\"url\":\"Condition?_profile=https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/chronic-lung-diseases&recorded-date=2020-11-10T15:50:41.000+01:00&patient:identifier=http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym|0682c5f2076f099c34cfdd15a9e063849ed437a49677e6fcc5b4198c76575be5\"}},{\"fullUrl\":\"urn:uuid:41a61a24-bd46-4090-92f3-edc556692d94\",\"resource\":{\"resourceType\":\"Observation\",\"meta\":{\"profile\":[\"https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/sars-cov-2-rt-pcr\"]},\"status\":\"final\",\"category\":[{\"coding\":[{\"system\":\"http://loinc.org\",\"code\":\"26436-6\"},{\"system\":\"http://terminology.hl7.org/CodeSystem/observation-category\",\"code\":\"laboratory\"}]}],\"code\":{\"coding\":[{\"system\":\"http://loinc.org\",\"code\":\"94500-6\",\"display\":\"SARS-CoV-2 (COVID-19) RNA [Presence] in Respiratory specimen by NAA with probe detection\"}],\"text\":\"SARS-CoV-2-RNA (PCR)\"},\"subject\":{\"identifier\":{\"system\":\"http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym\",\"value\":\"0682c5f2076f099c34cfdd15a9e063849ed437a49677e6fcc5b4198c76575be5\"}},\"effectiveDateTime\":\"2020-11-10T15:50:41.000+01:00\",\"valueCodeableConcept\":{\"coding\":[{\"system\":\"http://snomed.info/sct\",\"code\":\"260373001\",\"display\":\"Detected (qualifier value)\"}],\"text\":\"SARS-CoV-2-RNA positiv\"}},\"request\":{\"method\":\"PUT\",\"url\":\"Observation?_profile=https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/sars-cov-2-rt-pcr&date=2020-11-10T15:50:41.000+01:00&patient:identifier=http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym|0682c5f2076f099c34cfdd15a9e063849ed437a49677e6fcc5b4198c76575be5\"}}]}";
14+
15+
public static void main(String[] args)
16+
{
17+
FhirContext fhirContext = FhirContext.forR4();
18+
HapiFhirClientFactory hapiFhirClientFactory = new HapiFhirClientFactory(fhirContext,
19+
"http://localhost:8888/fhir-bridge/fhir", null, null, null, 10_000, 10_000, 20_000, true);
20+
21+
FhirClientBuilder clientBuilder = (fc, clientFactory, searchBundleOverride) -> new FhirBridgeClient(fc,
22+
hapiFhirClientFactory, searchBundleOverride);
23+
FhirClientFactory clientFactory = new FhirClientFactory(hapiFhirClientFactory, fhirContext, null, null,
24+
clientBuilder);
25+
26+
Bundle bundle = fhirContext.newJsonParser().parseResource(Bundle.class, BUNDLE_STRING);
27+
clientFactory.getFhirClient().storeBundle(bundle);
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package de.netzwerk_universitaetsmedizin.codex.processes;
2+
3+
import java.nio.file.Path;
4+
import java.nio.file.Paths;
5+
6+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.FttpClientFactory;
7+
8+
public class FttpTest
9+
{
10+
public static void main(String[] args)
11+
{
12+
Path trustStorePath = Paths
13+
.get("C:/Users/hhund/repositories/num-codex_gth-test/bpe/app/conf/fttp-num-ca_certificate.pem");
14+
Path certificatePath = Paths
15+
.get("C:/Users/hhund/repositories/num-codex_gth-test/bpe/app/conf/fttp-num-client_certificate.pem");
16+
Path privateKeyPath = Paths
17+
.get("C:/Users/hhund/repositories/num-codex_gth-test/bpe/app/conf/fttp-num-client_private-key.pem");
18+
19+
String fttpServerBase = "https://ip-test.ths.num.med.uni-greifswald.de/ttp-fhir/fhir";
20+
String fttpApiKey = "zpx9tlz07z0ebraw";
21+
String fttpStudy = "num";
22+
String fttpTarget = "codex";
23+
24+
FttpClientFactory factory = new FttpClientFactory(trustStorePath, certificatePath, privateKeyPath, 10_000,
25+
10_000, 20_000, null, null, fttpServerBase, fttpApiKey, fttpStudy, fttpTarget, null, null, null, false);
26+
// factory.getFttpClient().testConnection();
27+
factory.getFttpClient().getCrrPseudonym("foo/bar");
28+
}
29+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package de.netzwerk_universitaetsmedizin.codex.processes;
2+
3+
import java.io.IOException;
4+
import java.io.InputStream;
5+
import java.nio.file.Files;
6+
import java.nio.file.Paths;
7+
8+
import org.hl7.fhir.r4.model.Task;
9+
10+
import ca.uhn.fhir.context.FhirContext;
11+
12+
public class ToJson
13+
{
14+
public static void main(String[] args) throws IOException
15+
{
16+
FhirContext fhirContext = FhirContext.forR4();
17+
try (InputStream in = Files
18+
.newInputStream(Paths.get("src/test/resources/fhir/Task/TaskStartDataSendWithIdentifierReference.xml")))
19+
{
20+
Task task = fhirContext.newXmlParser().parseResource(Task.class, in);
21+
String taskString = fhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(task);
22+
System.out.println(taskString);
23+
}
24+
}
25+
}

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>

0 commit comments

Comments
 (0)