From 556577102ed8287b25351f68241264c7062fd362 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Tue, 16 Jun 2026 13:32:59 +0200 Subject: feat: do not request research consent if reason missing is given (#298) This is a first approach to make use of a reason missing given in MTB file at UKGM Marburg due to special handling of research consent. Without these changes, the request will be canceled without any further processing.--- .../etl/processor/services/ConsentProcessor.kt | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/dev/dnpm/etl/processor/services/ConsentProcessor.kt b/src/main/kotlin/dev/dnpm/etl/processor/services/ConsentProcessor.kt index a95420a..20a2ba3 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/services/ConsentProcessor.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/services/ConsentProcessor.kt @@ -83,16 +83,6 @@ class ConsentProcessor( // 2.1 -> yes -> send mtb file // 2.2 -> no -> warn/info no consent given - /* - * broad consent - */ - val broadConsent = - consentService.getConsent(personIdentifierValue, requestDate, ConsentDomain.BROAD_CONSENT) - val broadConsentHasBeenAsked = broadConsent.entry.isNotEmpty() - - // fast exit - if patient has not been asked, we can skip and exit - if (!broadConsentHasBeenAsked) return false - // GenomDE_MV-Consent only if domain name available else fallback to file check val genomDeSequencingStatus = if (null != gIcsConfigProperties.genomDeConsentDomainName) { val genomeDeConsent = @@ -111,6 +101,21 @@ class ConsentProcessor( true } + /* + * broad consent + */ + if (null != mtbFile.metadata?.reasonResearchConsentMissing) { + // early return if there is a reason for missing broad consent + return false + } + + val broadConsent = + consentService.getConsent(personIdentifierValue, requestDate, ConsentDomain.BROAD_CONSENT) + val broadConsentHasBeenAsked = broadConsent.entry.isNotEmpty() + + // fast exit - if patient has not been asked, we can skip and exit + if (!broadConsentHasBeenAsked) return false + embedBroadConsentResources(mtbFile, broadConsent) val broadConsentStatus = -- cgit v1.2.3