summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2026-01-22 14:06:07 +0100
committerGitHub2026-01-22 13:06:07 +0000
commit2ba333c771c100ac463f9ca854185ed80c1ac7c4 (patch)
treed20a8f555310e6ef8ef2301403f601fc0df3ba77 /src
parentc9ccf9c1c92e49f927f2346e27032acd87174f48 (diff)
feat!: allow missing GenomDE gICS domain name (#244)
If no domain name is given vor GenomDE consent, this will be ignored and the consent information must be present in incoming MTB data in order to satisfy DNPM:DIP.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/dev/dnpm/etl/processor/consent/GicsConsentService.java2
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/config/AppConfigProperties.kt2
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/services/ConsentProcessor.kt26
-rw-r--r--src/test/kotlin/dev/dnpm/etl/processor/services/ConsentProcessorTest.kt12
4 files changed, 23 insertions, 19 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
diff --git a/src/test/kotlin/dev/dnpm/etl/processor/services/ConsentProcessorTest.kt b/src/test/kotlin/dev/dnpm/etl/processor/services/ConsentProcessorTest.kt
index 3e54e71..02165a6 100644
--- a/src/test/kotlin/dev/dnpm/etl/processor/services/ConsentProcessorTest.kt
+++ b/src/test/kotlin/dev/dnpm/etl/processor/services/ConsentProcessorTest.kt
@@ -10,11 +10,6 @@ import dev.dnpm.etl.processor.consent.GicsConsentService
import dev.pcvolkmer.mv64e.mtb.Mtb
import dev.pcvolkmer.mv64e.mtb.MvhSubmissionType
import dev.pcvolkmer.mv64e.mtb.Patient
-import java.io.IOException
-import java.io.InputStream
-import java.time.Instant
-import java.time.OffsetDateTime
-import java.util.*
import org.assertj.core.api.Assertions.assertThat
import org.hl7.fhir.r4.model.Bundle
import org.hl7.fhir.r4.model.CodeableConcept
@@ -33,6 +28,11 @@ import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.eq
import org.mockito.kotlin.whenever
import org.springframework.core.io.ClassPathResource
+import java.io.IOException
+import java.io.InputStream
+import java.time.Instant
+import java.time.OffsetDateTime
+import java.util.*
@ExtendWith(MockitoExtension::class)
class ConsentProcessorTest {
@@ -49,7 +49,7 @@ class ConsentProcessorTest {
@Mock gicsConsentService: GicsConsentService,
) {
- this.gIcsConfigProperties = GIcsConfigProperties("https://gics.example.com")
+ this.gIcsConfigProperties = GIcsConfigProperties(uri = "https://gics.example.com", genomDeConsentDomainName = "GenomDE_MV")
val jacksonConfig = JacksonConfig()
this.objectMapper = jacksonConfig.objectMapper()
this.fhirContext = JacksonConfig.fhirContext()