mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-04-19 17:26:51 +00:00
Check fingerprint against last accepted mtb file
This commit is contained in:
parent
c8f1f1df14
commit
cd20e0a170
@ -53,7 +53,8 @@ class MtbFileController(
|
||||
val pseudonymized = pseudonymizeService.pseudonymize(mtbFile)
|
||||
|
||||
val lastRequestForPatient =
|
||||
requestRepository.findAllByPatientIdOrderByProcessedAtDesc(pseudonymized.patient.id).firstOrNull()
|
||||
requestRepository.findAllByPatientIdOrderByProcessedAtDesc(pseudonymized.patient.id)
|
||||
.firstOrNull { it.status == RequestStatus.SUCCESS || it.status == RequestStatus.WARNING }
|
||||
|
||||
if (null != lastRequestForPatient && lastRequestForPatient.fingerprint == fingerprint(mtbFile)) {
|
||||
requestRepository.save(
|
||||
@ -107,6 +108,7 @@ class MtbFileController(
|
||||
RequestStatus.ERROR -> Report("Fehler bei der Datenübertragung oder Inhalt nicht verarbeitbar")
|
||||
RequestStatus.WARNING -> Report("Warnungen über mangelhafte Daten",
|
||||
responses.joinToString("\n") { it.reason })
|
||||
|
||||
RequestStatus.UNKNOWN -> Report("Keine Informationen")
|
||||
else -> null
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user