Integrate legal basis to rules, redaction annotation and tests
This commit is contained in:
parent
04f0c29a49
commit
f0f748db1b
@ -17,6 +17,7 @@ public class Entity {
|
|||||||
private final String type;
|
private final String type;
|
||||||
private boolean redaction;
|
private boolean redaction;
|
||||||
private String redactionReason;
|
private String redactionReason;
|
||||||
|
private String legalBasis;
|
||||||
private List<EntityPositionSequence> positionSequences = new ArrayList<>();
|
private List<EntityPositionSequence> positionSequences = new ArrayList<>();
|
||||||
private List<TextPositionSequence> targetSequences;
|
private List<TextPositionSequence> targetSequences;
|
||||||
private Integer start;
|
private Integer start;
|
||||||
|
|||||||
@ -56,13 +56,14 @@ public class Section {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void redact(String type, int ruleNumber, String reason) {
|
public void redact(String type, int ruleNumber, String reason, String legalBasis) {
|
||||||
|
|
||||||
entities.forEach(entity -> {
|
entities.forEach(entity -> {
|
||||||
if (entity.getType().equals(type)) {
|
if (entity.getType().equals(type)) {
|
||||||
entity.setRedaction(true);
|
entity.setRedaction(true);
|
||||||
entity.setMatchedRule(ruleNumber);
|
entity.setMatchedRule(ruleNumber);
|
||||||
entity.setRedactionReason(reason);
|
entity.setRedactionReason(reason);
|
||||||
|
entity.setLegalBasis(legalBasis);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -80,19 +81,20 @@ public class Section {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void redactIfPrecededBy(String prefix, String type, int ruleNumber, String reason) {
|
public void redactIfPrecededBy(String prefix, String type, int ruleNumber, String reason, String legalBasis) {
|
||||||
|
|
||||||
entities.forEach(entity -> {
|
entities.forEach(entity -> {
|
||||||
if (entity.getType().equals(type) && searchText.indexOf(prefix + entity.getWord()) != 1) {
|
if (entity.getType().equals(type) && searchText.indexOf(prefix + entity.getWord()) != 1) {
|
||||||
entity.setRedaction(true);
|
entity.setRedaction(true);
|
||||||
entity.setMatchedRule(ruleNumber);
|
entity.setMatchedRule(ruleNumber);
|
||||||
entity.setRedactionReason(reason);
|
entity.setRedactionReason(reason);
|
||||||
|
entity.setLegalBasis(legalBasis);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void redactLineAfter(String start, String asType, int ruleNumber, String reason) {
|
public void redactLineAfter(String start, String asType, int ruleNumber, String reason, String legalBasis) {
|
||||||
|
|
||||||
String[] values = StringUtils.substringsBetween(text, start, "\n");
|
String[] values = StringUtils.substringsBetween(text, start, "\n");
|
||||||
|
|
||||||
@ -111,13 +113,14 @@ public class Section {
|
|||||||
entity.setRedaction(true);
|
entity.setRedaction(true);
|
||||||
entity.setMatchedRule(ruleNumber);
|
entity.setMatchedRule(ruleNumber);
|
||||||
entity.setRedactionReason(reason);
|
entity.setRedactionReason(reason);
|
||||||
|
entity.setLegalBasis(legalBasis);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void redactBetween(String start, String stop, String asType, int ruleNumber, String reason) {
|
public void redactBetween(String start, String stop, String asType, int ruleNumber, String reason, String legalBasis) {
|
||||||
|
|
||||||
String[] values = StringUtils.substringsBetween(searchText, start, stop);
|
String[] values = StringUtils.substringsBetween(searchText, start, stop);
|
||||||
|
|
||||||
@ -136,6 +139,7 @@ public class Section {
|
|||||||
entity.setRedaction(true);
|
entity.setRedaction(true);
|
||||||
entity.setMatchedRule(ruleNumber);
|
entity.setMatchedRule(ruleNumber);
|
||||||
entity.setRedactionReason(reason);
|
entity.setRedactionReason(reason);
|
||||||
|
entity.setLegalBasis(legalBasis);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -151,10 +155,15 @@ public class Section {
|
|||||||
startIndex = searchText.indexOf(value, stopIndex);
|
startIndex = searchText.indexOf(value, stopIndex);
|
||||||
stopIndex = startIndex + value.length();
|
stopIndex = startIndex + value.length();
|
||||||
|
|
||||||
if (startIndex > -1 && (startIndex == 0 || Character.isWhitespace(searchText.charAt(startIndex - 1)) || isSeparator(searchText
|
if (startIndex > -1 && (startIndex == 0 || Character.isWhitespace(searchText.charAt(startIndex - 1)) || isSeparator(
|
||||||
.charAt(startIndex - 1))) && (stopIndex == searchText.length() || isSeparator(searchText.charAt(stopIndex)))) {
|
searchText.charAt(startIndex - 1))) && (stopIndex == searchText.length() || isSeparator(searchText.charAt(
|
||||||
found.add(new Entity(searchText.substring(startIndex, stopIndex), asType, startIndex, stopIndex,
|
stopIndex)))) {
|
||||||
headline, sectionNumber));
|
found.add(new Entity(searchText.substring(startIndex, stopIndex),
|
||||||
|
asType,
|
||||||
|
startIndex,
|
||||||
|
stopIndex,
|
||||||
|
headline,
|
||||||
|
sectionNumber));
|
||||||
}
|
}
|
||||||
} while (startIndex > -1);
|
} while (startIndex > -1);
|
||||||
|
|
||||||
@ -164,7 +173,8 @@ public class Section {
|
|||||||
|
|
||||||
private boolean isSeparator(char c) {
|
private boolean isSeparator(char c) {
|
||||||
|
|
||||||
return Character.isWhitespace(c) || Pattern.matches("\\p{Punct}", String.valueOf(c)) || c == '\"' || c == '‘' || c == '’';
|
return Character.isWhitespace(c) || Pattern.matches("\\p{Punct}",
|
||||||
|
String.valueOf(c)) || c == '\"' || c == '‘' || c == '’';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -186,23 +196,23 @@ public class Section {
|
|||||||
|
|
||||||
public void highlightCell(String cellHeader, int ruleNumber, String type) {
|
public void highlightCell(String cellHeader, int ruleNumber, String type) {
|
||||||
|
|
||||||
annotateCell(cellHeader, ruleNumber, type, false, null);
|
annotateCell(cellHeader, ruleNumber, type, false, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void redactCell(String cellHeader, int ruleNumber, String type, String reason) {
|
public void redactCell(String cellHeader, int ruleNumber, String type, String reason, String legalBasis) {
|
||||||
|
|
||||||
annotateCell(cellHeader, ruleNumber, type, true, reason);
|
annotateCell(cellHeader, ruleNumber, type, true, reason, legalBasis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void redactNotCell(String cellHeader, int ruleNumber, String type, String reason) {
|
public void redactNotCell(String cellHeader, int ruleNumber, String type, String reason) {
|
||||||
|
|
||||||
annotateCell(cellHeader, ruleNumber, type, false, reason);
|
annotateCell(cellHeader, ruleNumber, type, false, reason, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void annotateCell(String cellHeader, int ruleNumber, String type, boolean redact, String reason) {
|
private void annotateCell(String cellHeader, int ruleNumber, String type, boolean redact, String reason, String legalBasis) {
|
||||||
|
|
||||||
String cleanHeaderName = cellHeader.replaceAll("\n", "").replaceAll(" ", "").replaceAll("-", "");
|
String cleanHeaderName = cellHeader.replaceAll("\n", "").replaceAll(" ", "").replaceAll("-", "");
|
||||||
|
|
||||||
@ -222,6 +232,7 @@ public class Section {
|
|||||||
entity.setRedactionReason(reason);
|
entity.setRedactionReason(reason);
|
||||||
entity.setTargetSequences(value.getTextBlock()
|
entity.setTargetSequences(value.getTextBlock()
|
||||||
.getSequences()); // Make sure no other cells with same content are highlighted
|
.getSequences()); // Make sure no other cells with same content are highlighted
|
||||||
|
entity.setLegalBasis(legalBasis);
|
||||||
|
|
||||||
// HashSet keeps the older value, but we want the new only.
|
// HashSet keeps the older value, but we want the new only.
|
||||||
entities.remove(entity);
|
entities.remove(entity);
|
||||||
|
|||||||
@ -22,9 +22,9 @@ import lombok.Getter;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
|
||||||
public class DictionaryService {
|
public class DictionaryService {
|
||||||
|
|
||||||
private final DictionaryClient dictionaryClient;
|
private final DictionaryClient dictionaryClient;
|
||||||
|
|||||||
@ -133,13 +133,13 @@ public class AnnotationHighlightService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(entityPositionSequence.getSequences())) {
|
if (CollectionUtils.isNotEmpty(entityPositionSequence.getSequences())) {
|
||||||
List<Rectangle> rectanglesPerline = getRectanglesPerLine(entityPositionSequence.getSequences()
|
List<Rectangle> rectanglesPerLine = getRectanglesPerLine(entityPositionSequence.getSequences()
|
||||||
.stream()
|
.stream()
|
||||||
.flatMap(seq -> seq.getTextPositions().stream())
|
.flatMap(seq -> seq.getTextPositions().stream())
|
||||||
.collect(Collectors.toList()), page);
|
.collect(Collectors.toList()), page);
|
||||||
|
|
||||||
redactionLogEntry.getPositions().addAll(rectanglesPerline);
|
redactionLogEntry.getPositions().addAll(rectanglesPerLine);
|
||||||
annotations.addAll(createAnnotation(rectanglesPerline, prefixId(entity, entityPositionSequence.getId(), requestedToRemove, removeFromDictionary), createAnnotationContent(entity), getColor(entity, requestedToRemove), comments, !isHint(entity)));
|
annotations.addAll(createAnnotation(rectanglesPerLine, prefixId(entity, entityPositionSequence.getId(), requestedToRemove, removeFromDictionary), createAnnotationContent(entity), getColor(entity, requestedToRemove), comments, !isHint(entity)));
|
||||||
}
|
}
|
||||||
|
|
||||||
redactionLogEntry.setId(entityPositionSequence.getId());
|
redactionLogEntry.setId(entityPositionSequence.getId());
|
||||||
@ -238,7 +238,7 @@ public class AnnotationHighlightService {
|
|||||||
if (manualRedactionEntry.isAddToDictionary()) {
|
if (manualRedactionEntry.isAddToDictionary()) {
|
||||||
return "request:add:" + manualRedactionEntry.getType() + ":" + id;
|
return "request:add:" + manualRedactionEntry.getType() + ":" + id;
|
||||||
}
|
}
|
||||||
return "request:add:only_here" + ":" + id;
|
return "request:add:only_here:" + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "ignore:" + manualRedactionEntry.getType() + ":" + id;
|
return "ignore:" + manualRedactionEntry.getType() + ":" + id;
|
||||||
@ -316,14 +316,14 @@ public class AnnotationHighlightService {
|
|||||||
|
|
||||||
private String createAnnotationContent(Entity entity) {
|
private String createAnnotationContent(Entity entity) {
|
||||||
|
|
||||||
return "\nRule " + entity.getMatchedRule() + " matched" + "\n\n" + entity.getRedactionReason() + "\n\nIn " + "Section : \"" + entity
|
return "\nRule " + entity.getMatchedRule() + " matched\n\n" + entity.getRedactionReason() + "\n\nLegal basis:"
|
||||||
.getHeadline() + "\"";
|
+ entity.getLegalBasis() + "\n\nIn section: \"" + entity.getHeadline() + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String createAnnotationContent(ManualRedactionEntry entry) {
|
private String createAnnotationContent(ManualRedactionEntry entry) {
|
||||||
|
|
||||||
return "\nManual Redaction" + "\n\nIn Section : \"" + entry.getSection() + "\"";
|
return "\nManual Redaction\n\nIn Section : \"" + entry.getSection() + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -238,21 +238,32 @@ public class EntityRedactionServiceTest {
|
|||||||
" when\n" +
|
" when\n" +
|
||||||
" eval(section.headlineContainsWord(\"applicant\") || section.getText().contains(\"Applicant\"));\n" +
|
" eval(section.headlineContainsWord(\"applicant\") || section.getText().contains(\"Applicant\"));\n" +
|
||||||
" then\n" +
|
" then\n" +
|
||||||
" section.redactLineAfter(\"Name:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"Name:\", \"address\", 6, \"Applicant information was found\", \"Reg" +
|
||||||
" section.redactBetween(\"Address:\", \"Contact\", \"address\", 6, \"Applicant information was found\");\n" +
|
" (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactLineAfter(\"Contact point:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactBetween(\"Address:\", \"Contact\", \"address\", 6, \"Applicant information was found\", \"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactLineAfter(\"Phone:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"Contact point:\", \"address\", 6, \"Applicant information was found\", \"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactLineAfter(\"Fax:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"Phone:\", \"address\", 6, \"Applicant information was found\", " +
|
||||||
" section.redactLineAfter(\"Tel.:\", \"address\", 6, \"Applicant information was found\");\n" +
|
"\"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactLineAfter(\"Tel:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"Fax:\", \"address\", 6, \"Applicant information was found\", \"Reg " +
|
||||||
" section.redactLineAfter(\"E-mail:\", \"address\", 6, \"Applicant information was found\");\n" +
|
"(EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactLineAfter(\"Email:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"Tel.:\", \"address\", 6, \"Applicant information was found\", \"Reg" +
|
||||||
" section.redactLineAfter(\"Contact:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactLineAfter(\"Telephone number:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"Tel:\", \"address\", 6, \"Applicant information was found\", \"Reg " +
|
||||||
" section.redactLineAfter(\"Fax number:\", \"address\", 6, \"Applicant information was found\");\n" +
|
"(EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactLineAfter(\"Telephone:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"E-mail:\", \"address\", 6, \"Applicant information was found\", " +
|
||||||
" section.redactBetween(\"No:\", \"Fax\", \"address\", 6, \"Applicant information was found\");\n" +
|
"\"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redactBetween(\"Contact:\", \"Tel.:\", \"address\", 6, \"Applicant information was found\");\n" +
|
" section.redactLineAfter(\"Email:\", \"address\", 6, \"Applicant information was found\", " +
|
||||||
|
"\"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
|
" section.redactLineAfter(\"Contact:\", \"address\", 6, \"Applicant information was found\", " +
|
||||||
|
"\"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
|
" section.redactLineAfter(\"Telephone number:\", \"address\", 6, \"Applicant information was found\", \"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
|
" section.redactLineAfter(\"Fax number:\", \"address\", 6, \"Applicant information was found\"," +
|
||||||
|
" \"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
|
" section.redactLineAfter(\"Telephone:\", \"address\", 6, \"Applicant information was found\", " +
|
||||||
|
"\"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
|
" section.redactBetween(\"No:\", \"Fax\", \"address\", 6, \"Applicant information was found\", " +
|
||||||
|
"\"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
|
" section.redactBetween(\"Contact:\", \"Tel.:\", \"address\", 6, \"Applicant information was found\", \"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" end";
|
" end";
|
||||||
when(rulesClient.getVersion()).thenReturn(RULES_VERSION.incrementAndGet());
|
when(rulesClient.getVersion()).thenReturn(RULES_VERSION.incrementAndGet());
|
||||||
when(rulesClient.getRules()).thenReturn(new RulesResponse(tableRules));
|
when(rulesClient.getRules()).thenReturn(new RulesResponse(tableRules));
|
||||||
@ -372,8 +383,9 @@ public class EntityRedactionServiceTest {
|
|||||||
" Section(rowEquals(\"Vertebrate study Y/N\", \"Y\") || rowEquals(\"Vertebrate study Y/N\", " +
|
" Section(rowEquals(\"Vertebrate study Y/N\", \"Y\") || rowEquals(\"Vertebrate study Y/N\", " +
|
||||||
"\"Yes\"))\n" +
|
"\"Yes\"))\n" +
|
||||||
" then\n" +
|
" then\n" +
|
||||||
" section.redactCell(\"Author(s)\", 9, \"name\", \"Redacted because row is a vertebrate study\");\n" +
|
" section.redactCell(\"Author(s)\", 9, \"name\", \"Redacted because row is a vertebrate study\", \"Reg (EC) No 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.redact(\"address\", 9, \"Redacted because row is a vertebrate study\");\n" +
|
" section.redact(\"address\", 9, \"Redacted because row is a vertebrate study\", \"Reg (EC) No" +
|
||||||
|
" 1107/2009 Art. 63 (2g)\");\n" +
|
||||||
" section.highlightCell(\"Vertebrate study Y/N\", 9, \"must_redact\");\n" +
|
" section.highlightCell(\"Vertebrate study Y/N\", 9, \"must_redact\");\n" +
|
||||||
" end";
|
" end";
|
||||||
when(rulesClient.getVersion()).thenReturn(RULES_VERSION.incrementAndGet());
|
when(rulesClient.getVersion()).thenReturn(RULES_VERSION.incrementAndGet());
|
||||||
|
|||||||
@ -9,8 +9,8 @@ rule "1: Redacted because Section contains Vertebrate"
|
|||||||
when
|
when
|
||||||
Section(matchesType("vertebrate"))
|
Section(matchesType("vertebrate"))
|
||||||
then
|
then
|
||||||
section.redact("name", 1, "Redacted because Section contains Vertebrate");
|
section.redact("name", 1, "Redacted because Section contains Vertebrate", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redact("address", 1, "Redacted because Section contains Vertebrate");
|
section.redact("address", 1, "Redacted because Section contains Vertebrate", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -36,8 +36,8 @@ rule "4: Redact Names and Addresses if no_redaction_indicator and redaction_indi
|
|||||||
when
|
when
|
||||||
Section(matchesType("vertebrate"), matchesType("no_redaction_indicator"), matchesType("redaction_indicator"))
|
Section(matchesType("vertebrate"), matchesType("no_redaction_indicator"), matchesType("redaction_indicator"))
|
||||||
then
|
then
|
||||||
section.redact("name", 4, "Vertebrate was found and no_redaction_indicator and redaction_indicator");
|
section.redact("name", 4, "Vertebrate was found and no_redaction_indicator and redaction_indicator", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redact("address", 4, "Vertebrate was found and no_redaction_indicator and redaction_indicator");
|
section.redact("address", 4, "Vertebrate was found and no_redaction_indicator and redaction_indicator", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -54,26 +54,26 @@ rule "6: Redact contact information if applicant is found"
|
|||||||
when
|
when
|
||||||
Section(headlineContainsWord("applicant") || text.contains("Applicant") || headlineContainsWord("Primary contact") || headlineContainsWord("Alternative contact"))
|
Section(headlineContainsWord("applicant") || text.contains("Applicant") || headlineContainsWord("Primary contact") || headlineContainsWord("Alternative contact"))
|
||||||
then
|
then
|
||||||
section.redactLineAfter("Name:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Name:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("Address:", "Contact", "address", 6, "Applicant information was found");
|
section.redactBetween("Address:", "Contact", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Contact point:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Contact point:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Phone:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Phone:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Fax:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Fax:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Tel.:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Tel.:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Tel:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Tel:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("E-mail:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("E-mail:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Email:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Email:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("e-mail:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("e-mail:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("E-mail address:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("E-mail address:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Contact:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Contact:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Alternative contact:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Alternative contact:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Telephone number:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Telephone number:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Telephone No:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Telephone No:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Fax number:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Fax number:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Telephone:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Telephone:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Company:", "address", 6, "Applicant information was found");
|
section.redactLineAfter("Company:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("No:", "Fax", "address", 6, "Applicant information was found");
|
section.redactBetween("No:", "Fax", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("Contact:", "Tel.:", "address", 6, "Applicant information was found");
|
section.redactBetween("Contact:", "Tel.:", "address", 6, "Applicant information was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -81,20 +81,20 @@ rule "7: Redact contact information if Producer is found"
|
|||||||
when
|
when
|
||||||
Section(text.toLowerCase().contains("producer of the plant protection") || text.toLowerCase().contains("producer of the active substance") || text.contains("Manufacturer of the active substance") || text.contains("Manufacturer:") || text.contains("Producer or producers of the active substance"))
|
Section(text.toLowerCase().contains("producer of the plant protection") || text.toLowerCase().contains("producer of the active substance") || text.contains("Manufacturer of the active substance") || text.contains("Manufacturer:") || text.contains("Producer or producers of the active substance"))
|
||||||
then
|
then
|
||||||
section.redactLineAfter("Name:", "address", 7, "Producer was found");
|
section.redactLineAfter("Name:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("Address:", "Contact", "address", 7, "Producer was found");
|
section.redactBetween("Address:", "Contact", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("Contact:", "Phone", "address", 7, "Producer was found");
|
section.redactBetween("Contact:", "Phone", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("Contact:", "Telephone number:", "address", 7, "Producer was found");
|
section.redactBetween("Contact:", "Telephone number:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("Address:", "Manufacturing", "address", 7, "Producer was found");
|
section.redactBetween("Address:", "Manufacturing", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Telephone:", "address", 7, "Producer was found");
|
section.redactLineAfter("Telephone:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Phone:", "address", 7, "Producer was found");
|
section.redactLineAfter("Phone:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Fax:", "address", 7, "Producer was found");
|
section.redactLineAfter("Fax:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("E-mail:", "address", 7, "Producer was found");
|
section.redactLineAfter("E-mail:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Contact:", "address", 7, "Producer was found");
|
section.redactLineAfter("Contact:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Fax number:", "address", 7, "Producer was found");
|
section.redactLineAfter("Fax number:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Telephone number:", "address", 7, "Producer was found");
|
section.redactLineAfter("Telephone number:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactLineAfter("Tel:", "address", 7, "Producer was found");
|
section.redactLineAfter("Tel:", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redactBetween("No:", "Fax", "address", 7, "Producer was found");
|
section.redactBetween("No:", "Fax", "address", 7, "Producer was found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -112,8 +112,8 @@ rule "9: Redact if must redact entry is found"
|
|||||||
when
|
when
|
||||||
Section(matchesType("must_redact"))
|
Section(matchesType("must_redact"))
|
||||||
then
|
then
|
||||||
section.redact("name", 9, "must_redact entry was found.");
|
section.redact("name", 9, "must_redact entry was found.", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redact("address", 9, "must_redact entry was found.");
|
section.redact("address", 9, "must_redact entry was found.", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -121,14 +121,15 @@ rule "10: Redact Authors and Addresses in Reference Table if it is a Vertebrate
|
|||||||
when
|
when
|
||||||
Section(rowEquals("Vertebrate study Y/N", "Y") || rowEquals("Vertebrate study Y/N", "Yes"))
|
Section(rowEquals("Vertebrate study Y/N", "Y") || rowEquals("Vertebrate study Y/N", "Yes"))
|
||||||
then
|
then
|
||||||
section.redactCell("Author(s)", 10, "name", "Redacted because row is a vertebrate study");
|
section.redactCell("Author(s)", 10, "name", "Redacted because row is a vertebrate study", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redact("address", 10, "Redacted because row is a vertebrate study");
|
section.redact("address", 10, "Redacted because row is a vertebrate study", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.highlightCell("Vertebrate study Y/N", 10, "must_redact");
|
section.highlightCell("Vertebrate study Y/N", 10, "must_redact");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
rule "11: Redact sponsor company"
|
rule "11: Redact sponsor company"
|
||||||
when
|
when
|
||||||
Section(text.toLowerCase().contains("batches produced at"))
|
Section(text.toLowerCase().contains("batches produced at"))
|
||||||
then
|
then
|
||||||
section.redactIfPrecededBy("batches produced at", "sponsor", 11, "Redacted because it represents a sponsor company");
|
section.redactIfPrecededBy("batches produced at", "sponsor", 11, "Redacted because it represents a sponsor company", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
end
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user