RED-7784 - Add positions for not found manual entities calculation

This commit is contained in:
Andrei Isvoran 2023-11-21 10:41:15 +02:00
parent a294d1dcd4
commit f6bd1bc87a

View File

@ -54,7 +54,7 @@ public class EntityLogCreatorService {
RedactionStorageService redactionStorageService;
private static boolean notFalsePositiveOrFalseRecommendation(TextEntity textEntity) {
public static boolean notFalsePositiveOrFalseRecommendation(TextEntity textEntity) {
return !(textEntity.getEntityType().equals(EntityType.FALSE_POSITIVE) || textEntity.getEntityType().equals(EntityType.FALSE_RECOMMENDATION));
}
@ -156,6 +156,7 @@ public class EntityLogCreatorService {
.forEach(entityNode -> entries.addAll(toEntityLogEntries(entityNode, dossierTemplateId, processedIds)));
document.streamAllImages().filter(entity -> !entity.removed()).forEach(imageNode -> entries.add(createEntityLogEntry(imageNode, dossierTemplateId)));
notFoundManualRedactionEntries.stream().filter(entity -> !entity.removed()).forEach(manualEntity -> entries.add(createEntityLogEntry(manualEntity, dossierTemplateId)));
log.info("Found legal basis: {}", entries.stream().filter(entry -> entry.getValue().contains("Sternebral")).findFirst().get().getLegalBasis());
return entries;
}