Skip to content

Commit

Permalink
small revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
pnrobinson committed Aug 24, 2023
1 parent d2ad94a commit 6d63c34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public NejmCaseReportFromPdfFilterer(String caseId, List<String> lines) {
line.startsWith("Pathological Diagnosis")){
inDifferentialDiagnosis = true;
} else if (caseId.equalsIgnoreCase("PMID:33730458") &&
line.startsWith("Pathological Discussion")){
line.startsWith("Pathological Discussion")) {
inDifferentialDiagnosis = true;
} else if (caseId.equals("PMID:34437787") && line.startsWith("Dr. Andrew M. Crabbe")) {
inDifferentialDiagnosis = true;
} else {
if (inCase && ! inDifferentialDiagnosis) {
Expand All @@ -133,6 +135,9 @@ public NejmCaseReportFromPdfFilterer(String caseId, List<String> lines) {
} else if (line.strip().startsWith("Final Diagnosis")) {
inActualDiagnosis = true;
diagnosis = lines.get(index+1);
} else if (line.strip().startsWith("Anatomical Diagnosis")) {
inActualDiagnosis = true;
diagnosis = lines.get(index+1);
}


Expand All @@ -159,7 +164,7 @@ public NejmCaseReportFromPdfFilterer(String caseId, List<String> lines) {
int start=-1;
int end=-1;
while(matcher.find()) {
n_matched++;
n_matched++;
if (n_matched==1){
start = matcher.end()+1;
} else if (n_matched==2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TimePointParser {
private final Pattern pattern9 = Pattern.compile("After a \\b\\w+\\b[ -](weeks?|days?|months?|years?) admission",Pattern.CASE_INSENSITIVE);
private final Pattern pattern10 = Pattern.compile("On admission to (the other|another) hospital",Pattern.CASE_INSENSITIVE);
private final Pattern pattern11 = Pattern.compile("Over the next \\b\\w+\\b (hours?|days?|weeks?|months?|years?)",Pattern.CASE_INSENSITIVE);

private final Pattern pattern12 = Pattern.compile("3.5 years before the current evaluation");

/** Note we do all searching in lower case */
private final Set<String> fixedPatterns = Set.of("in the emergency department", "on examination", "in childhood", "examination was notable for",
Expand All @@ -55,7 +55,7 @@ public TimePointParser() {
patternList.add(pattern8);
patternList.add(pattern9);
patternList.add(pattern10);
// patternList.add(pattern11);
patternList.add(pattern12);

}

Expand Down

0 comments on commit 6d63c34

Please sign in to comment.