1
0
mirror of https://github.com/pcvolkmer/onkostar-plugin-dnpm.git synced 2025-07-03 17:52:53 +00:00

Issue #20: Kein Consent-Update, wenn kein Datum oder Wert angegeben

closes #20
This commit is contained in:
2023-04-03 17:41:50 +02:00
parent 783dfedd60
commit 0914dd21d2
2 changed files with 55 additions and 3 deletions

View File

@ -15,7 +15,7 @@ import java.util.Comparator;
*/
public class UkwConsentManagerService implements ConsentManagerService {
private Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final IOnkostarApi onkostarApi;
@ -48,10 +48,10 @@ public class UkwConsentManagerService implements ConsentManagerService {
.ifPresent(lastConsent -> {
var date = lastConsent.getStartDate();
var status = lastConsent.getValue("status");
if (null == status) {
if (null == date || null == status || status.getString().isBlank()) {
logger.warn("Kein DNPM-Einwilligungstatus angegeben");
return;
};
}
dnpmKlinikAnamnese.setValue("ConsentStatusEinwilligungDNPM", new Item("Einwilligung", status.getString()));
dnpmKlinikAnamnese.setValue("ConsentDatumEinwilligungDNPM", new Item("DatumEinwilligung", date));