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

Commit d1b1868

Browse files
committed
Merge remote-tracking branch 'origin/release/0.6.0' into main
2 parents 9ab0080 + 5b4caa2 commit d1b1868

File tree

67 files changed

+3463
-471
lines changed

Some content is hidden

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

67 files changed

+3463
-471
lines changed

codex-process-data-transfer/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>de.netzwerk-universitaetsmedizin.codex</groupId>
88
<artifactId>codex-processes-ap1</artifactId>
9-
<version>0.5.1</version>
9+
<version>0.6.0</version>
1010
</parent>
1111

1212
<properties>
@@ -45,7 +45,7 @@
4545
<artifactId>maven-surefire-plugin</artifactId>
4646
<configuration>
4747
<excludes>
48-
<exclude>**/ValidateDataLearningTest.java</exclude>
48+
<exclude>**/*LearningTest.java</exclude>
4949
</excludes>
5050
</configuration>
5151
</plugin>

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public interface ConstantsDataTransfer
2525
String BPMN_EXECUTION_VARIABLE_CONTINUE_STATUS = "continueStatus";
2626
String BPMN_EXECUTION_VARIABLE_RETURN_TARGET = "returnTarget";
2727
String BPMN_EXECUTION_VARIABLE_SOURCE_IDS_BY_BUNDLE_UUID = "sourceIdsByBundleUuid";
28+
String BPMN_EXECUTION_VARIABLE_DRY_RUN = "dryRun";
2829

2930
String NAMING_SYSTEM_NUM_CODEX_DIC_PSEUDONYM = "http://www.netzwerk-universitaetsmedizin.de/sid/dic-pseudonym";
3031
String NAMING_SYSTEM_NUM_CODEX_CRR_PSEUDONYM = "http://www.netzwerk-universitaetsmedizin.de/sid/crr-pseudonym";
@@ -41,6 +42,8 @@ public interface ConstantsDataTransfer
4142
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_VALUE_EXPORT_FROM = "export-from";
4243
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_VALUE_EXPORT_TO = "export-to";
4344
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_VALUE_DATA_REFERENCE = "data-reference";
45+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_VALUE_DRY_RUN = "dry-run";
46+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_VALUE_ENCRYPTED_BUNDLE_SIZE = "encrypted-bundle-size";
4447

4548
String PROFILE_NUM_CODEX_TASK_DATA_TRIGGER_PROCESS_URI = "http://www.netzwerk-universitaetsmedizin.de/bpe/Process/dataTrigger/";
4649
String PROFILE_NUM_CODEX_TASK_DATA_TRIGGER_PROCESS_URI_AND_LATEST_VERSION = PROFILE_NUM_CODEX_TASK_DATA_TRIGGER_PROCESS_URI
@@ -95,15 +98,22 @@ public interface ConstantsDataTransfer
9598
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_FTTP_NOT_REACHABLE = "fttp-not-reachable";
9699
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_NO_DIC_PSEUDONYM_FOR_BLOOMFILTER = "no-dic-pseudonym-for-bloomfilter";
97100
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_VALIDATION_FAILED = "validation-failed";
101+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_ECRYPTION_OF_GECCO_DATA_FOR_CRR_FAILED = "ecryption-of-gecco-data-for-crr-failed";
102+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_UNABLE_TO_STORE_ECRYPTED_GECCO_DATA = "unable-to-store-ecrypted-gecco-data";
98103
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_GTH_NOT_REACHABLE = "gth-not-reachable";
104+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYPTED_VALIDATION_ERROR_FROM_GTH_FAILED = "download-of-encrypted-validation-error-from-gth-failed";
105+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DECRYPTION_OF_VALIDATION_ERROR_FROM_CRR_FAILED = "decryption-of-validation-error-from-crr-failed";
99106
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_TIMEOUT_WAITING_FOR_RESPONSE_FROM_CRR = "timeout-waiting-for-response-from-crr";
100107
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_CRR_NOT_REACHABLE = "crr-not-reachable";
101-
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_DATA_FROM_DIC_FAILED = "download-data-from-dic-failed";
108+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYPTED_GECCO_DATA_FROM_DIC_FAILED = "download-of-encrypted-gecco-data-from-dic-failed";
102109
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_NO_CRR_PSEUDONYM_FOR_DIC_PSEUDONYM = "no-crr-pseudonym-for-dic-pseudonym";
103110
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_TIMEOUT_WAITING_FOR_RESPONSE_FROM_GTH = "timeout-waiting-for-response-from-gth";
104-
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_DATA_FROM_GTH_FAILED = "download-data-from-gth-failed";
105-
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DECRYPTION_OF_DATA_FROM_DIC_FAILED = "decryption-of-data-from-dic-failed";
111+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYPTED_GECCO_DATA_FROM_GTH_FAILED = "download-of-encrypted-gecco-data-from-gth-failed";
112+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DECRYPTION_OF_GECCO_DATA_FROM_DIC_FAILED = "decryption-of-gecco-data-from-dic-failed";
106113
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_INSERT_INTO_CRR_FHIR_REPOSITORY_FAILED = "insert-into-crr-fhir-respository-failed";
114+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_ECRYPTION_OF_VALIDATION_ERROR_FOR_DIC_FAILED = "ecryption-of-validation-error-for-dic-failed";
115+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYTPED_VALIDATION_ERROR_FROM_CRR_FAILED = "download-of-encrytped-validation-error-from-crr-failed";
116+
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_UNABLE_TO_STORE_ECRYPTED_VALIDATION_ERROR = "unable-to-store-ecrypted-validation-error";
107117

108118
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_SOURCE = "http://www.netzwerk-universitaetsmedizin.de/fhir/CodeSystem/data-transfer-error-source";
109119
String CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_SOURCE_VALUE_MEDIC = "MeDIC";

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
@@ -36,8 +36,8 @@ public class DataTransferProcessPluginDefinition implements ProcessPluginDefinit
3636
{
3737
private static final Logger logger = LoggerFactory.getLogger(DataTransferProcessPluginDefinition.class);
3838

39-
public static final String VERSION = "0.5.1";
40-
public static final LocalDate DATE = LocalDate.of(2022, 6, 25);
39+
public static final String VERSION = "0.6.0";
40+
public static final LocalDate DATE = LocalDate.of(2022, 7, 12);
4141

4242
@Override
4343
public String getName()

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import ca.uhn.fhir.rest.client.api.IGenericClient;
2020
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.fhir.GeccoFhirClient;
2121
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.fhir.GeccoFhirClientStub;
22+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.logging.DataLogger;
2223
import de.rwh.utils.crypto.CertificateHelper;
2324
import de.rwh.utils.crypto.io.CertificateReader;
2425
import de.rwh.utils.crypto.io.PemIo;
@@ -31,11 +32,13 @@ private static final class GeccoClientStub implements GeccoClient
3132
{
3233
final FhirContext fhirContext;
3334
final String localIdentifierValue;
35+
final DataLogger dataLogger;
3436

35-
GeccoClientStub(FhirContext fhirContext, String localIdentifierValue)
37+
GeccoClientStub(FhirContext fhirContext, String localIdentifierValue, DataLogger dataLogger)
3638
{
3739
this.fhirContext = fhirContext;
3840
this.localIdentifierValue = localIdentifierValue;
41+
this.dataLogger = dataLogger;
3942
}
4043

4144
@Override
@@ -59,7 +62,7 @@ public void testConnection()
5962
@Override
6063
public GeccoFhirClient getFhirClient()
6164
{
62-
return new GeccoFhirClientStub(this);
65+
return new GeccoFhirClientStub(this, dataLogger);
6366
}
6467

6568
@Override
@@ -113,14 +116,16 @@ public boolean shouldUseChainedParameterNotLogicalReference()
113116
private final Class<GeccoFhirClient> geccoFhirClientClass;
114117
private final boolean useChainedParameterNotLogicalReference;
115118

119+
private final DataLogger dataLogger;
120+
116121
public GeccoClientFactory(Path trustStorePath, Path certificatePath, Path privateKeyPath, char[] privateKeyPassword,
117122
int connectTimeout, int socketTimeout, int connectionRequestTimeout, String geccoServerBase,
118123
String geccoServerBasicAuthUsername, String geccoServerBasicAuthPassword, String geccoServerBearerToken,
119124
String proxyUrl, String proxyUsername, String proxyPassword, boolean hapiClientVerbose,
120125
FhirContext fhirContext, Path searchBundleOverride, String localIdentifierValue,
121-
Class<GeccoFhirClient> geccoFhirClientClass, boolean useChainedParameterNotLogicalReference)
126+
Class<GeccoFhirClient> geccoFhirClientClass, boolean useChainedParameterNotLogicalReference,
127+
DataLogger dataLogger)
122128
{
123-
super();
124129
this.trustStorePath = trustStorePath;
125130
this.certificatePath = certificatePath;
126131
this.privateKeyPath = privateKeyPath;
@@ -145,6 +150,8 @@ public GeccoClientFactory(Path trustStorePath, Path certificatePath, Path privat
145150
this.localIdentifierValue = localIdentifierValue;
146151
this.geccoFhirClientClass = geccoFhirClientClass;
147152
this.useChainedParameterNotLogicalReference = useChainedParameterNotLogicalReference;
153+
154+
this.dataLogger = dataLogger;
148155
}
149156

150157
public String getServerBase()
@@ -177,7 +184,7 @@ public GeccoClient getGeccoClient()
177184
if (configured())
178185
return createGeccoClient();
179186
else
180-
return new GeccoClientStub(fhirContext, localIdentifierValue);
187+
return new GeccoClientStub(fhirContext, localIdentifierValue, dataLogger);
181188
}
182189

183190
private boolean configured()
@@ -208,7 +215,7 @@ protected GeccoClient createGeccoClient()
208215
connectionRequestTimeout, geccoServerBasicAuthUsername, geccoServerBasicAuthPassword,
209216
geccoServerBearerToken, geccoServerBase, proxyUrl, proxyUsername, proxyPassword, hapiClientVerbose,
210217
fhirContext, searchBundleOverride, localIdentifierValue, geccoFhirClientClass,
211-
useChainedParameterNotLogicalReference);
218+
useChainedParameterNotLogicalReference, dataLogger);
212219
}
213220

214221
private KeyStore readTrustStore(Path trustPath)

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import ca.uhn.fhir.rest.client.interceptor.BearerTokenAuthInterceptor;
2020
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
2121
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.fhir.GeccoFhirClient;
22+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.logging.DataLogger;
2223

2324
public class GeccoClientImpl implements GeccoClient
2425
{
@@ -40,12 +41,14 @@ public class GeccoClientImpl implements GeccoClient
4041
private final Class<GeccoFhirClient> geccoFhirClientClass;
4142
private final boolean useChainedParameterNotLogicalReference;
4243

44+
private final DataLogger dataLogger;
45+
4346
public GeccoClientImpl(KeyStore trustStore, KeyStore keyStore, char[] keyStorePassword, int connectTimeout,
4447
int socketTimeout, int connectionRequestTimeout, String geccoServerBasicAuthUsername,
4548
String geccoServerBasicAuthPassword, String geccoServerBearerToken, String geccoServerBase, String proxyUrl,
4649
String proxyUsername, String proxyPassword, boolean hapiClientVerbose, FhirContext fhirContext,
4750
Path searchBundleOverride, String localIdentifierValue, Class<GeccoFhirClient> geccoFhirClientClass,
48-
boolean useChainedParameterNotLogicalReference)
51+
boolean useChainedParameterNotLogicalReference, DataLogger dataLogger)
4952
{
5053
clientFactory = createClientFactory(trustStore, keyStore, keyStorePassword, connectTimeout, socketTimeout,
5154
connectionRequestTimeout);
@@ -65,6 +68,8 @@ public GeccoClientImpl(KeyStore trustStore, KeyStore keyStore, char[] keyStorePa
6568
this.localIdentifierValue = localIdentifierValue;
6669
this.geccoFhirClientClass = geccoFhirClientClass;
6770
this.useChainedParameterNotLogicalReference = useChainedParameterNotLogicalReference;
71+
72+
this.dataLogger = dataLogger;
6873
}
6974

7075
private void configureProxy(IRestfulClientFactory clientFactory, String proxyUrl, String proxyUsername,
@@ -154,9 +159,10 @@ public GeccoFhirClient getFhirClient()
154159
{
155160
try
156161
{
157-
Constructor<GeccoFhirClient> constructor = geccoFhirClientClass.getConstructor(GeccoClient.class);
162+
Constructor<GeccoFhirClient> constructor = geccoFhirClientClass.getConstructor(GeccoClient.class,
163+
DataLogger.class);
158164

159-
return constructor.newInstance(this);
165+
return constructor.newInstance(this, dataLogger);
160166
}
161167
catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
162168
| IllegalArgumentException | InvocationTargetException e)

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

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.GeccoClient;
3434
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.OutcomeLogger;
3535
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.domain.DateWithPrecision;
36+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.logging.DataLogger;
3637

3738
public abstract class AbstractComplexFhirClient extends AbstractFhirClient
3839
{
@@ -42,10 +43,12 @@ public abstract class AbstractComplexFhirClient extends AbstractFhirClient
4243
/**
4344
* @param geccoClient
4445
* not <code>null</code>
46+
* @param dataLogger
47+
* not <code>null</code>
4548
*/
46-
public AbstractComplexFhirClient(GeccoClient geccoClient)
49+
public AbstractComplexFhirClient(GeccoClient geccoClient, DataLogger dataLogger)
4750
{
48-
super(geccoClient);
51+
super(geccoClient, dataLogger);
4952
}
5053

5154
protected Resource setSubject(Resource resource, Reference patientRef)
@@ -136,9 +139,7 @@ protected Optional<Patient> findPatientInLocalFhirStore(String pseudonym)
136139
.systemAndIdentifier(NAMING_SYSTEM_NUM_CODEX_CRR_PSEUDONYM, pseudonym))
137140
.sort().descending("_lastUpdated").count(1).returnBundle(Bundle.class).execute();
138141

139-
if (logger.isDebugEnabled())
140-
logger.debug("Patient search-bundle result: {}",
141-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(patientBundle));
142+
dataLogger.logData("Patient search-bundle result", patientBundle);
142143

143144
if (patientBundle.getTotal() > 0)
144145
{
@@ -216,16 +217,12 @@ public Stream<DomainResource> getNewData(String pseudonym, DateWithPrecision exp
216217
Bundle searchBundle = getSearchBundleWithPatientId(localPatient.get().getIdElement().getIdPart(), exportFrom,
217218
exportTo);
218219

219-
if (logger.isDebugEnabled())
220-
logger.debug("Executing Search-Bundle: {}",
221-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(searchBundle));
220+
dataLogger.logData("Executing Search-Bundle", searchBundle);
222221

223222
Bundle resultBundle = geccoClient.getGenericFhirClient().transaction().withBundle(searchBundle)
224223
.withAdditionalHeader(Constants.HEADER_PREFER, "handling=strict").execute();
225224

226-
if (logger.isDebugEnabled())
227-
logger.debug("Search-Bundle result: {}",
228-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(resultBundle));
225+
dataLogger.logData("Search-Bundle result", resultBundle);
229226

230227
return distinctById(Stream.concat(Stream.of(localPatient.get()),
231228
resultBundle.getEntry().stream().filter(BundleEntryComponent::hasResource)
@@ -238,9 +235,7 @@ private Optional<Patient> findPatientInLocalFhirStore(String system, String pseu
238235
Bundle patientBundle = (Bundle) geccoClient.getGenericFhirClient().search().forResource(Patient.class)
239236
.where(Patient.IDENTIFIER.exactly().systemAndIdentifier(system, pseudonym)).execute();
240237

241-
if (logger.isDebugEnabled())
242-
logger.debug("Patient search-bundle result: {}",
243-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(patientBundle));
238+
dataLogger.logData("Patient search-bundle result", patientBundle);
244239

245240
if (patientBundle.getTotal() != 1 || !(patientBundle.getEntryFirstRep().getResource() instanceof Patient))
246241
return Optional.empty();

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

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.GeccoClient;
5353
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.OutcomeLogger;
5454
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.domain.DateWithPrecision;
55+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.logging.DataLogger;
5556
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.variables.PatientReference;
5657
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.variables.PatientReferenceList;
5758

@@ -207,18 +208,18 @@ String getValue(String templateParameter)
207208
}
208209

209210
protected final GeccoClient geccoClient;
211+
protected final DataLogger dataLogger;
210212

211213
/**
212214
* @param geccoClient
213215
* not <code>null</code>
214-
* @param clientFactory
216+
* @param dataLogger
215217
* not <code>null</code>
216-
* @param searchBundleOverride
217-
* may be <code>null</code>
218218
*/
219-
public AbstractFhirClient(GeccoClient geccoClient)
219+
public AbstractFhirClient(GeccoClient geccoClient, DataLogger dataLogger)
220220
{
221221
this.geccoClient = geccoClient;
222+
this.dataLogger = dataLogger;
222223
}
223224

224225
@Override
@@ -228,16 +229,12 @@ public PatientReferenceList getPatientReferencesWithNewData(DateWithPrecision ex
228229
BundleType expectedResponseType = BundleType.BATCH.equals(searchBundle.getType()) ? BundleType.BATCHRESPONSE
229230
: BundleType.TRANSACTIONRESPONSE;
230231

231-
if (logger.isDebugEnabled())
232-
logger.debug("Executing Search-Bundle: {}",
233-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(searchBundle));
232+
dataLogger.logData("Executing Search-Bundle", searchBundle);
234233

235234
Bundle resultBundle = geccoClient.getGenericFhirClient().transaction().withBundle(searchBundle)
236235
.withAdditionalHeader(Constants.HEADER_PREFER, "handling=strict").execute();
237236

238-
if (logger.isDebugEnabled())
239-
logger.debug("Search-Bundle result: {}",
240-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(resultBundle));
237+
dataLogger.logData("Search-Bundle result", resultBundle);
241238

242239
if (!resultBundle.hasType() || !expectedResponseType.equals(resultBundle.getType()) || !resultBundle.hasEntry())
243240
{
@@ -257,8 +254,7 @@ public PatientReferenceList getPatientReferencesWithNewData(DateWithPrecision ex
257254
"Error in Search-Bundle at index {}: entry has no Bundle resource or response is not 200 OK",
258255
i);
259256
if (entry.hasResource() && !(entry.getResource() instanceof Bundle))
260-
logger.debug("Unexpected entry resource: {}",
261-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(entry.getResource()));
257+
dataLogger.logData("Unexpected entry resource", entry.getResource());
262258
}
263259
}
264260

@@ -326,9 +322,7 @@ private Bundle continueSearch(String url)
326322
Bundle resultBundle = (Bundle) geccoClient.getGenericFhirClient().search().byUrl(url)
327323
.withAdditionalHeader(Constants.HEADER_PREFER, "handling=strict").execute();
328324

329-
if (logger.isDebugEnabled())
330-
logger.debug("Search-Bundle result: {}",
331-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(resultBundle));
325+
dataLogger.logData("Search-Bundle result", resultBundle);
332326

333327
return resultBundle;
334328
}

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
3131
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.GeccoClient;
3232
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client.OutcomeLogger;
33+
import de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.logging.DataLogger;
3334

3435
public class FhirBridgeClient extends AbstractComplexFhirClient
3536
{
@@ -41,10 +42,12 @@ public class FhirBridgeClient extends AbstractComplexFhirClient
4142
/**
4243
* @param geccoClient
4344
* not <code>null</code>
45+
* @param dataLogger
46+
* not <code>null</code>
4447
*/
45-
public FhirBridgeClient(GeccoClient geccoClient)
48+
public FhirBridgeClient(GeccoClient geccoClient, DataLogger dataLogger)
4649
{
47-
super(geccoClient);
50+
super(geccoClient, dataLogger);
4851
}
4952

5053
@Override
@@ -259,9 +262,8 @@ private Optional<Resource> findResourceInLocalFhirStore(String url, Class<? exte
259262
Bundle resultBundle = geccoClient.getGenericFhirClient().search().byUrl(url).sort()
260263
.descending("_lastUpdated").count(1).returnBundle(Bundle.class).execute();
261264

262-
if (logger.isDebugEnabled())
263-
logger.debug("{} search-bundle result: {}", resourceType.getAnnotation(ResourceDef.class).name(),
264-
geccoClient.getFhirContext().newJsonParser().encodeResourceToString(resultBundle));
265+
dataLogger.logData(resourceType.getAnnotation(ResourceDef.class).name() + " search-bundle result: {}",
266+
resultBundle);
265267

266268
if (resultBundle.getTotal() > 0)
267269
{

0 commit comments

Comments
 (0)