Merge branch 'hotfix' into 'master'

hotfix: write dummy AnnotationStatus to redactionLog ManualChanges

See merge request redactmanager/redaction-service!166
This commit is contained in:
Kilian Schüttler 2023-10-19 10:01:22 +02:00
commit 025cc19b6c
2 changed files with 17 additions and 19 deletions

View File

@ -14,6 +14,7 @@ import java.util.stream.Collectors;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.Comment;
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Engine;
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.ManualChange;
@ -206,6 +207,7 @@ public class RedactionLogCreatorService {
manualChange1.setProcessedDate(manualChange.getProcessedDate());
manualChange1.setRequestedDate(manualChange.getRequestedDate());
manualChange1.setPropertyChanges(manualChange.getPropertyChanges());
manualChange1.setAnnotationStatus(AnnotationStatus.APPROVED);
return manualChange1;
}

View File

@ -385,19 +385,18 @@ rule "DOC.7.0: Performing Laboratory (Name)"
end
rule "DOC.7.1: Performing Laboratory (Country)"
when
nerEntities: NerEntities(hasEntitiesOfType("COUNTRY"))
$section: Section(containsString("PERFORMING LABORATORY:"))
then
nerEntities.streamEntitiesOfType("COUNTRY")
.filter(nerEntity -> $section.getTextRange().contains(nerEntity.textRange()))
.map(nerEntity -> entityCreationService.byNerEntity(nerEntity, "laboratory_country", EntityType.ENTITY, $section))
.forEach(entity -> {
entity.apply("DOC.7.1", "Performing Laboratory found", "n-a");
insert(entity);
});
end
rule "DOC.7.1: Performing Laboratory (Country)"
when
nerEntities: NerEntities(hasEntitiesOfType("COUNTRY"))
$section: Section(containsString("PERFORMING LABORATORY:"))
then
nerEntities.streamEntitiesOfType("COUNTRY")
.filter(nerEntity -> $section.getTextRange().contains(nerEntity.textRange()))
.map(nerEntity -> entityCreationService.byNerEntity(nerEntity, "laboratory_country", EntityType.ENTITY, $section))
.forEach(entity -> {
entity.apply("DOC.7.1", "Performing Laboratory found", "n-a");
});
end
rule "DOC.7.2: Performing Laboratory (Country & Name) from dict"
@ -408,10 +407,10 @@ rule "DOC.7.2: Performing Laboratory (Country & Name) from dict"
)
then
$section.getEntitiesOfType("laboratory_country").forEach(entity -> {
entity.apply("DOC.7.2", "Performing laboratory country dictionary entry found.", "n-a");
entity.apply("DOC.7.2", "Performing laboratory country dictionary entry found.");
});
$section.getEntitiesOfType("laboratory_name").forEach(entity -> {
entity.apply("DOC.7.2", "Performing laboratory name dictionary entry found.", "n-a");
entity.apply("DOC.7.2", "Performing laboratory name dictionary entry found.");
});
end
@ -423,10 +422,7 @@ rule "DOC.7.3: Performing Laboratory (Country) from dict"
&& !(containsString("PERFORMING LABORATORY:") || (containsString("PERFORMING") && containsString("LABORATORY:")))
)
then
$section.getEntitiesOfType(List.of("laboratory_country", "laboratory_name")).forEach(entity -> {
entity.removeFromGraph();
retract(entity);
});
$section.getEntitiesOfType("laboratory_country", "laboratory_name").forEach(entity -> entity.remove("DOC.7.3", "Removed due to wrong section"));
end