From 4d2a7d454d916e7eee65f7cc155323924c2cb229 Mon Sep 17 00:00:00 2001 From: deiflaender Date: Tue, 22 Mar 2022 10:24:26 +0100 Subject: [PATCH] RED-2836: Fixed calculating dictionary increments with false_positive and false_recommendation --- .../redaction/service/DictionaryService.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/DictionaryService.java b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/DictionaryService.java index d3cd7fa0..dad34708 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/DictionaryService.java +++ b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/DictionaryService.java @@ -60,6 +60,16 @@ public class DictionaryService { newValues.add(new DictionaryIncrementValue(dictionaryEntry.getValue(), dictionaryModel.isCaseInsensitive())); } }); + dictionaryModel.getFalsePositives().forEach(dictionaryEntry -> { + if (dictionaryEntry.getVersion() > fromVersion.getDossierTemplateVersion()) { + newValues.add(new DictionaryIncrementValue(dictionaryEntry.getValue(), dictionaryModel.isCaseInsensitive())); + } + }); + dictionaryModel.getFalseRecommendations().forEach(dictionaryEntry -> { + if (dictionaryEntry.getVersion() > fromVersion.getDossierTemplateVersion()) { + newValues.add(new DictionaryIncrementValue(dictionaryEntry.getValue(), dictionaryModel.isCaseInsensitive())); + } + }); }); if (dictionariesByDossier.containsKey(dossierId)) { @@ -70,6 +80,16 @@ public class DictionaryService { newValues.add(new DictionaryIncrementValue(dictionaryEntry.getValue(), dictionaryModel.isCaseInsensitive())); } }); + dictionaryModel.getFalsePositives().forEach(dictionaryEntry -> { + if (dictionaryEntry.getVersion() > fromVersion.getDossierVersion()) { + newValues.add(new DictionaryIncrementValue(dictionaryEntry.getValue(), dictionaryModel.isCaseInsensitive())); + } + }); + dictionaryModel.getFalseRecommendations().forEach(dictionaryEntry -> { + if (dictionaryEntry.getVersion() > fromVersion.getDossierVersion()) { + newValues.add(new DictionaryIncrementValue(dictionaryEntry.getValue(), dictionaryModel.isCaseInsensitive())); + } + }); }); }