diff options
Diffstat (limited to 'src/main')
3 files changed, 17 insertions, 13 deletions
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 fbc61a4..d445182 100644 --- a/src/main/java/dev/dnpm/etl/processor/consent/GicsConsentService.java +++ b/src/main/java/dev/dnpm/etl/processor/consent/GicsConsentService.java @@ -221,7 +221,7 @@ public class GicsConsentService extends AbstractConsentService { } } - @NonNull + @Nullable private String getConsentDomainName(ConsentDomain targetConsentDomain) { return switch (targetConsentDomain) { case BROAD_CONSENT -> gIcsConfigProperties.getBroadConsentDomainName(); 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 96e48ea..d2922f2 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt @@ -85,7 +85,7 @@ data class GIcsConfigProperties( /** Domain of broad consent resources */ val broadConsentDomainName: String = "MII", /** Domain of Modelvorhaben 64e consent resources */ - val genomDeConsentDomainName: String = "GenomDE_MV", + val genomDeConsentDomainName: String? = null, /** Value to expect in case of positiv consent */ val broadConsentPolicyCode: String = "2.16.840.1.113883.3.1937.777.24.5.3.6", /** Consent Policy which should be used for consent check */ 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 6b8ae89..1880528 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/services/ConsentProcessor.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/services/ConsentProcessor.kt @@ -74,25 +74,29 @@ class ConsentProcessor( // fast exit - if patient has not been asked, we can skip and exit if (!broadConsentHasBeenAsked) return false - val genomeDeConsent = - consentService.getConsent( - personIdentifierValue, - requestDate, - ConsentDomain.MODELLVORHABEN_64E, - ) + // GenomDE_MV-Consent only if domain name available else fallback to file check + val genomDeSequencingStatus = if (null != gIcsConfigProperties.genomDeConsentDomainName) { + val genomeDeConsent = + consentService.getConsent( + personIdentifierValue, + requestDate, + ConsentDomain.MODELLVORHABEN_64E, + ) - addGenomeDbProvisions(mtbFile, genomeDeConsent) + addGenomeDbProvisions(mtbFile, genomeDeConsent) - if (genomeDeConsent.entry.isNotEmpty()) setGenomDeSubmissionType(mtbFile) + if (genomeDeConsent.entry.isNotEmpty()) setGenomDeSubmissionType(mtbFile) + + getProvisionTypeByPolicyCode(genomeDeConsent, requestDate, ConsentDomain.MODELLVORHABEN_64E) + } else { + true + } embedBroadConsentResources(mtbFile, broadConsent) val broadConsentStatus = getProvisionTypeByPolicyCode(broadConsent, requestDate, ConsentDomain.BROAD_CONSENT) - val genomDeSequencingStatus = - getProvisionTypeByPolicyCode(genomeDeConsent, requestDate, ConsentDomain.MODELLVORHABEN_64E) - if (Consent.ConsentProvisionType.NULL == broadConsentStatus) { // bc not asked return false |
