diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl index 46c4e119..c65a8059 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl @@ -994,48 +994,21 @@ rule "PII.8.1: Redact contact information if producer is found (vertebrate study rule "PII.9.0: Redact between \"AUTHOR(S)\" and \"(STUDY) COMPLETION DATE\" (non vertebrate study)" when not FileAttribute(label == "Vertebrate Study", value.toLowerCase() == "yes") - $section: Section(!hasTables(), containsString("AUTHOR(S)"), containsString("AUTHOR(S):"), containsString("COMPLETION DATE:"), containsString("STUDY COMPLETION DATE:")) + $document: Document(containsStringIgnoreCase("AUTHOR(S)"), containsAnyStringIgnoreCase("COMPLETION DATE", "STUDY COMPLETION DATE")) then - entityCreationService.shortestBetweenAnyString(List.of("AUTHOR(S)", "AUTHOR(S):"), List.of("COMPLETION DATE:", "STUDY COMPLETION DATE:"), "PII", EntityType.ENTITY, $section) + entityCreationService.shortestBetweenAnyStringIgnoreCase(List.of("AUTHOR(S)", "AUTHOR(S):"), List.of("COMPLETION DATE", "COMPLETION DATE:", "STUDY COMPLETION DATE", "STUDY COMPLETION DATE:"), "PII", EntityType.ENTITY, $document) .forEach(authorEntity -> authorEntity.redact("PII.9.0", "AUTHOR(S) was found", "Article 39(e)(3) of Regulation (EC) No 178/2002")); end -//rule "PII.9.1: Redact between \"AUTHOR(S)\" and \"STUDY COMPLETION DATE\" (non vertebrate study)" -// when -// not FileAttribute(label == "Vertebrate Study", value.toLowerCase() == "yes") -// $section: Section(!hasTables(), containsString("AUTHOR(S)"), containsString("AUTHOR(S):"), containsString("STUDY COMPLETION DATE:")) -// then -// entityCreationService.shortestBetweenAnyString(List.of("AUTHOR(S)", "AUTHOR(S):"), List.of("STUDY COMPLETION DATE:"), "PII", EntityType.ENTITY, $section) -// .forEach(authorEntity -> authorEntity.redact("PII.9.1", "AUTHOR(S) was found", "Article 39(e)(3) of Regulation (EC) No 178/2002")); -// end - rule "PII.9.1: Redact between \"AUTHOR(S)\" and \"(STUDY) COMPLETION DATE\" (vertebrate study)" when FileAttribute(label == "Vertebrate Study", value.toLowerCase() == "yes") - $section: Section(!hasTables(), containsString("AUTHOR(S)"), containsString("AUTHOR(S):"), containsString("COMPLETION DATE:"), containsString("STUDY COMPLETION DATE:")) + $document: Document(containsStringIgnoreCase("AUTHOR(S)"), containsAnyStringIgnoreCase("COMPLETION DATE", "STUDY COMPLETION DATE")) then - entityCreationService.shortestBetweenAnyString(List.of("AUTHOR(S)", "AUTHOR(S):"), List.of("COMPLETION DATE:", "STUDY COMPLETION DATE:"), "PII", EntityType.ENTITY, $section) + entityCreationService.shortestBetweenAnyStringIgnoreCase(List.of("AUTHOR(S)", "AUTHOR(S):"), List.of("COMPLETION DATE", "COMPLETION DATE:", "STUDY COMPLETION DATE", "STUDY COMPLETION DATE:"), "PII", EntityType.ENTITY, $document) .forEach(authorEntity -> authorEntity.redact("PII.9.1", "AUTHOR(S) was found", "Article 39(e)(2) of Regulation (EC) No 178/2002")); end -//rule "PII.9.3: Redact between \"AUTHOR(S)\" and \"STUDY COMPLETION DATE\" (vertebrate study)" -// when -// FileAttribute(label == "Vertebrate Study", value.toLowerCase() == "yes") -// $section: Section(!hasTables(), containsString("AUTHOR(S)"), containsString("AUTHOR(S):"), containsString("STUDY COMPLETION DATE:")) -// then -// entityCreationService.shortestBetweenAnyString(List.of("AUTHOR(S)", "AUTHOR(S):"), List.of("STUDY COMPLETION DATE:"), "PII", EntityType.ENTITY, $section) -// .forEach(authorEntity -> authorEntity.redact("PII.9.3", "AUTHOR(S) was found", "Article 39(e)(2) of Regulation (EC) No 178/2002")); -// end - -rule "PII.9.4: Redact between \"AUTHOR(S)\" and \"STUDY COMPLETION DATE\" (vertebrate study)" - when - FileAttribute(label == "Vertebrate Study", value.toLowerCase() == "yes") - $document: Document(containsStringIgnoreCase("AUTHOR(S)"), containsStringIgnoreCase("STUDY COMPLETION DATE")) - then - entityCreationService.shortestBetweenAnyStringIgnoreCase(List.of("AUTHOR(S):","AUTHOR(S)"), List.of("STUDY COMPLETION DATE:","STUDY COMPLETION DATE"), "PII", EntityType.ENTITY, $document) - .forEach(authorEntity -> authorEntity.apply("PII.9.4", "AUTHOR(S) was found", "Article 39(e)(2) of Regulation (EC) No 178/2002")); - end - // Rule unit: PII.10 rule "PII.10.0: Redact study director abbreviation"