hotfix: filter entities with empty value in redactionLog and entityLog
This commit is contained in:
parent
8ec233da93
commit
1ba3952e9b
@ -90,11 +90,12 @@ public class EntityLogCreatorService {
|
|||||||
Set<Integer> sectionsToReanalyseIds,
|
Set<Integer> sectionsToReanalyseIds,
|
||||||
DictionaryVersion dictionaryVersion) {
|
DictionaryVersion dictionaryVersion) {
|
||||||
|
|
||||||
|
previousEntityLog.setEntityLogEntry(previousEntityLog.getEntityLogEntry().stream().filter(entity -> !entity.getValue().isEmpty()).collect(Collectors.toList())); // fix broken entityLogs with empty entries
|
||||||
|
|
||||||
List<EntityLogEntry> newEntityLogEntries = createEntityLogEntries(document, analyzeRequest.getDossierTemplateId(), notFoundManualRedactionEntries);
|
List<EntityLogEntry> newEntityLogEntries = createEntityLogEntries(document, analyzeRequest.getDossierTemplateId(), notFoundManualRedactionEntries);
|
||||||
Set<String> newEntityIds = newEntityLogEntries.stream().map(EntityLogEntry::getId).collect(Collectors.toSet());
|
Set<String> newEntityIds = newEntityLogEntries.stream().map(EntityLogEntry::getId).collect(Collectors.toSet());
|
||||||
List<EntityLogEntry> entriesFromReanalysedSections = previousEntityLog.getEntityLogEntry()
|
List<EntityLogEntry> entriesFromReanalysedSections = previousEntityLog.getEntityLogEntry()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(entry -> !entry.getValue().isEmpty())
|
|
||||||
.filter(entry -> (newEntityIds.contains(entry.getId()) || sectionsToReanalyseIds.contains(entry.getContainingNodeId().get(0))) && !entry.getType()
|
.filter(entry -> (newEntityIds.contains(entry.getId()) || sectionsToReanalyseIds.contains(entry.getContainingNodeId().get(0))) && !entry.getType()
|
||||||
.equals(ImportedRedactionService.IMPORTED_REDACTION_TYPE))
|
.equals(ImportedRedactionService.IMPORTED_REDACTION_TYPE))
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user