DM-305: Improved DocuMine rules

This commit is contained in:
deiflaender 2023-07-14 12:26:06 +02:00
parent c5668b738d
commit 18979d0f33

View File

@ -329,20 +329,17 @@ rule "DOC.7.0: study title by document structure"
end
//rule "DOC.7.0: study title"
// when
// $section: Section(isOnPage(1) && (containsString("Final Report") || containsString("SPL")))
// then
// entityCreationService.byRegexWithLineBreaks("(?<=\\n)[\\w\\W]{1,300}(?=\\nFinal Report)", "title", EntityType.ENTITY, $section).findFirst().ifPresent(entity -> {
// entity.apply("DOC.7.0", "Title found", "n-a");
// });
// entityCreationService.betweenStrings("TITLE", "DATA REQUIREMENT", "title", EntityType.ENTITY, $section).findFirst().ifPresent(entity -> {
// entity.apply("DOC.7.0", "Title found", "n-a");
// });
// entityCreationService.betweenStrings("Laboratories", "SPL", "title", EntityType.ENTITY, $section).findFirst().ifPresent(entity -> {
// entity.apply("DOC.7.0", "Title found", "n-a");
// });
// end
rule "DOC.7.1: study title"
when
$table: Table(isOnPage(1),
(containsString("Final Report") || containsString("SPL")),
numberOfRows == 1,
numberOfCols == 1)
then
entityCreationService.byRegexWithLineBreaksIgnoreCase("(?<=\\n)[\\w\\W]{1,300}(?=\\nFinal Report)", "title", EntityType.ENTITY, $table.getCell(0, 0)).findFirst().ifPresent(entity -> {
entity.apply("DOC.7.1", "Title found", "n-a");
});
end
rule "DOC.8.1: Performing Laboratory (Name)"
@ -574,7 +571,7 @@ rule "DOC.12.0: Guideline Deviation"
entityCreationService.byRegexIgnoreCase("(?>Study plan adherence)(.{1,20}deviations.{1,20} to the study plan.{0,50}\\.)\\s", "guideline_deviation", EntityType.ENTITY, 1, $section).forEach(entity -> {
entity.apply("DOC.12.0", "Guideline deviation found in text.", "n-a");
});
entityCreationService.betweenStrings("Deviations from the study plan", "validity of the study.", "guideline_deviation", EntityType.ENTITY, $section).forEach(entity -> {
entityCreationService.betweenStringsIncludeEnd("Deviations from the study plan", "validity of the study.", "guideline_deviation", EntityType.ENTITY, $section).forEach(entity -> {
entity.apply("DOC.12.0", "Deviation from the study plan found", "n-a");
});
end
@ -837,6 +834,18 @@ rule "DOC.24.0: Study Design"
.forEach(entity -> entity.apply("DOC.24.0", "Study design section found", "n-a"));
end
rule "DOC.24.1: Study Design"
when
Headline(containsStringIgnoreCase("Study Design"), $sectionIdentifier: getSectionIdentifier())
$headline: Headline(getSectionIdentifier().isChildOf($sectionIdentifier))
then
entityCreationService.bySemanticNodeParagraphsOnly($headline.getParent(), "study_design", EntityType.ENTITY)
.forEach(entity -> {
entity.apply("DOC.24.1", "Study design section found", "n-a");
});
end
/*
rule "DOC.24.0: Study Design"
when
@ -924,6 +933,17 @@ rule "DOC.33.0: Test Results (429)"
.forEach(entity -> entity.apply("DOC.33.0", "Test Results found", "n-a"));
end
rule "DOC.33.1: Test Results (429)"
when
Headline(containsStringIgnoreCase("RESULTS AND DISCUSSION"), $sectionIdentifierResultsAndDiscussion: getSectionIdentifier())
$headline: Headline(getSectionIdentifier().isChildOf($sectionIdentifierResultsAndDiscussion))
then
entityCreationService.bySemanticNodeParagraphsOnly($headline.getParent(), "test_results", EntityType.ENTITY)
.forEach(entity -> {
entity.apply("DOC.33.1", "Test Results found", "n-a");
});
end
rule "DOC.34.0: Approach used (429)"
when