diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl index eb734c98..3f71868c 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl @@ -146,17 +146,13 @@ rule "CBI.7.0: Do not redact Names and Addresses if published information found rule "CBI.7.1: Do not redact Names and Addresses if published information found in same table row" when - $table: Table(hasEntitiesOfType("published_information"), - (hasEntitiesOfType("CBI_author") || hasEntitiesOfType("CBI_address"))) + $table: Table(hasEntitiesOfType("published_information"), hasEntitiesOfType("CBI_author")) + $tableCell: TableCell() from $table.streamTableCells().toList() + $sameRowCell: TableCell(row == $tableCell.row) from $table.streamTableCells().toList() + TextEntity(type == "published_information") from $tableCell.getEntities() + $author: TextEntity(type == "CBI_author") from $tableCell.getEntities() then - $table.streamEntitiesWhereRowContainsEntitiesOfType(List.of("CBI_author", "CBI_address")) - .forEach(redactionEntity -> { - redactionEntity.skipWithReferences( - "CBI.7.1", - "Published Information found in row", - $table.getEntitiesOfTypeInSameRow("published_information", redactionEntity) - ); - }); + $author.skipWithReferences("CBI.7.1", "Published Information found in row", $table.getEntitiesOfTypeInSameRow("published_information", $author)); end 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 9fb37ab0..5ae16831 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 @@ -329,17 +329,13 @@ rule "CBI.7.0: Do not redact Names and Addresses if published information found rule "CBI.7.1: Do not redact Names and Addresses if published information found in same table row" when - $table: Table(hasEntitiesOfType("published_information"), - (hasEntitiesOfType("CBI_author") || hasEntitiesOfType("CBI_address"))) + $table: Table(hasEntitiesOfType("published_information"), hasEntitiesOfType("CBI_author")) + $tableCell: TableCell() from $table.streamTableCells().toList() + $sameRowCell: TableCell(row == $tableCell.row) from $table.streamTableCells().toList() + TextEntity(type == "published_information") from $tableCell.getEntities() + $author: TextEntity(type == "CBI_author") from $tableCell.getEntities() then - $table.streamEntitiesWhereRowContainsEntitiesOfType(List.of("CBI_author", "CBI_address")) - .forEach(redactionEntity -> { - redactionEntity.skipWithReferences( - "CBI.7.1", - "Published Information found in row", - $table.getEntitiesOfTypeInSameRow("published_information", redactionEntity) - ); - }); + $author.skipWithReferences("CBI.7.1", "Published Information found in row", $table.getEntitiesOfTypeInSameRow("published_information", $author)); end diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl index 2985b656..27872605 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl @@ -142,17 +142,13 @@ rule "CBI.7.0: Do not redact Names and Addresses if published information found rule "CBI.7.1: Do not redact Names and Addresses if published information found in same table row" when - $table: Table(hasEntitiesOfType("published_information"), - (hasEntitiesOfType("CBI_author") || hasEntitiesOfType("CBI_address"))) + $table: Table(hasEntitiesOfType("published_information"), hasEntitiesOfType("CBI_author")) + $tableCell: TableCell() from $table.streamTableCells().toList() + $sameRowCell: TableCell(row == $tableCell.row) from $table.streamTableCells().toList() + TextEntity(type == "published_information") from $tableCell.getEntities() + $author: TextEntity(type == "CBI_author") from $tableCell.getEntities() then - $table.streamEntitiesWhereRowContainsEntitiesOfType(List.of("CBI_author", "CBI_address")) - .forEach(redactionEntity -> { - redactionEntity.skipWithReferences( - "CBI.7.1", - "Published Information found in row", - $table.getEntitiesOfTypeInSameRow("published_information", redactionEntity) - ); - }); + $author.skipWithReferences("CBI.7.1", "Published Information found in row", $table.getEntitiesOfTypeInSameRow("published_information", $author)); end diff --git a/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl b/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl index ad8fa6ba..3cfc4031 100644 --- a/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl +++ b/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl @@ -329,17 +329,13 @@ rule "CBI.7.0: Do not redact Names and Addresses if published information found rule "CBI.7.1: Do not redact Names and Addresses if published information found in same table row" when - $table: Table(hasEntitiesOfType("published_information"), - (hasEntitiesOfType("CBI_author") || hasEntitiesOfType("CBI_address"))) + $table: Table(hasEntitiesOfType("published_information"), hasEntitiesOfType("CBI_author")) + $tableCell: TableCell() from $table.streamTableCells().toList() + $sameRowCell: TableCell(row == $tableCell.row) from $table.streamTableCells().toList() + TextEntity(type == "published_information") from $tableCell.getEntities() + $author: TextEntity(type == "CBI_author") from $tableCell.getEntities() then - $table.streamEntitiesWhereRowContainsEntitiesOfType(List.of("CBI_author", "CBI_address")) - .forEach(redactionEntity -> { - redactionEntity.skipWithReferences( - "CBI.7.1", - "Published Information found in row", - $table.getEntitiesOfTypeInSameRow("published_information", redactionEntity) - ); - }); + $author.skipWithReferences("CBI.7.1", "Published Information found in row", $table.getEntitiesOfTypeInSameRow("published_information", $author)); end diff --git a/redaction-service-v1/rules-management/src/test/resources/all_redact_manager_rules.drl b/redaction-service-v1/rules-management/src/test/resources/all_redact_manager_rules.drl index ad8fa6ba..3cfc4031 100644 --- a/redaction-service-v1/rules-management/src/test/resources/all_redact_manager_rules.drl +++ b/redaction-service-v1/rules-management/src/test/resources/all_redact_manager_rules.drl @@ -329,17 +329,13 @@ rule "CBI.7.0: Do not redact Names and Addresses if published information found rule "CBI.7.1: Do not redact Names and Addresses if published information found in same table row" when - $table: Table(hasEntitiesOfType("published_information"), - (hasEntitiesOfType("CBI_author") || hasEntitiesOfType("CBI_address"))) + $table: Table(hasEntitiesOfType("published_information"), hasEntitiesOfType("CBI_author")) + $tableCell: TableCell() from $table.streamTableCells().toList() + $sameRowCell: TableCell(row == $tableCell.row) from $table.streamTableCells().toList() + TextEntity(type == "published_information") from $tableCell.getEntities() + $author: TextEntity(type == "CBI_author") from $tableCell.getEntities() then - $table.streamEntitiesWhereRowContainsEntitiesOfType(List.of("CBI_author", "CBI_address")) - .forEach(redactionEntity -> { - redactionEntity.skipWithReferences( - "CBI.7.1", - "Published Information found in row", - $table.getEntitiesOfTypeInSameRow("published_information", redactionEntity) - ); - }); + $author.skipWithReferences("CBI.7.1", "Published Information found in row", $table.getEntitiesOfTypeInSameRow("published_information", $author)); end