From f18e4dcae8c1a67a6dd51aed284cbcf640e93f33 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Mon, 10 Nov 2025 09:49:33 +0100 Subject: feat: config option for broad consent version (#189) --- .../java/dev/dnpm/etl/processor/consent/GicsConsentService.java | 9 +++++---- .../kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/main') diff --git a/src/main/java/dev/dnpm/etl/processor/consent/GicsConsentService.java b/src/main/java/dev/dnpm/etl/processor/consent/GicsConsentService.java index a69ba53..72238a3 100644 --- a/src/main/java/dev/dnpm/etl/processor/consent/GicsConsentService.java +++ b/src/main/java/dev/dnpm/etl/processor/consent/GicsConsentService.java @@ -40,8 +40,6 @@ public class GicsConsentService implements IConsentService { "/$currentPolicyStatesForPerson"; private static final String BROAD_CONSENT_PROFILE_URI = "https://www.medizininformatik-initiative.de/fhir/modul-consent/StructureDefinition/mii-pr-consent-einwilligung"; - private static final String BROAD_CONSENT_POLICY = - "urn:oid:2.16.840.1.113883.3.1937.777.24.2.1791"; private final RetryTemplate retryTemplate; private final RestTemplate restTemplate; @@ -331,8 +329,11 @@ public class GicsConsentService implements IConsentService { return gIcsResultBundle; } - if (consentAsOne.getPolicy().stream().noneMatch(p -> p.getUri().equals(BROAD_CONSENT_POLICY))) { - consentAsOne.addPolicy(new Consent.ConsentPolicyComponent().setUri(BROAD_CONSENT_POLICY)); + if (consentAsOne.getPolicy().stream() + .noneMatch(p -> p.getUri().equals(gIcsConfigProperties.getBroadConsentPolicyUri()))) { + consentAsOne.addPolicy( + new Consent.ConsentPolicyComponent() + .setUri(gIcsConfigProperties.getBroadConsentPolicyUri())); } if (consentAsOne.getMeta().getProfile().stream() diff --git a/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt b/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt index ee33114..57ab06c 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt @@ -106,6 +106,11 @@ data class GIcsConfigProperties( */ val broadConsentPolicySystem: String = "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3", + /** + * Consent Policy uri for MII Broad Consent Version + */ + val broadConsentPolicyUri: String = "urn:oid:2.16.840.1.113883.3.1937.777.24.2.1790", + /** * Value to expect in case of positiv consent */ -- cgit v1.2.3