From 6e6cea89f7b7083e4a0c1ff021b2322a58810b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Sch=C3=BCttler?= Date: Fri, 10 Nov 2023 12:41:14 +0100 Subject: [PATCH] DM-557: fix component sorting --- .../drools/documine_flora_components.drl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora_components.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora_components.drl index f1d18f26..a976a420 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora_components.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora_components.drl @@ -217,7 +217,7 @@ rule "GuidelineDeviation.0.0: Guideline deviation as sentences" rule "Species.0.0: First found species" when - $oecdNumber: String() from List.of("402", "403", "404", "405", "425", "429", "436", "471") + $oecdNumber: String() from List.of("402", "403", "404", "405", "425", "429", "436") FileAttribute(label == "OECD Number", value == $oecdNumber) $species: List() from collect (Entity(type == "species")) then @@ -313,13 +313,22 @@ rule "Necropsy.2.0: Conducted with 4 hours of exposure as one block" rule "StudyDesign.0.0: Study design as one block" when - $oecdNumber: String() from List.of("404", "405", "429", "406", "428", "438", "439", "474", "487") + $oecdNumber: String() from List.of("404", "405", "406", "428", "438", "439", "474", "487") FileAttribute(label == "OECD Number", value == $oecdNumber) $studyDesigns: List() from collect (Entity(type == "study_design")) then componentCreationService.joining("StudyDesign.0.0", "Study_Design", $studyDesigns, " "); end +rule "StudyDesign.0.1: Study design (Main Study) as one block" + when + $oecdNumber: String() from List.of("429") + FileAttribute(label == "OECD Number", value == $oecdNumber) + $studyDesigns: List() from collect (Entity(type == "study_design")) + then + componentCreationService.joining("StudyDesign.0.0", "Study_Design_Main_Study", $studyDesigns, " "); + end + rule "Results.0.0: Results and conclusions as joined values" when $oecdNumber: String() from List.of("406", "428", "438", "439", "474", "487") @@ -497,7 +506,7 @@ rule "UsedApproach.1.0: Used approach not found and thus 'Individual'" componentCreationService.create("UsedApproach.1.0", "What_was_the_approach_used", "Individual", "'Group' when approach used is present, else 'Individual'"); end -/* + rule "DefaultComponents.999.0: Create components for all unmapped entities." salience -999 when @@ -505,7 +514,7 @@ rule "DefaultComponents.999.0: Create components for all unmapped entities." then componentCreationService.createComponentsForUnMappedEntities("DefaultComponents.999.0", $allEntities); end -*/ + //------------------------------------ Component merging rules ------------------------------------ /*