RED-7712 - Published information does not always trigger the skip mechanism

This commit is contained in:
Andrei Isvoran 2023-11-01 08:59:11 +01:00
parent 54bb79b294
commit 908b3ca4b2
5 changed files with 30 additions and 50 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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