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

Commit ee36db8

Browse files
committed
Merge remote-tracking branch 'origin/release/1.1.0.0' into main
2 parents 4262d48 + 7710527 commit ee36db8

File tree

51 files changed

+2639
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2639
-172
lines changed

codex-process-data-transfer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>de.netzwerk-universitaetsmedizin.codex</groupId>
1010
<artifactId>codex-processes-ap1</artifactId>
11-
<version>1.0.0.0</version>
11+
<version>1.1.0.0</version>
1212
</parent>
1313

1414
<properties>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public interface ConstantsDataTransfer
9191
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_BAD_PATIENT_REFERENCE = "bad-patient-reference";
9292
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_FTTP_NOT_REACHABLE = "fttp-not-reachable";
9393
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_NO_DIC_PSEUDONYM_FOR_BLOOMFILTER = "no-dic-pseudonym-for-bloomfilter";
94+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_NO_DIC_PSEUDONYM_FOR_LOCAL_PSEUDONYM = "no-dic-pseudonym-for-local-pseudonym";
9495
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_VALIDATION_FAILED = "validation-failed";
9596
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_ECRYPTION_OF_DATA_FOR_CRR_FAILED = "ecryption-of-data-for-crr-failed";
9697
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_UNABLE_TO_STORE_ECRYPTED_DATA = "unable-to-store-ecrypted-data";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
public class DataTransferProcessPluginDefinition implements ProcessPluginDefinition
1919
{
20-
public static final String VERSION = "1.0.0.0";
21-
public static final LocalDate DATE = LocalDate.of(2023, 10, 11);
20+
public static final String VERSION = "1.1.0.0";
21+
public static final LocalDate DATE = LocalDate.of(2024, 3, 25);
2222

2323
@Override
2424
public String getName()

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/DataStoreClientFactory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,10 @@ public void testConnection()
155155
{
156156
logger.info(
157157
"Testing connection to Data Store FHIR server with {trustStorePath: {}, certificatePath: {}, privateKeyPath: {}, privateKeyPassword: {},"
158-
+ " basicAuthUsername {}, basicAuthPassword {}, bearerToken {}, serverBase: {}, proxyUrl {}, proxyUsername, proxyPassword {}}",
158+
+ " basicAuthUsername: {}, basicAuthPassword: {}, bearerToken: {}, serverBase: {}, proxy: values from 'DEV_DSF_PROXY'... config}",
159159
trustStorePath, certificatePath, privateKeyPath, privateKeyPassword != null ? "***" : "null",
160160
dataStoreServerBasicAuthUsername, dataStoreServerBasicAuthPassword != null ? "***" : "null",
161-
dataStoreServerBearerToken != null ? "***" : "null", dataStoreServerBase, proxyUrl, proxyUsername,
162-
proxyPassword != null ? "***" : "null");
161+
dataStoreServerBearerToken != null ? "***" : "null", dataStoreServerBase);
163162

164163
getDataStoreClient().testConnection();
165164
}

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/DataStoreClientImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ private void configureProxy(IRestfulClientFactory clientFactory, String proxyUrl
8181
clientFactory.setProxy(url.getHost(), url.getPort());
8282
clientFactory.setProxyCredentials(proxyUsername, proxyPassword);
8383

84-
logger.info("Using proxy for data FHIR server connection with {host: {}, port: {}, username: {}}",
85-
url.getHost(), url.getPort(), proxyUsername);
84+
logger.info("Using proxy for data FHIR server connection with values from 'DEV_DSF_PROXY'... config");
8685
}
8786
catch (MalformedURLException e)
8887
{

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/FttpClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ public interface FttpClient
1818
*/
1919
Optional<String> getDicPseudonym(String bloomFilter);
2020

21+
Optional<String> getDicPseudonymForLocalPseudonym(String localPseudonym);
22+
2123
void testConnection();
2224
}

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/FttpClientFactory.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ public Optional<String> getDicPseudonym(String bloomFilter)
6262
return pseudonym;
6363
}
6464

65+
@Override
66+
public Optional<String> getDicPseudonymForLocalPseudonym(String localPseudonym)
67+
{
68+
Optional<String> pseudonym = sha256(localPseudonym).map(p -> "dic_test/" + p);
69+
70+
logger.warn(
71+
"Returning simulated DIC pseudonym '{}' for local pseudonym '{}', fTTP connection not configured.",
72+
pseudonym.orElseThrow(), localPseudonym);
73+
74+
return pseudonym;
75+
}
76+
6577
private Optional<String> sha256(String original)
6678
{
6779
try
@@ -142,11 +154,10 @@ public void testConnection()
142154
{
143155
logger.info(
144156
"Testing connection to fTTP with {trustStorePath: {}, certificatePath: {}, privateKeyPath: {}, privateKeyPassword: {},"
145-
+ " basicAuthUsername {}, basicAuthPassword {}, serverBase: {}, apiKey: {}, study: {}, target: {}, proxyUrl {}, proxyUsername, proxyPassword {}}",
157+
+ " basicAuthUsername: {}, basicAuthPassword: {}, serverBase: {}, apiKey: {}, study: {}, target: {}, proxy: values from 'DEV_DSF_PROXY'... config}",
146158
trustStorePath, certificatePath, privateKeyPath, privateKeyPassword != null ? "***" : "null",
147159
fttpBasicAuthUsername, fttpBasicAuthPassword != null ? "***" : "null", fttpServerBase,
148-
fttpApiKey != null ? "***" : "null", fttpStudy, fttpTarget, proxyUrl, proxyUsername,
149-
proxyPassword != null ? "***" : "null");
160+
fttpApiKey != null ? "***" : "null", fttpStudy, fttpTarget);
150161

151162
getFttpClient().testConnection();
152163
}

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/FttpClientImpl.java

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ private void configureProxy(IRestfulClientFactory clientFactory, String proxyUrl
101101
clientFactory.setProxy(url.getHost(), url.getPort());
102102
clientFactory.setProxyCredentials(proxyUsername, proxyPassword);
103103

104-
logger.info("Using proxy for fTTP connection with {host: {}, port: {}, username: {}}", url.getHost(),
105-
url.getPort(), proxyUsername);
104+
logger.info("Using proxy for fTTP connection with values from 'DEV_DSF_PROXY'... config");
106105
}
107106
catch (MalformedURLException e)
108107
{
@@ -154,6 +153,18 @@ protected Parameters createParametersForPsnWorkflow(String dicSourceAndPseudonym
154153
return p;
155154
}
156155

156+
protected Parameters createParametersForPsnWorkflowLocalPseudonym(String localPseudonym)
157+
{
158+
Parameters p = new Parameters();
159+
p.addParameter("study", fttpStudy);
160+
p.addParameter("original", localPseudonym);
161+
p.addParameter("source", "local");
162+
p.addParameter("target", fttpTarget);
163+
p.addParameter("apikey", fttpApiKey);
164+
165+
return p;
166+
}
167+
157168
@Override
158169
public Optional<String> getDicPseudonym(String bloomFilter)
159170
{
@@ -178,6 +189,30 @@ public Optional<String> getDicPseudonym(String bloomFilter)
178189
}
179190
}
180191

192+
@Override
193+
public Optional<String> getDicPseudonymForLocalPseudonym(String localPseudonym)
194+
{
195+
Objects.requireNonNull(localPseudonym, "localPseudonym");
196+
197+
logger.info("Requesting DIC Pseudonym for local Pseudonym {} ...", localPseudonym);
198+
199+
try
200+
{
201+
IGenericClient client = createGenericClient();
202+
203+
Parameters parameters = client.operation().onServer().named("requestPsnWorkflow")
204+
.withParameters(createParametersForPsnWorkflowLocalPseudonym(localPseudonym))
205+
.accept(Constants.CT_FHIR_XML_NEW).encoded(EncodingEnum.XML).execute();
206+
207+
return getPseudonym(parameters).map(p -> fttpTarget + "/" + p);
208+
}
209+
catch (Exception e)
210+
{
211+
logger.error("Error while retrieving DIC pseudonym: {} - {}", e.getClass().getName(), e.getMessage());
212+
throw new BpmnError(CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_FTTP_NOT_REACHABLE, e.getMessage());
213+
}
214+
}
215+
181216
protected Parameters createParametersForBfWorkflow(String bloomFilter)
182217
{
183218
Parameters p = new Parameters();

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/fhir/AbstractComplexFhirClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ else if (resource instanceof Encounter e)
6666
e.setSubject(patientRef);
6767
else if (resource instanceof Immunization i)
6868
i.setPatient(patientRef);
69-
else if (resource instanceof Medication m)
69+
else if (resource instanceof Medication)
7070
; // nothing to do
7171
else if (resource instanceof MedicationAdministration ma)
7272
ma.setSubject(patientRef);
@@ -94,7 +94,7 @@ else if (resource instanceof Encounter e)
9494
return Optional.of(e.getSubject());
9595
else if (resource instanceof Immunization i)
9696
return Optional.of(i.getPatient());
97-
else if (resource instanceof Medication m)
97+
else if (resource instanceof Medication)
9898
return Optional.empty();
9999
else if (resource instanceof MedicationAdministration ma)
100100
return Optional.of(ma.getSubject());
@@ -198,8 +198,8 @@ protected Optional<Patient> findPatientInLocalFhirStore(String pseudonym)
198198
}
199199
catch (Exception e)
200200
{
201-
logger.warn("Error while searching for Patient with pseudonym " + NAMING_SYSTEM_NUM_CODEX_CRR_PSEUDONYM
202-
+ "|" + pseudonym, e);
201+
logger.warn("Error while searching for Patient with pseudonym {}|{}", NAMING_SYSTEM_NUM_CODEX_CRR_PSEUDONYM,
202+
pseudonym, e);
203203
throw e;
204204
}
205205
}

codex-process-data-transfer/src/main/java/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/fhir/AbstractFhirClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ public Optional<Patient> getPatient(String reference)
636636
logger.warn("Patient {} not found: {} - {}", reference, e.getClass().getName(), e.getMessage());
637637

638638
if (logger.isDebugEnabled())
639-
logger.debug("Error while reading patient " + reference, e);
639+
logger.debug("Error while reading patient {}", reference, e);
640640

641641
return Optional.empty();
642642
}
@@ -653,6 +653,8 @@ public void updatePatient(Patient patient)
653653
Objects.requireNonNull(patient, "patient");
654654

655655
String id = patient.getIdElement().toVersionless().getValue();
656+
// set the patient id to versionless id to workaround a `If-Match`-header bug in hapi fhir client
657+
patient.setId(id);
656658
logger.info("Updating patient {}", id);
657659

658660
try
@@ -682,7 +684,7 @@ public void updatePatient(Patient patient)
682684
}
683685
catch (Exception e)
684686
{
685-
logger.warn("Could not update patient " + id, e);
687+
logger.warn("Could not update patient {}", id, e);
686688
throw e;
687689
}
688690
}

0 commit comments

Comments
 (0)