mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-04-19 17:26:51 +00:00
feat: remove obsolete config params (#101)
This commit is contained in:
parent
66cc818755
commit
48b1e62e22
12
README.md
12
README.md
@ -66,13 +66,11 @@ Ist diese nicht gesetzt. wird intern eine Anonymisierung der Patienten-ID vorgen
|
|||||||
* `APP_PSEUDONYMIZE_PREFIX`: Standortbezogenes Präfix - `UNKNOWN`, wenn nicht gesetzt
|
* `APP_PSEUDONYMIZE_PREFIX`: Standortbezogenes Präfix - `UNKNOWN`, wenn nicht gesetzt
|
||||||
* `APP_PSEUDONYMIZE_GENERATOR`: `BUILDIN` oder `GPAS` - `BUILDIN`, wenn nicht gesetzt
|
* `APP_PSEUDONYMIZE_GENERATOR`: `BUILDIN` oder `GPAS` - `BUILDIN`, wenn nicht gesetzt
|
||||||
|
|
||||||
**Hinweise**:
|
**Hinweis**
|
||||||
|
|
||||||
* Der alte Konfigurationsparameter `APP_PSEUDONYMIZER` mit den Werten `GPAS` oder `BUILDIN` sollte nicht mehr verwendet
|
Die Pseudonymisierung erfolgt im ETL-Prozessor nur für die Patienten-ID.
|
||||||
werden.
|
Andere IDs werden mithilfe des standortbezogenen Präfixes (erneut) anonymisiert, um für den aktuellen Kontext nicht
|
||||||
* Die Pseudonymisierung erfolgt im ETL-Prozessor nur für die Patienten-ID.
|
vergleichbare IDs bereitzustellen.
|
||||||
Andere IDs werden mithilfe des standortbezogenen Präfixes (erneut) anonymisiert, um für den aktuellen Kontext nicht
|
|
||||||
vergleichbare IDs bereitzustellen.
|
|
||||||
|
|
||||||
#### Eingebaute Anonymisierung
|
#### Eingebaute Anonymisierung
|
||||||
|
|
||||||
@ -217,9 +215,7 @@ Folgende Umgebungsvariablen müssen gesetzt sein, damit ein bwHC-MTB-File an DNP
|
|||||||
Folgende Umgebungsvariablen müssen gesetzt sein, damit ein bwHC-MTB-File an ein Kafka-Topic übermittelt wird:
|
Folgende Umgebungsvariablen müssen gesetzt sein, damit ein bwHC-MTB-File an ein Kafka-Topic übermittelt wird:
|
||||||
|
|
||||||
* `APP_KAFKA_OUTPUT_TOPIC`: Zu verwendendes Topic zum Versenden von Anfragen.
|
* `APP_KAFKA_OUTPUT_TOPIC`: Zu verwendendes Topic zum Versenden von Anfragen.
|
||||||
Ersetzt ~~`APP_KAFKA_TOPIC`~~, **welches nach Version 0.10 entfernt wird**.
|
|
||||||
* `APP_KAFKA_OUTPUT_RESPONSE_TOPIC`: Topic mit Antworten über den Erfolg des Versendens. Standardwert: `APP_KAFKA_TOPIC` mit Anhang "_response".
|
* `APP_KAFKA_OUTPUT_RESPONSE_TOPIC`: Topic mit Antworten über den Erfolg des Versendens. Standardwert: `APP_KAFKA_TOPIC` mit Anhang "_response".
|
||||||
Ersetzt ~~`APP_KAFKA_RESPONSE_TOPIC`~~, **welches nach Version 0.10 entfernt wird**.
|
|
||||||
* `APP_KAFKA_GROUP_ID`: Kafka GroupID des Consumers. Standardwert: `APP_KAFKA_TOPIC` mit Anhang "_group".
|
* `APP_KAFKA_GROUP_ID`: Kafka GroupID des Consumers. Standardwert: `APP_KAFKA_TOPIC` mit Anhang "_group".
|
||||||
* `APP_KAFKA_SERVERS`: Zu verwendende Kafka-Bootstrap-Server als kommagetrennte Liste
|
* `APP_KAFKA_SERVERS`: Zu verwendende Kafka-Bootstrap-Server als kommagetrennte Liste
|
||||||
|
|
||||||
|
@ -182,40 +182,7 @@ class AppConfigurationTest {
|
|||||||
@Nested
|
@Nested
|
||||||
@TestPropertySource(
|
@TestPropertySource(
|
||||||
properties = [
|
properties = [
|
||||||
"app.pseudonymize.generator=",
|
"app.pseudonymize.generator=buildin"
|
||||||
"app.pseudonymizer=buildin",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
inner class AppConfigurationPseudonymizerBuildinTest(private val context: ApplicationContext) {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun shouldUseConfiguredGenerator() {
|
|
||||||
assertThat(context.getBean(AnonymizingGenerator::class.java)).isNotNull
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
@TestPropertySource(
|
|
||||||
properties = [
|
|
||||||
"app.pseudonymize.generator=",
|
|
||||||
"app.pseudonymizer=gpas",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
inner class AppConfigurationPseudonymizerGpasTest(private val context: ApplicationContext) {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun shouldUseConfiguredGenerator() {
|
|
||||||
assertThat(context.getBean(GpasPseudonymGenerator::class.java)).isNotNull
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
@TestPropertySource(
|
|
||||||
properties = [
|
|
||||||
"app.pseudonymize.generator=buildin",
|
|
||||||
"app.pseudonymizer=",
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
inner class AppConfigurationPseudonymizeGeneratorBuildinTest(private val context: ApplicationContext) {
|
inner class AppConfigurationPseudonymizeGeneratorBuildinTest(private val context: ApplicationContext) {
|
||||||
@ -230,8 +197,7 @@ class AppConfigurationTest {
|
|||||||
@Nested
|
@Nested
|
||||||
@TestPropertySource(
|
@TestPropertySource(
|
||||||
properties = [
|
properties = [
|
||||||
"app.pseudonymize.generator=gpas",
|
"app.pseudonymize.generator=gpas"
|
||||||
"app.pseudonymizer=",
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
inner class AppConfigurationPseudonymizeGeneratorGpasTest(private val context: ApplicationContext) {
|
inner class AppConfigurationPseudonymizeGeneratorGpasTest(private val context: ApplicationContext) {
|
||||||
|
@ -21,16 +21,10 @@ package dev.dnpm.etl.processor.config
|
|||||||
|
|
||||||
import dev.dnpm.etl.processor.security.Role
|
import dev.dnpm.etl.processor.security.Role
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||||
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty
|
|
||||||
|
|
||||||
@ConfigurationProperties(AppConfigProperties.NAME)
|
@ConfigurationProperties(AppConfigProperties.NAME)
|
||||||
data class AppConfigProperties(
|
data class AppConfigProperties(
|
||||||
var bwhcUri: String?,
|
var bwhcUri: String?,
|
||||||
@get:DeprecatedConfigurationProperty(
|
|
||||||
reason = "Deprecated in favor of 'app.pseudonymize.generator'",
|
|
||||||
replacement = "app.pseudonymize.generator"
|
|
||||||
)
|
|
||||||
var pseudonymizer: PseudonymGenerator = PseudonymGenerator.BUILDIN,
|
|
||||||
var transformations: List<TransformationProperties> = listOf(),
|
var transformations: List<TransformationProperties> = listOf(),
|
||||||
var maxRetryAttempts: Int = 3,
|
var maxRetryAttempts: Int = 3,
|
||||||
var duplicationDetection: Boolean = true
|
var duplicationDetection: Boolean = true
|
||||||
@ -78,18 +72,8 @@ data class RestTargetProperties(
|
|||||||
data class KafkaProperties(
|
data class KafkaProperties(
|
||||||
val inputTopic: String?,
|
val inputTopic: String?,
|
||||||
val outputTopic: String = "etl-processor",
|
val outputTopic: String = "etl-processor",
|
||||||
@get:DeprecatedConfigurationProperty(
|
|
||||||
reason = "Deprecated",
|
|
||||||
replacement = "outputTopic"
|
|
||||||
)
|
|
||||||
val topic: String = outputTopic,
|
|
||||||
val outputResponseTopic: String = "${outputTopic}_response",
|
val outputResponseTopic: String = "${outputTopic}_response",
|
||||||
@get:DeprecatedConfigurationProperty(
|
val groupId: String = "${outputTopic}_group",
|
||||||
reason = "Deprecated",
|
|
||||||
replacement = "outputResponseTopic"
|
|
||||||
)
|
|
||||||
val responseTopic: String = outputResponseTopic,
|
|
||||||
val groupId: String = "${topic}_group",
|
|
||||||
val servers: String = ""
|
val servers: String = ""
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -85,20 +85,6 @@ class AppConfiguration {
|
|||||||
return AnonymizingGenerator()
|
return AnonymizingGenerator()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConditionalOnProperty(value = ["app.pseudonymizer"], havingValue = "GPAS")
|
|
||||||
@ConditionalOnMissingBean
|
|
||||||
@Bean
|
|
||||||
fun gpasPseudonymGeneratorOnDeprecatedProperty(configProperties: GPasConfigProperties, retryTemplate: RetryTemplate, restTemplate: RestTemplate): Generator {
|
|
||||||
return GpasPseudonymGenerator(configProperties, retryTemplate, restTemplate)
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConditionalOnProperty(value = ["app.pseudonymizer"], havingValue = "BUILDIN")
|
|
||||||
@ConditionalOnMissingBean
|
|
||||||
@Bean
|
|
||||||
fun buildinPseudonymGeneratorOnDeprecatedProperty(): Generator {
|
|
||||||
return AnonymizingGenerator()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun pseudonymizeService(
|
fun pseudonymizeService(
|
||||||
generator: Generator,
|
generator: Generator,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of ETL-Processor
|
* This file is part of ETL-Processor
|
||||||
*
|
*
|
||||||
* Copyright (c) 2024 Comprehensive Cancer Center Mainfranken, Datenintegrationszentrum Philipps-Universität Marburg and Contributors
|
* Copyright (c) 2025 Comprehensive Cancer Center Mainfranken, Datenintegrationszentrum Philipps-Universität Marburg and Contributors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published
|
* it under the terms of the GNU Affero General Public License as published
|
||||||
@ -71,7 +71,7 @@ class AppKafkaConfiguration {
|
|||||||
kafkaProperties: KafkaProperties,
|
kafkaProperties: KafkaProperties,
|
||||||
kafkaResponseProcessor: KafkaResponseProcessor
|
kafkaResponseProcessor: KafkaResponseProcessor
|
||||||
): KafkaMessageListenerContainer<String, String> {
|
): KafkaMessageListenerContainer<String, String> {
|
||||||
val containerProperties = ContainerProperties(kafkaProperties.responseTopic)
|
val containerProperties = ContainerProperties(kafkaProperties.outputResponseTopic)
|
||||||
containerProperties.messageListener = kafkaResponseProcessor
|
containerProperties.messageListener = kafkaResponseProcessor
|
||||||
return KafkaMessageListenerContainer(consumerFactory, containerProperties)
|
return KafkaMessageListenerContainer(consumerFactory, containerProperties)
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class KafkaMtbFileSender(
|
|||||||
return try {
|
return try {
|
||||||
return retryTemplate.execute<MtbFileSender.Response, Exception> {
|
return retryTemplate.execute<MtbFileSender.Response, Exception> {
|
||||||
val result = kafkaTemplate.send(
|
val result = kafkaTemplate.send(
|
||||||
kafkaProperties.topic,
|
kafkaProperties.outputTopic,
|
||||||
key(request),
|
key(request),
|
||||||
objectMapper.writeValueAsString(Data(request.requestId, request.mtbFile))
|
objectMapper.writeValueAsString(Data(request.requestId, request.mtbFile))
|
||||||
)
|
)
|
||||||
@ -72,7 +72,7 @@ class KafkaMtbFileSender(
|
|||||||
return try {
|
return try {
|
||||||
return retryTemplate.execute<MtbFileSender.Response, Exception> {
|
return retryTemplate.execute<MtbFileSender.Response, Exception> {
|
||||||
val result = kafkaTemplate.send(
|
val result = kafkaTemplate.send(
|
||||||
kafkaProperties.topic,
|
kafkaProperties.outputTopic,
|
||||||
key(request),
|
key(request),
|
||||||
objectMapper.writeValueAsString(Data(request.requestId, dummyMtbFile))
|
objectMapper.writeValueAsString(Data(request.requestId, dummyMtbFile))
|
||||||
)
|
)
|
||||||
@ -91,7 +91,7 @@ class KafkaMtbFileSender(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun endpoint(): String {
|
override fun endpoint(): String {
|
||||||
return "${this.kafkaProperties.servers} (${this.kafkaProperties.topic}/${this.kafkaProperties.responseTopic})"
|
return "${this.kafkaProperties.servers} (${this.kafkaProperties.outputTopic}/${this.kafkaProperties.outputResponseTopic})"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun key(request: MtbFileSender.MtbFileRequest): String {
|
private fun key(request: MtbFileSender.MtbFileRequest): String {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user