RED-6009: Document Tree Structure
* ignore wrong pmd vioaltions
This commit is contained in:
parent
0dc17d86bd
commit
926d507583
@ -55,6 +55,7 @@ public class TableNodeFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("PMD.UnusedPrivateMethod") // PMD actually flags this wrong
|
||||||
private static void addTableToPage(Page page, SemanticNode parentNode, Table table) {
|
private static void addTableToPage(Page page, SemanticNode parentNode, Table table) {
|
||||||
|
|
||||||
if (!page.getMainBody().contains(parentNode)) {
|
if (!page.getMainBody().contains(parentNode)) {
|
||||||
|
|||||||
@ -67,6 +67,7 @@ public class DocumentTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("PMD.UnusedPrivateMethod") // PMD actually flags this wrong
|
||||||
private List<Integer> createNewChildEntryAndReturnIdImpl(List<Integer> parentId, NodeType nodeType, SemanticNode node) {
|
private List<Integer> createNewChildEntryAndReturnIdImpl(List<Integer> parentId, NodeType nodeType, SemanticNode node) {
|
||||||
|
|
||||||
if (!entryExists(parentId)) {
|
if (!entryExists(parentId)) {
|
||||||
|
|||||||
@ -334,6 +334,7 @@ rule "22: Redact Emails by RegEx (vertebrate study)"
|
|||||||
entityCreationService.byRegex("\\b([A-Za-z0-9._%+\\-]+@[A-Za-z0-9.\\-]+\\.[A-Za-z\\-]{1,23}[A-Za-z])\\b", "PII", EntityType.ENTITY, 1, $section)
|
entityCreationService.byRegex("\\b([A-Za-z0-9._%+\\-]+@[A-Za-z0-9.\\-]+\\.[A-Za-z\\-]{1,23}[A-Za-z])\\b", "PII", EntityType.ENTITY, 1, $section)
|
||||||
.forEach(emailEntity -> {
|
.forEach(emailEntity -> {
|
||||||
emailEntity.setRedaction(true);
|
emailEntity.setRedaction(true);
|
||||||
|
emailEntity.addEngine(Engine.RULE);
|
||||||
emailEntity.setRedactionReason("Found by Email Regex");
|
emailEntity.setRedactionReason("Found by Email Regex");
|
||||||
emailEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
emailEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
||||||
emailEntity.addMatchedRule(22);
|
emailEntity.addMatchedRule(22);
|
||||||
@ -358,6 +359,7 @@ rule "25: Redact Phone and Fax by RegEx (non vertebrate study)"
|
|||||||
entityCreationService.byRegexIgnoreCase("\\b(contact|telephone|phone|ph\\.|fax|tel|ter|mobile|fel|fer)[a-zA-Z\\s]{0,10}[:.\\s]{0,3}([\\+\\d\\(][\\s\\d\\(\\)\\-\\/\\.]{4,100}\\d)\\b", "PII", EntityType.ENTITY, 2, $section)
|
entityCreationService.byRegexIgnoreCase("\\b(contact|telephone|phone|ph\\.|fax|tel|ter|mobile|fel|fer)[a-zA-Z\\s]{0,10}[:.\\s]{0,3}([\\+\\d\\(][\\s\\d\\(\\)\\-\\/\\.]{4,100}\\d)\\b", "PII", EntityType.ENTITY, 2, $section)
|
||||||
.forEach(contactEntity -> {
|
.forEach(contactEntity -> {
|
||||||
contactEntity.setRedaction(true);
|
contactEntity.setRedaction(true);
|
||||||
|
contactEntity.addEngine(Engine.RULE);
|
||||||
contactEntity.setRedactionReason("Found by Email Regex");
|
contactEntity.setRedactionReason("Found by Email Regex");
|
||||||
contactEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
contactEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
||||||
contactEntity.addMatchedRule(25);
|
contactEntity.addMatchedRule(25);
|
||||||
@ -382,6 +384,7 @@ rule "26: Redact Phone and Fax by RegEx (vertebrate study)"
|
|||||||
entityCreationService.byRegexIgnoreCase("\\b(contact|telephone|phone|ph\\.|fax|tel|ter|mobile|fel|fer)[a-zA-Z\\s]{0,10}[:.\\s]{0,3}([\\+\\d\\(][\\s\\d\\(\\)\\-\\/\\.]{4,100}\\d)\\b", "PII", EntityType.ENTITY, 2, $section)
|
entityCreationService.byRegexIgnoreCase("\\b(contact|telephone|phone|ph\\.|fax|tel|ter|mobile|fel|fer)[a-zA-Z\\s]{0,10}[:.\\s]{0,3}([\\+\\d\\(][\\s\\d\\(\\)\\-\\/\\.]{4,100}\\d)\\b", "PII", EntityType.ENTITY, 2, $section)
|
||||||
.forEach(contactEntity -> {
|
.forEach(contactEntity -> {
|
||||||
contactEntity.setRedaction(true);
|
contactEntity.setRedaction(true);
|
||||||
|
contactEntity.addEngine(Engine.RULE);
|
||||||
contactEntity.setRedactionReason("Found by Email Regex");
|
contactEntity.setRedactionReason("Found by Email Regex");
|
||||||
contactEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
contactEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
||||||
contactEntity.addMatchedRule(26);
|
contactEntity.addMatchedRule(26);
|
||||||
@ -399,6 +402,7 @@ rule "27: Redact AUTHOR(S) (non vertebrate study)"
|
|||||||
.forEach(authorEntity -> {
|
.forEach(authorEntity -> {
|
||||||
authorEntity.setRedaction(true);
|
authorEntity.setRedaction(true);
|
||||||
authorEntity.addMatchedRule(27);
|
authorEntity.addMatchedRule(27);
|
||||||
|
authorEntity.addEngine(Engine.RULE);
|
||||||
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
||||||
authorEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
authorEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
||||||
insert(authorEntity);
|
insert(authorEntity);
|
||||||
@ -414,6 +418,7 @@ rule "28: Redact AUTHOR(S) (vertebrate study)"
|
|||||||
.forEach(authorEntity -> {
|
.forEach(authorEntity -> {
|
||||||
authorEntity.setRedaction(true);
|
authorEntity.setRedaction(true);
|
||||||
authorEntity.addMatchedRule(28);
|
authorEntity.addMatchedRule(28);
|
||||||
|
authorEntity.addEngine(Engine.RULE);
|
||||||
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
||||||
authorEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
authorEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
||||||
insert(authorEntity);
|
insert(authorEntity);
|
||||||
@ -430,6 +435,7 @@ rule "29: Redact AUTHOR(S) (non vertebrate study)"
|
|||||||
.forEach(authorEntity -> {
|
.forEach(authorEntity -> {
|
||||||
authorEntity.setRedaction(true);
|
authorEntity.setRedaction(true);
|
||||||
authorEntity.addMatchedRule(29);
|
authorEntity.addMatchedRule(29);
|
||||||
|
authorEntity.addEngine(Engine.RULE);
|
||||||
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
||||||
authorEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
authorEntity.setLegalBasis("Article 39(e)(3) of Regulation (EC) No 178/2002");
|
||||||
insert(authorEntity);
|
insert(authorEntity);
|
||||||
@ -445,6 +451,7 @@ rule "30: Redact AUTHOR(S) (vertebrate study)"
|
|||||||
.forEach(authorEntity -> {
|
.forEach(authorEntity -> {
|
||||||
authorEntity.setRedaction(true);
|
authorEntity.setRedaction(true);
|
||||||
authorEntity.addMatchedRule(30);
|
authorEntity.addMatchedRule(30);
|
||||||
|
authorEntity.addEngine(Engine.RULE);
|
||||||
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
authorEntity.setRedactionReason("AUTHOR(S) was found");
|
||||||
authorEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
authorEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
||||||
insert(authorEntity);
|
insert(authorEntity);
|
||||||
@ -461,6 +468,7 @@ rule "31: Redact PERFORMING LABORATORY (Non vertebrate study)"
|
|||||||
.forEach(laboratoryEntity -> {
|
.forEach(laboratoryEntity -> {
|
||||||
laboratoryEntity.setRedaction(false);
|
laboratoryEntity.setRedaction(false);
|
||||||
laboratoryEntity.addMatchedRule(31);
|
laboratoryEntity.addMatchedRule(31);
|
||||||
|
laboratoryEntity.addEngine(Engine.RULE);
|
||||||
laboratoryEntity.setRedactionReason("PERFORMING LABORATORY was found for non vertebrate study");
|
laboratoryEntity.setRedactionReason("PERFORMING LABORATORY was found for non vertebrate study");
|
||||||
dictionary.addLocalDictionaryEntry(laboratoryEntity);
|
dictionary.addLocalDictionaryEntry(laboratoryEntity);
|
||||||
insert(laboratoryEntity);
|
insert(laboratoryEntity);
|
||||||
@ -477,6 +485,7 @@ rule "32: Redact PERFORMING LABORATORY (Vertebrate study)"
|
|||||||
.forEach(laboratoryEntity -> {
|
.forEach(laboratoryEntity -> {
|
||||||
laboratoryEntity.setRedaction(true);
|
laboratoryEntity.setRedaction(true);
|
||||||
laboratoryEntity.addMatchedRule(32);
|
laboratoryEntity.addMatchedRule(32);
|
||||||
|
laboratoryEntity.addEngine(Engine.RULE);
|
||||||
laboratoryEntity.setRedactionReason("PERFORMING LABORATORY was found");
|
laboratoryEntity.setRedactionReason("PERFORMING LABORATORY was found");
|
||||||
laboratoryEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
laboratoryEntity.setLegalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002");
|
||||||
dictionary.addLocalDictionaryEntry(laboratoryEntity);
|
dictionary.addLocalDictionaryEntry(laboratoryEntity);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user