diff options
5 files changed, 17 insertions, 5 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 49f5652..37040b0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,7 +21,7 @@ group = "dev.dnpm" version = "0.18.0" // x-release-please-version // Additional versions -val mtbModelVersion by extra("0.5.0") +val mtbModelVersion by extra("0.6.0") val hapiFhirVersion by extra("8.10.1") val apacheCxfVersion by extra("4.2.3") val springModulithVersion by extra("2.0.5") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9b7cb4a..91c4fc6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 diff --git a/src/main/kotlin/dev/dnpm/etl/processor/pseudonym/extensions.kt b/src/main/kotlin/dev/dnpm/etl/processor/pseudonym/extensions.kt index 21f3a7f..cc13a04 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/pseudonym/extensions.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/pseudonym/extensions.kt @@ -95,6 +95,9 @@ infix fun PatientRecord.pseudonymizeWith(pseudonymizeService: PseudonymizeServic this.systemicTherapies?.filterNotNull()?.forEach { systemicTherapy -> systemicTherapy.history?.filterNotNull()?.forEach { it.patient?.id = patientPseudonym } } + this.studyInclusions?.filterNotNull()?.forEach { studyInclusion -> + studyInclusion.history?.filterNotNull()?.forEach { it.patient?.id = patientPseudonym } + } this.followUps?.filterNotNull()?.forEach { it.patient?.id = patientPseudonym } this.msiFindings?.filterNotNull()?.forEach { it.patient?.id = patientPseudonym } @@ -278,6 +281,14 @@ infix fun PatientRecord.anonymizeContentWith(pseudonymizeService: PseudonymizeSe history.basedOn?.id = history.basedOn?.id?.let(::anonymize) } } + + this.studyInclusions?.filterNotNull()?.forEach { studyInclusion -> + studyInclusion.history?.filterNotNull()?.forEach { history -> + history.id = history.id?.let(::anonymize) + history.reason?.id = history.reason?.id?.let(::anonymize) + history.basedOn?.id = history.basedOn?.id?.let(::anonymize) + } + } } fun PatientRecord.ensureMetaDataIsInitialized() { diff --git a/src/main/kotlin/dev/dnpm/etl/processor/services/RequestProcessor.kt b/src/main/kotlin/dev/dnpm/etl/processor/services/RequestProcessor.kt index 6ce9d14..d94bfb3 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/services/RequestProcessor.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/services/RequestProcessor.kt @@ -372,11 +372,12 @@ class RequestProcessor( } private fun fingerprint(s: String): Fingerprint { - return Fingerprint( + val f = Fingerprint( Base32().encodeAsString(DigestUtils.sha256(s)) .replace("=", "") .lowercase() ) + return f } } diff --git a/src/test/kotlin/dev/dnpm/etl/processor/services/RequestProcessorTest.kt b/src/test/kotlin/dev/dnpm/etl/processor/services/RequestProcessorTest.kt index 8433e93..5668632 100644 --- a/src/test/kotlin/dev/dnpm/etl/processor/services/RequestProcessorTest.kt +++ b/src/test/kotlin/dev/dnpm/etl/processor/services/RequestProcessorTest.kt @@ -120,7 +120,7 @@ class RequestProcessorTest { randomRequestId(), PatientPseudonym("TEST_12345678901"), PatientId("P1"), - Fingerprint("tyfimuuc7okhnoholo6jx5o5os3n7haelezphr4477uxbzlotvra"), + Fingerprint("qabfhnkyzgnwbk3lvan2su6ttfx6lw5kse4csrv6owwgjewo26xq"), RequestType.MTB_FILE, SubmissionType.TEST, RequestStatus.SUCCESS, @@ -183,7 +183,7 @@ class RequestProcessorTest { randomRequestId(), PatientPseudonym("TEST_12345678901"), PatientId("P1"), - Fingerprint("q3qfwecsw3tcmdsg4kg5ki4ob3qw3warnwi4qc54nptjgzft53nq"), + Fingerprint("x2cyiw4nbwbxczmo3cmkct4yvumc6yzy37p7fk3gjfu2evvq66oq"), RequestType.MTB_FILE, SubmissionType.TEST, RequestStatus.SUCCESS, |
