You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by se...@apache.org on 2022/11/21 17:50:20 UTC

svn commit: r1905443 [1/2] - in /ctakes/trunk: ./ ctakes-assertion/ ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/ ctakes-core/desc/analysis_engine/ ctakes-core/src/main/java/org/apache/ctakes/core/util/external/ ctakes-dictionary-...

Author: seanfinan
Date: Mon Nov 21 17:50:20 2022
New Revision: 1905443

URL: http://svn.apache.org/viewvc?rev=1905443&view=rev
Log:
ctakes .gitignore added output/ directory that some people create
ctakes-assertion pom removed redundant jackson-core-asl dependency declaration
ctakes-assertion pom specify gson version
ctakes-core SystemUtil force set of JAVA_HOME for launched processes
ctakes-core add desc xmls written per user request
ctakes-core-res add section delimiter definition bsv files written per user request 
ctakes-dictionary-fast CasedAnnotationFinder added TODO items
ctakes-dictionary-fast LookupToken corrected javadoc
ctakes-examples  > Added a bunch of examples originally created but not used for ApacheCon 2020
ctakes-examples pom specify version for junit-jupiter
ctakes-examples-res add notes written for ApacheCon 2020
ctakes-smoking-status UimaFit version of PcsClassifier
ctakes-ytex-web updated resource placement to be done with maven-resources plugin
ctakes-gui add GenericRunner as baseline for future development

Added:
    ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/NaaccrXmlSections.bsv
    ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/SameLineSectionRegex.bsv
    ctakes/trunk/ctakes-core/desc/analysis_engine/BsvRegexSectionizer.xml
    ctakes/trunk/ctakes-core/desc/analysis_engine/SectionFilter.xml
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Adult/
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Adult/snake_bite.txt
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/CasedExample.txt
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Pediatric/
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Pediatric/shark_bite.txt
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_1
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_2
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/VascSurg_RO_DVT_1
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_25122019_RAD.txt
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122018_PATH.txt
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122019_NOTE.txt
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/AdvancedClinicalToFhir.piper
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemo.piper
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoBasic.piper
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoRelation.piper
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoSection.piper
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/Cased2020aa.piper
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/FhirToOutput.piper
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ApacheConDemoEngine.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConAnnotationWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConCorefWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConDemoWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConLocationWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConParagraphWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSectionWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSentenceWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConTlinkWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/FileTreeViewXmiWriter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/TokenPrinter.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cr/
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cr/ApacheConDemoReader.java
    ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cr/LetterColumnReader.java
    ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/generic/
    ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/generic/GenericRunnerGui.java
    ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/generic/MainPanel.java
    ctakes/trunk/ctakes-smoking-status/data/Deprecated.txt
    ctakes/trunk/ctakes-smoking-status/src/main/java/org/apache/ctakes/smokingstatus/ae/PcsClassifier.java
Modified:
    ctakes/trunk/.gitignore
    ctakes/trunk/ctakes-assertion/pom.xml
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java
    ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/ae/CasedAnnotationFinder.java
    ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/lookup/LookupToken.java
    ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/XmiToPretty.piper
    ctakes/trunk/ctakes-examples/pom.xml
    ctakes/trunk/ctakes-ytex-web/pom.xml

Modified: ctakes/trunk/.gitignore
URL: http://svn.apache.org/viewvc/ctakes/trunk/.gitignore?rev=1905443&r1=1905442&r2=1905443&view=diff
==============================================================================
--- ctakes/trunk/.gitignore (original)
+++ ctakes/trunk/.gitignore Mon Nov 21 17:50:20 2022
@@ -26,3 +26,6 @@ Thumbs.db
 
 # OSX
 .DS_Store
+
+# Lazy testing
+output/

Modified: ctakes/trunk/ctakes-assertion/pom.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/pom.xml?rev=1905443&r1=1905442&r2=1905443&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/pom.xml (original)
+++ ctakes/trunk/ctakes-assertion/pom.xml Mon Nov 21 17:50:20 2022
@@ -102,18 +102,19 @@
         <!--</dependency>-->
 		<dependency>
 			<groupId>org.springframework</groupId>
-			<artifactId>spring-core</artifactId>			
+			<artifactId>spring-core</artifactId>
 		</dependency>
 		<!-- we excluded spring-context uimafit transitive dependency in the parent pom, include it here -->
 		<dependency>
 			<groupId>org.springframework</groupId>
-			<artifactId>spring-context</artifactId>			
+			<artifactId>spring-context</artifactId>
 		</dependency>
 
-		<dependency>
-			<groupId>org.codehaus.jackson</groupId>
-			<artifactId>jackson-core-asl</artifactId>
-		</dependency>
+		<!--		jackson-core-asl is added by jackson-mapper-asl -->
+		<!--		<dependency>-->
+		<!--			<groupId>org.codehaus.jackson</groupId>-->
+		<!--			<artifactId>jackson-core-asl</artifactId>-->
+		<!--		</dependency>-->
 		<dependency>
 			<groupId>org.codehaus.jackson</groupId>
 			<artifactId>jackson-mapper-asl</artifactId>
@@ -123,7 +124,7 @@
 			<groupId>org.scala-tools.sbinary</groupId>
 			<artifactId>sbinary_2.9.0</artifactId>
 		</dependency>
-        <!--  LVG added by dependency parser.  -->
+		<!--  LVG added by dependency parser.  -->
         <!--<dependency>-->
         <!--<groupId>org.apache.ctakes</groupId>-->
         <!--<artifactId>ctakes-lvg</artifactId>-->
@@ -154,7 +155,8 @@
 		<dependency>
 			<groupId>com.google.code.gson</groupId>
 			<artifactId>gson</artifactId>
-			<version>RELEASE</version>
+			<!--			<version>RELEASE</version>-->
+			<version>2.8.9</version>
 			<scope>compile</scope>
 		</dependency>
 	</dependencies>

Added: ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/NaaccrXmlSections.bsv
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/NaaccrXmlSections.bsv?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/NaaccrXmlSections.bsv (added)
+++ ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/NaaccrXmlSections.bsv Mon Nov 21 17:50:20 2022
@@ -0,0 +1,7 @@
+textPathFullText||^[\t ]*<Item naaccrId="textPathFullText">||<\/Item>
+textPathFormalDx||^[\t ]*<Item naaccrId="textPathFormalDx">||<\/Item>
+textPathClinicalHistory||^[\t ]*<Item naaccrId="textPathClinicalHistory">||<\/Item>
+textDxProcPath||^[\t ]*<Item naaccrId="textDxProcPath">||<\/Item>
+textPrimarySiteTitle||^[\t ]*<Item naaccrId="textPrimarySiteTitle">||<\/Item>
+textHistologyTitle||^[\t ]*<Item naaccrId="textHistologyTitle">||<\/Item>
+textStaging||^[\t ]*<Item naaccrId="textStaging">||<\/Item>

Added: ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/SameLineSectionRegex.bsv
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/SameLineSectionRegex.bsv?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/SameLineSectionRegex.bsv (added)
+++ ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sections/SameLineSectionRegex.bsv Mon Nov 21 17:50:20 2022
@@ -0,0 +1,89 @@
+Case Description||^[\t ]*CASE DESCRIPTION[^:]*:\s+
+History of Present Illness||^[\t ]*(?:(?:HPI\/CC:)|(?:CC\/HPI:)|(?:S:)|(?:(?:HISTORY OF (?:THE )?(?:PRESENT |PHYSICAL )?ILLNESS)(?: \(HPI(?:, PROBLEM BY PROBLEM)?\))?[\t ]*:?))\s+
+Past Medical History||^[\t ]*(?:(?:PMHX?)|(?:HISTORY OF (?:THE )?PAST ILLNESS)|(?:PAST MEDICAL HISTORY))[\t ]*:?\s+
+Chief Complaint||^[\t ]*(?:CHIEF|PRIMARY) COMPLAINTS?[\t ]*:?\s+
+Patient History||^[\t ]*(?:(?:PERSONAL|PATIENT) (?:(?:AND )?SOCIAL )?HISTORY)|(?:(?:PSYCHO)?SOC(?:IAL)? HISTORY)|(?:HISTORY (?:OF )(?:OTHER )?SOCIAL (?:FUNCTIONs?|FACTORS?))|(?:PSO)|(?:P?SHX)|(?:SOCHX)|(?:HISTORY:)[\t ]*:?\s+
+Review of Systems||^[\t ]*(?:(?:ROS:)|(?:(?:REVIEW (?:OF )?SYSTEMS?)|(?:SYSTEMS? REVIEW)[\t ]*:?))\s+
+Family Medical History||^[\t ]*(?:FAMILY (?:MEDICAL )?HISTORY)|(?:HISTORY (?:OF )?FAMILY MEMBER DISEASES?)|(?:FAM HX)|FH|FMH|FMHX|FAMHX|FHX[\t ]*:?\s+
+Medications||^[\t ]*(?:(?:MEDS:)|(?:(?:CURRENT )?MEDICATIONS?))[\t ]*:?\s+
+Allergies||^[\t ]*ALLERGIES[\t ]*:?\s+
+General Exam||^[\t ]*(?:(?:PE:)|(?:O:)|(?:(?:REVIEW (?:OF )?)?(?:GENERAL(?: PHYSICAL)?|PHYSICAL) (?:EXAM(?:INATION)?|STATUS|APPEARANCE|CONSTITUTIONAL)S?(?: SYMPTOMS?)?[\t ]*:?))\s+
+Vital Signs||^[\t ]*(?:VITS|(?:VITAL(?:S|(?: (?:SIGNS|NOTES)))))[\t ]*:?\s+
+Identifying Data||^[\t ]*IDENTIFYING DATA[\t ]*:?\s+
+Clinical History||^[\t ]*CLINICAL HISTORY[\t ]*:?\s+
+Current Health||^[\t ]*CURRENT HEALTH(?: STATUS)?[\t ]*:?\s+
+Narrative History||^[\t ]*NARRATIVE HISTORY[\t ]*:?\s+
+Analysis of Problem||^[\t ]*(?:(?:A\/P:)|(?:ANALYSIS (?:OF )?(?:ADMIT(?:TING)? |IDENTIF(?:Y|IED) )?PROBLEMS?[\t ]*:?))\s+
+Telemetry||^[\t ]*TELE(?:METRY)?[\t ]*:?\s+
+Technical Comment||^[\t ]*TECHNICAL COMMENT[\t ]*:?\s+
+Discharge Activity||^[\t ]*DISCHARGE ACTIVITY[\t ]*:?\s+
+Occupational Environmental History||^[\t ]*OCCUPATION(?:AL)? ENVIRONMENT(?:AL)? HISTORY[\t ]*:?\s+
+Immunosuppressants Medications||^[\t ]*(?:CYTOTOXIC )?IMMUN(?:OSUPPRESSANT|IZATION)S?(?: MEDICATIONS?)?(?: ADMINISTRATION HISTORY)?[\t ]*:?\s+
+Medications Outside Hospital||^[\t ]*MEDICATIONS? (?:AT )?OUTSIDE HOSPITAL[\t ]*:?\s+
+Reason for Consult||^[\t ]*REASON (?:FOR )?(?:CONSULT(?:ATION)?|REFERRAL)(?: ?\/? ?QUESTIONS?)?[\t ]*:?\s+
+Problem List||^[\t ]*(?:SIGNIFICANT )?PROBLEMS?(?: LIST)?[\t ]*:?\s+
+Living Situation||^[\t ]*LIV(?:E|ING) SITUATION[\t ]*:?\s+
+Cytologic Diagnosis||^[\t ]*CYTOLOGIC (?:DIAGNOSIS|DX)[\t ]*:?\s+
+Discharge Instructions||^[\t ]*DISCHARGE INSTRUCTIONS?[\t ]*:?\s+
+Body Surface Area||^[\t ]*(?:(?:BODY SURFACE AREA)|BSA)[\t ]*:?\s+
+Discharge Condition||^[\t ]*(?:(?:DISCHARGE CONDITION)|(?:CONDITION (?:(?:AT|ON) )?DISCHARGE))[\t ]*:?\s+
+Diagnosis at Death||^[\t ]*(?:(?:DIAGNOSIS|DX|CAUSE) (?:AT |OF )?DEATH)|COD[\t ]*:?\s+
+Adverse Reactions||^[\t ]*(?:HISTORY (?:OF )?)?(?:(?:ALLERG(?:Y|IES)(?:(?:\/| AND )?ADVERSE REACTIONS?)?)|(?:ADVERSE REACTIONS?(?:(?:\/| AND )?ALLERG(?:Y|IES)?)?))( DISORDERS?)?(?: HISTORY)?[\t ]*:?\s+
+Emergency Department Course||^[\t ]*(?:EMERGENCY|ED) (?:DEPARTMENT|ROOM) (?:COURSE|MANAGEMENT)[\t ]*:?\s+
+Consultation Attending||^[\t ]*CONSULTATION ATTENDING[\t ]*:?\s+
+Body Length||^[\t ]*(?:BODY )?LENGTH[\t ]*:?\s+
+Past Surgical History||^[\t ]*(?:(?:SURGHX)|(?:(?:PAST|PREVIOUS|PRIOR)? ?(?:SURG(?:ERY|ICAL)?|OPERATIVE|SIGNIFICANT) (?:HISTORY|HX|PROCEDURES?)))[\t ]*:?\s+
+Height||^[\t ]*(?:HEIGHT|HT)[\t ]*:?\s+
+Principle Diagnosis||^[\t ]*(?:PRINCI(?:PLE|PAL)|MAIN|PRIMARY) (?:DIAGNOSI?E?S|DX)[\t ]*:?\s+
+Oxygen Saturation||^[\t ]*(?:OXYGEN|O2) ?SAT(?:URATION)?[\t ]*:?\s+
+Principal Procedures||^[\t ]*(?:PRINCIPAL|PRIMARY) PROCEDURES?[\t ]*:?\s+
+Psychological Stressors||^[\t ]*(?:PSYCHOLOGICAL )?STRESS(?:ORS?| LEVEL)[\t ]*:?\s+
+Pathologic Data||^[\t ]*(?:(?:BIOPS(?:Y|IES))|BX|(?:PATHOLOGIC DATA))[\t ]*:?\s+
+Medication History||^[\t ]*(?:(?:MEDICATION ?(?:TREATMENT|USE)? HISTORY)|(?:HISTORY (?:OF )?MEDICATION ?(?:TREATMENT|USE)?))[\t ]*:?\s+
+Treatment Goals||^[\t ]*(?:TREATMENT )?GOALS?[\t ]*:?\s+
+Input Fluids||^[\t ]*INPUT FLUIDS?[\t ]*:?\s+
+Admission Date||^[\t ]*ADMISSION DATE[\t ]*:?\s+
+History Source||^[\t ]*(?:HISTORY|HX) (?:SOURCES?|(?:(?:OBTAIN(?:ED)?(?: FROM)?)))[\t ]*:?\s+
+Current Pregnancy||^[\t ]*CURRENT PREGNANCY[\t ]*:?\s+
+Special Procedures||^[\t ]*SPECIAL PROCEDURES?[\t ]*:?\s+
+Operative Findings||^[\t ]*OPERATIVE FINDINGS?[\t ]*:?\s+
+Fluid Balance||^[\t ]*(?:(?:FLUID BALANCE)|(?:I(?:NPUT)? ?\/? ?O(?:UTPUT)?))[\t ]*:?\s+
+Blood Pressure||^[\t ]*(?:BLOOD PRESSURE|BP)[\t ]*:?\s+
+Post Procedure Diagnosis||^[\t ]*POST\-?(?:PROCEDURE|OP|OPERATIVE) DIAGNOSIS[\t ]*:?\s+
+Final Diagnosis||^[\t ]*FINAL DIAGNOSIS[\t ]*:?\s+
+Cancer Risk Factors||^[\t ]*CANCER RISK FACTORS?[\t ]*:?\s+
+Invasive Diagnostic Procedure History||^[\t ]*INVASIVE DIAGNOSTIC PROCEDURE HISTORY[\t ]*:?\s+
+Technique||^[\t ]*TECHNIQUE[\t ]*:?\s+
+Medications By Type||^[\t ]*MEDICATIONS? (?:BY )?TYPE[\t ]*:?\s+
+Hematologic History||^[\t ]*(?:HEME|HEMATOLOGIC) (?:HISTORY|HX)[\t ]*:?\s+
+Respiratory Rate||^[\t ]*RESP(?:IRAT(?:ORY|IONS?))?(?: RATE)?[\t ]*:?\s+
+Attending Addendum||^[\t ]*ATTENDING ADDENDUM[\t ]*:?\s+
+Gross Description||^[\t ]*GROSS DESC(?:RIPTION)?[\t ]*:?\s+
+Microscopic Description||^[\t ]*MICROSCOPIC DESC(?:RIPTION)?[\t ]*:?\s+
+Substance Abuse Treatment||^[\t ]*(?:TREATMENT (?:FOR|OF)? ?)?(?:SUBSTANCE|DRUG|ALCOHOL) (?:ABUSE|ADDICTION)(?: TREATMENT)?[\t ]*:?\s+
+Hospital Course||^[\t ]*(?:BRIEF|HISTORY|HX)? ?HOSPITAL COURSE[\t ]*:?\s+
+Histology Summary||^[\t ]*HISTO(?:LOGY)? (?:TISSUE )?SUMMARY[\t ]*:?\s+
+Addendum||^[\t ]*ADDEND(?:A|UM)[\t ]*:?\s+
+Medications at Transfer||^[\t ]*MEDICATIONS?(?: AT)? TRANSFER[\t ]*:?\s+
+Findings||^[\t ]*(?:(?:DIAGNOSTIC )?(?:INDICATIONS? ?\/? )?FINDINGS?(?: (?:AT )?SURGERY)?)|(?:INDICATIONS?:)[\t ]*:?\s+
+Instructions||^[\t ]*INSTRUCTIONS?[\t ]*:?\s+
+Current Antibiotics||^[\t ]*CURRENT ANTIBIOTICS?[\t ]*:?\s+
+Ethanol Use||^[\t ]*(?:HISTORY (?:OF )?)?(?:ALCOHOL|ETHANOL|ETOH)(?: USE)?[\t ]*:?\s+
+Maximum Temperature||^[\t ]*MAX(?:IMUM)? TEMP(?:ERATURE)?[\t ]*:?\s+
+Smoking Use||^[\t ]*(?:SMOKING|CIGAR(?:ETTE)?)(?: USE)?[\t ]*:?\s+
+Admission Condition||^[\t ]*(?:(?:CONDITION(?:ON |AT )? ADMISSION)|(?:ADMISSION CONDITION))[\t ]*:?\s+
+
+// The following are incomplete
+Other Systems Reviewed||^[\t ]*OTHER SYSTEMS REVIEWED[\t ]*:?\s+
+Objective||^[\t ]*OBJECTIVE[\t ]*:?\s+
+Impression||^[\t ]*IMPRESSION[\t ]*:?\s+
+Diagnosis||^[\t ]*DIAGNOS(?:I|E)S[\t ]*:?\s+
+Plan||^[\t ]*(?:ASSESSMENT AND )?PLAN[\t ]*:?\s+
+Labs||^[\t ]*LABS?\/(?:ANC(?:ILLARY)?|STUDIES)[\t ]*:?\s+
+Diet||^[\t ]*DIET[\t ]*:?\s+
+Vaccinations||^[\t ]*VACCINATIONS?[\t ]*:?\s+
+Past Medications||^[\t ]*PAST MEDICATIONS?[\t ]*:?\s+
+
+// The following are not clinical document sections, but allow skipping of unwanted text
+XML||\A<\?xml (?:[^>]*>)*
+Past MS Medications||^[\t ]*Past MS Medications?[\t ]*:?\s+
\ No newline at end of file

Added: ctakes/trunk/ctakes-core/desc/analysis_engine/BsvRegexSectionizer.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/desc/analysis_engine/BsvRegexSectionizer.xml?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-core/desc/analysis_engine/BsvRegexSectionizer.xml (added)
+++ ctakes/trunk/ctakes-core/desc/analysis_engine/BsvRegexSectionizer.xml Mon Nov 21 17:50:20 2022
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<taeDescription xmlns="http://uima.apache.org/resourceSpecifier">
+   <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+   <primitive>true</primitive>
+   <annotatorImplementationName>org.apache.ctakes.core.ae.BsvRegexSectionizer</annotatorImplementationName>
+   <analysisEngineMetaData>
+      <name>BsvRegexSectionizer</name>
+      <description>Annotates Document Sections by detecting Section Headers using Regular Expressions provided in a
+         Bar-Separated-Value File
+      </description>
+      <version>1.0</version>
+      <vendor></vendor>
+      <configurationParameters>
+         <configurationParameter>
+            <name>SectionsBsv</name>
+            <description>path to a BSV file containing a list of regular expressions and corresponding section types
+            </description>
+            <type>String</type>
+            <multiValued>false</multiValued>
+            <mandatory>false</mandatory>
+         </configurationParameter>
+      </configurationParameters>
+      <configurationParameterSettings>
+         <nameValuePair>
+            <name>SectionList</name>
+            <value>
+               <string>org/apache/ctakes/core/sections/DefaultSectionRegex.bsv</string>
+            </value>
+         </nameValuePair>
+      </configurationParameterSettings>
+      <!--  As far as I can tell everything that follows is superfluous  -->
+      <typeSystemDescription>
+         <imports>
+            <import name="org.apache.ctakes.typesystem.types.TypeSystem"/>
+         </imports>
+      </typeSystemDescription>
+      <typePriorities/>
+      <fsIndexCollection/>
+      <capabilities>
+         <capability>
+            <inputs/>
+            <outputs>
+               <type allAnnotatorFeatures="true">org.apache.ctakes.typesystem.type.textspan.Segment</type>
+            </outputs>
+            <languagesSupported/>
+         </capability>
+      </capabilities>
+      <operationalProperties>
+         <modifiesCas>true</modifiesCas>
+         <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+         <outputsNewCASes>false</outputsNewCASes>
+      </operationalProperties>
+   </analysisEngineMetaData>
+   <resourceManagerConfiguration/>
+</taeDescription>

Added: ctakes/trunk/ctakes-core/desc/analysis_engine/SectionFilter.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/desc/analysis_engine/SectionFilter.xml?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-core/desc/analysis_engine/SectionFilter.xml (added)
+++ ctakes/trunk/ctakes-core/desc/analysis_engine/SectionFilter.xml Mon Nov 21 17:50:20 2022
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<taeDescription xmlns="http://uima.apache.org/resourceSpecifier">
+   <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+   <primitive>true</primitive>
+   <annotatorImplementationName>org.apache.ctakes.core.ae.SectionFilter</annotatorImplementationName>
+   <analysisEngineMetaData>
+      <name>SectionFilter</name>
+      <description>Filters out all but a list of specified sections</description>
+      <version>1.0</version>
+      <vendor></vendor>
+      <configurationParameters>
+         <configurationParameter>
+            <name>ValidSectionList</name>
+            <description>Path to a file containing a list of sections of interest.</description>
+            <type>String</type>
+            <multiValued>false</multiValued>
+            <mandatory>false</mandatory>
+         </configurationParameter>
+      </configurationParameters>
+      <configurationParameterSettings>
+         <nameValuePair>
+            <name>ValidSectionList</name>
+            <value>
+               <string>org/apache/ctakes/temporal/ae/section/DefaultMedSections.txt</string>
+            </value>
+         </nameValuePair>
+      </configurationParameterSettings>
+      <!--  As far as I can tell everything that follows is superfluous  -->
+      <typeSystemDescription>
+         <imports>
+            <import name="org.apache.ctakes.typesystem.types.TypeSystem"/>
+         </imports>
+      </typeSystemDescription>
+      <typePriorities/>
+      <fsIndexCollection/>
+      <capabilities>
+         <capability>
+            <inputs/>
+            <outputs>
+               <type allAnnotatorFeatures="true">org.apache.ctakes.typesystem.type.textspan.Segment</type>
+            </outputs>
+            <languagesSupported/>
+         </capability>
+      </capabilities>
+      <operationalProperties>
+         <modifiesCas>true</modifiesCas>
+         <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+         <outputsNewCASes>false</outputsNewCASes>
+      </operationalProperties>
+   </analysisEngineMetaData>
+   <resourceManagerConfiguration/>
+</taeDescription>

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java?rev=1905443&r1=1905442&r2=1905443&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java (original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/external/SystemUtil.java Mon Nov 21 17:50:20 2022
@@ -360,9 +360,7 @@ final public class SystemUtil {
                .stream()
                .filter( n -> n.startsWith( ENV_VAR_PREFIX ) )
                .forEach( n -> env.put( n.substring( ENV_VAR_PREFIX.length() ), System.getProperty( n ) ) );
-         if ( !env.containsKey( "JAVA_HOME" ) ) {
             env.put( "JAVA_HOME", System.getProperty( "java.home" ) );
-         }
          if ( !env.containsKey( "CTAKES_HOME" ) ) {
             String cTakesHome = System.getenv( "CTAKES_HOME" );
             if ( cTakesHome == null || cTakesHome.isEmpty() ) {

Modified: ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/ae/CasedAnnotationFinder.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/ae/CasedAnnotationFinder.java?rev=1905443&r1=1905442&r2=1905443&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/ae/CasedAnnotationFinder.java (original)
+++ ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/ae/CasedAnnotationFinder.java Mon Nov 21 17:50:20 2022
@@ -38,6 +38,19 @@ import java.util.stream.Collectors;
 
 import static org.apache.ctakes.core.pipeline.PipeBitInfo.TypeProduct.*;
 
+// TODO : New Tables ...
+//  Lookup Table:  Cui, Synonym, wsd stuff.
+//  Tui Table: CuiA, Tui1, VocabularyX, VocabularyCodeN, PreferredTermX, VocabularyPreferenceOrder
+//  Tui Table: CuiA, Tui1, VocabularyY, VocabularyCodeO, PreferredTermY, VocabularyPreferenceOrder
+//  Tui Table: CuiA, Tui2, VocabularyZ, VocabularyCodeP, PreferredTermZ, VocabularyPreferenceOrder
+
+// TODO:  The above will make a much larger secondary table, with a larger cui index.
+//  However, not as many calls will be necessary to fully fill a term's information.
+//  It doesn't help WSD - that can still be attempted with information from the lookup table.
+
+// TODO:  There are some uppercase synonyms that should be lowercase.  Check for synonym length > 10 and then force?
+//  lowercase.  These may come from a goofy source vocabulary.
+
 
 /**
  * @author SPF , chip-nlp

Modified: ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/lookup/LookupToken.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/lookup/LookupToken.java?rev=1905443&r1=1905442&r2=1905443&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/lookup/LookupToken.java (original)
+++ ctakes/trunk/ctakes-dictionary-lookup-fast/src/main/java/org/apache/ctakes/dictionary/cased/lookup/LookupToken.java Mon Nov 21 17:50:20 2022
@@ -76,7 +76,7 @@ final public class LookupToken {
    }
 
    /**
-    * @return the actual text in the document for the lookup token, regardless of case.
+    * @return the lowercase text in the document for the lookup token, regardless of case.
     */
    public String getLowerText() {
       if ( _allLower ) {

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Adult/snake_bite.txt
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Adult/snake_bite.txt?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Adult/snake_bite.txt (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Adult/snake_bite.txt Mon Nov 21 17:50:20 2022
@@ -0,0 +1,5 @@
+Mr. Johnson is presenting signs of a snake bite.  It occurred last week and has caused immense leg pain.  The pain was so severe that he had begun taking narcotics to relieve it.
+
+The patient was concerned about possible impact upon his professional baseball career.
+
+The patient was released to go home and treat his pain himself.
\ No newline at end of file

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/CasedExample.txt
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/CasedExample.txt?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/CasedExample.txt (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/CasedExample.txt Mon Nov 21 17:50:20 2022
@@ -0,0 +1,19 @@
+- With further seizure, spinal tap and culture CSF.
+- With further seizure, spinal tap and culture csf.
+- WITH FURTHER SEIZURE, SPINAL TAP AND CULTURE CSF.
+
+Denies STIs and abnormal paps.
+Denies stis and abnormal paps.
+
+Will test for HIV, RPR and gc/chlamydia.
+Will test for hiv, rpr and gc/chlamydia.
+
+- IV access, CBC, blood cultures x1
+- iv access, cbc, blood cultures x1
+
+   * EEG to r/o seizure disorder.
+   * eeg to r/o seizure disorder.
+
+The patient is taking the medication Today.
+The patient is taking the medication today.
+Today the patient is taking the medication.

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Pediatric/shark_bite.txt
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Pediatric/shark_bite.txt?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Pediatric/shark_bite.txt (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient456/Pediatric/shark_bite.txt Mon Nov 21 17:50:20 2022
@@ -0,0 +1,5 @@
+Billy Johnson is presenting signs of a shark bite.  It occurred last week and has caused immense leg pain.  The pain was so severe that he had begun taking narcotics to relieve it.
+
+The patient was concerned about his dreams of playing professional baseball.
+
+After imaging which was inconclusive, the patient was released to go home and treat his pain himself.
\ No newline at end of file

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_1
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_1?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_1 (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_1 Mon Nov 21 17:50:20 2022
@@ -0,0 +1,34 @@
+CC/HPI:
+Mrs X is a 13 year old female who presents to the clinic with a chief complaint of "difficulty swallowing". The onset has been gradual and over the past year. She has no other complaints today.
+
+ROS: 
+She denies any metallic taste or burning sensation in her throat. She denies diarrhea, constipation, or changes in stool.
+
+Past Medical History:
+Mrs X has a history significant for mild intermittent asthma. She has no other past medical history. 
+
+Past Surgical History:
+Mrs X has never had a surgery to include wisdom teeth. 
+
+Allergies:
+Mrs X has seasonal allergies. She denies any other allergies at this time to include penicillins or foods or latex. 
+
+Medications: 
+Mrs X is on a short acting inhaler. She takes a multivitamin. She takes the aforementioned omeprazole 20mg daily. She takes no other medications.
+
+Physical Exam:
+Vitals:
+Tcurrent 98.7 BP 115/75 HR 60 RR 20 SpO2 99% on room air.
+
+Head Eyes Ears Nose Throat: There is no conjunctivitis.  
+Cardiovascular: No murmors rubs or gallops. 
+Pulmonary: Her lungs are clear to auscultation bilaterally. 
+Gastrointestinal: Her abdomen is non distended without masses appreciable. 
+Lower Extremity: Her lower extremities are well perfused. There is no edema. 
+
+Labs/Ancillary:
+There are no labs at time of current encounter.
+
+Assessment and Plan:
+Mrs X is a well appearing cheerful young woman in no acute distress. Her food related allergies that seem to localize around her lips and mouth raise a concern for EoE (eosinophilic esophagitis).
+

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_2
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_2?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_2 (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/Peds_Dysphagia_2 Mon Nov 21 17:50:20 2022
@@ -0,0 +1,46 @@
+
+CC/HPI:
+Mrs X is a 13 year old female who presents to the clinic with a chief complaint of "difficulty swallowing".
+The onset has been gradual and over the past year.
+It is intermittent and associated with specific foods: chocolate and some meats,
+though her recollection is shoddy at best.
+She has GERD, and has since she was a baby. Her mother reports she always spit up as an infant.
+She knows this difficulty swallowing is different from the GERD she has experienced in the past.
+She takes omeprazole 20mg daily and has for years.
+The sensation, she reports, is a very different feeling.
+She further reports that she has not experienced GERD in years and that attacks of
+GERD do noT precede dysphagic episodes.
+When she points to the location that the difficulty seems to arise she indicates her
+midline at the level of the first intercostal space.
+It has recently lead to a burning (5/10 when it happens) sensation and a need to vomit.
+It is non-bilious vomit and looks exactly like what she just swallowed.
+
+There is no associated difficulty breathing.
+Sometimes taking a deep breath to "make more room in her chest helps" the offending food to go down.
+
+She has noted some allergic reactions that have led to lip and mouth swelling and have necessitated
+benadryl use per her mother.
+These have included various foods, most notably chocolate.
+Her dad recalls for her that it is most notably milk and milk chocolate.
+The picture is not entirely clear.
+She is unable to recall any other foods at this time, though she knows there are others.
+So do her parents. They cannot recall either. She denies dysphagia associated with liquids.
+
+She denies odynophagia. She denies new medications or taking any new pills. She has no other
+complaints today.
+
+
+Assessment and Plan:
+Mrs X is a well appearing cheerful young woman in no acute distress.
+Her vital signs are stable. She has an unremarkable physical exam.
+Her history is significant for long standing GERD, a risk factor for esophageal stricture/ring/web.
+
+However, she has been on omeprazole and the dysphagia is increasing.
+Further, she seems to clearly differentiate the long standing GERD from the dysphagia and is familiar
+with her symptoms enough to state clearly that one does not precede the other.
+One would think that she would have noticed increasing GERD in the last year. Her food related allergies
+that seem to localize around her lips and mouth raise a concern for EoE (eosinophilic esophagitis).
+In any of the cases, the next step in her management should be consultation with a specialist.
+This would likely lead to either a pH probe, a trial of increased PPIs, or more to the point perhaps,
+an upper endoscopy with biopsy.
+

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/VascSurg_RO_DVT_1
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/VascSurg_RO_DVT_1?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/VascSurg_RO_DVT_1 (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/Patient789/VascSurg_RO_DVT_1 Mon Nov 21 17:50:20 2022
@@ -0,0 +1,13 @@
+HPI/CC: Mrs. X is a 60 yo white female with a PMH significant for HTN, CAD, AFIB, DMtype2 who presents to the clinic today for f/u to r/o a DVT after RLE edema was appreciated on PE at a f/u apt s/p high saphenous vein ligation and stab phlebectomy of the ipsilateral leg around Feb of 2010. Patient expresses concern over sutures remaining at the incision sites as well as a lesion on her L arm that was noted after IV access was attempted by a tech post-op.
+
+ROS: Pt denies cp/sob. Unremarkable otherwise. 
+
+PE: Mrs X is a well appearing woman who appears her stated age. BP-R: 118/76, BP-L: 134/78. Radial pulses 2+ bilaterally. Could not palpate pedal pulses or pop. pulses bilat., however, pedal pulses 2 by doppler.
+
+ANC: Right LE duplex indicates no DVT.
+
+A/P: Mrs X is a 60 yo female presenting to clinic for f/u to r/o a DVT s/p a high ligation of saphenous vein and stab phlebectomy of right leg. Some sutures remained and were removed. Patient was counceled on hot compress therapy for superficial phlebitis and advised that it should resolve with time. Given the exclusion of DVT, no further appointments are necessary.
+
+
+
+

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_25122019_RAD.txt
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_25122019_RAD.txt?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_25122019_RAD.txt (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_25122019_RAD.txt Mon Nov 21 17:50:20 2022
@@ -0,0 +1,22 @@
+Template:       TP Report 1
+Encounter Time: Dec 25 2019 12:00:00
+Patient Name:   Neid, Indira
+Provider:       Liszt Prahseseur Memorial
+Setting:        Outpatient.
+Code:           XYZ
+Back Code:      ZYX
+
+Text: CLINICAL HISTORY:
+Text: This is a 50 year old peri-menopausal female who underwent mammogram on 1/28/09 for a palpable lump in the right breast.
+Text:
+Text: PROCEDURE:
+Text: Ultrasound guided core biopsy of right breast 1 o'clock abnormality with clip placement.
+Text:
+Text: FINDINGS:
+Text: Under ultrasound guidance from a medial approach, 2 passes with a 14 gauge biopsy device were performed and sent to pathology.
+Text:
+Text: IMPRESSION:
+Text: Uncomplicated ultrasound guided core biopsies of the right breast at the 1 o'clock position and abnormal right axillary lymph node.
+
+Signature:      Sleips I., Nephra
+Attending:      Cash, Johnny
\ No newline at end of file

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122018_PATH.txt
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122018_PATH.txt?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122018_PATH.txt (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122018_PATH.txt Mon Nov 21 17:50:20 2022
@@ -0,0 +1,27 @@
+Template:       TP Report 2
+Encounter Time: Dec 25 2019 12:00:00
+Patient Name:   Neid, Indira
+Provider:       Liszt Prahseseur Memorial
+Setting:        Outpatient.
+Code:           XYZ
+Back Code:      ZYX
+
+Title:          SURGICAL PATHOLOGY REPORT
+
+Text: DIAGNOSIS:
+
+Text: 1) OVARY AND FALLOPIAN TUBE; RIGHT; SALPINGO-OOPHORECTOMY: HIGH GRADE
+Text: MALIGNANT NEOPLASM; 6.5 CM IN GREATEST EXTENT; CONFINED TO THE OVARY
+Text: (SEE COMMENT).
+Text:
+Text: 2) OMENTUM; EXCISION: ADIPOSE TISSUE; NEGATIVE FOR MALIGNANCY.
+Text:
+Text:                          OID***Carcinoma Summary Findings
+Text:
+Text: Specimen Type: bilateral salpingo-oophorectomy
+Text: Primary tumor site: right
+Text: Specimen Integrity:
+Text:       Right Ovary: good
+Text:       Left Ovary: good
+
+Electronically signed by: ABC DEF; M.D.

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122019_NOTE.txt
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122019_NOTE.txt?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122019_NOTE.txt (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/notes/apache_con/basic/Patient123/Patient123_31122019_NOTE.txt Mon Nov 21 17:50:20 2022
@@ -0,0 +1,23 @@
+Template:       TP Report 3
+Encounter Time: Dec 25 2019 12:00:00
+Patient Name:   Neid, Indira
+Provider:       Liszt Prahseseur Memorial
+Setting:        Outpatient.
+Code:           XYZ
+Back Code:      ZYX
+
+Text: CLINICAL HISTORY:
+Text: This is a 50 year old peri-menopausal female with clinical stage 2A (T1,N2,M0) infiltrating ductal carcinoma.
+Text:
+Text: INTERIM HISTORY:
+Text: MRI of the left breast was without malignancy.
+Text: Physical Exam: Well appearing female in NAD
+Text: Neck: Supple, no masses, thyroid not enlarged
+Text: LUNGS: CTA, No wheezes, rales, rhonchi
+Text:
+Text: IMPRESSION:
+Text: On review of the patient's screening and diagnostic imaging and biopsy results she has a stage IIA (T1,N2,M0)
+Text:  infiltrating ductal carcinoma of the right breast.
+
+Signature:      Sleips I., Nephra
+Attending:      Cash, Johnny

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/AdvancedClinicalToFhir.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/AdvancedClinicalToFhir.piper?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/AdvancedClinicalToFhir.piper (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/AdvancedClinicalToFhir.piper Mon Nov 21 17:50:20 2022
@@ -0,0 +1,9 @@
+
+load SectionedRelationTemporalPipeline
+
+package org.apache.ctakes.fhir.cc
+
+set WriteNlpFhir=true
+
+add FhirJsonFileWriter
+

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemo.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemo.piper?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemo.piper (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemo.piper Mon Nov 21 17:50:20 2022
@@ -0,0 +1,32 @@
+// Run using -p ApacheConDemo -i org/apache/ctakes/examples/notes/apache_con -o {your output directory}
+
+// Use our simple extension of AbstractFileTreeReader.
+reader ApacheConDemoReader
+
+// Load a simple token processing pipeline from another pipeline file.
+load DefaultTokenizerPipeline
+
+// Add non-core annotators.
+add ContextDependentTokenizerAnnotator
+addDescription POSTagger
+
+// Add Chunkers.
+load ChunkerSubPipe
+
+//load DictionarySubPipe
+
+// Use the new case sensitive dictionary lookup.
+load cased_2020aa
+add CasedAnnotationFinder
+
+// Add Cleartk Entity Attribute annotators.
+load AttributeCleartkSubPipe
+
+// Html output
+add html.HtmlTextWriter SubDirectory=HTML
+
+// Use our simple extension of AbstractJCasFileWriter.
+//add ApacheConDemoWriter
+
+// Log run time stats and completion.
+add util.log.FinishedLogger

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoBasic.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoBasic.piper?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoBasic.piper (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoBasic.piper Mon Nov 21 17:50:20 2022
@@ -0,0 +1,21 @@
+
+// Run using command line parameters
+// -p ApacheConDemoBasic
+// -i org/apache/ctakes/examples/notes/apache_con/Patient123
+// -o {your output directory}
+
+// Use our simple extension of AbstractFileTreeReader.
+reader ApacheConDemoReader
+
+// Add our simple regex engine to the pipeline.
+// By default finds "biopsy".
+add ApacheConDemoEngine
+
+// Add our simple regex engine to the pipeline.
+// Find Imaging mentions.
+add ApacheConDemoEngine REGEX_CUI=AC456 REGEX="diagnostic imaging|MRI"
+
+// Use our simple extension of AbstractJCasFileWriter.
+add ApacheConDemoWriter
+
+add FileTreeXmiWriter SubDirectory=XMI

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoRelation.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoRelation.piper?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoRelation.piper (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoRelation.piper Mon Nov 21 17:50:20 2022
@@ -0,0 +1,27 @@
+// use the standard tokenizer pipeline:
+load DefaultTokenizerPipeline
+
+// Always need these ...
+add ContextDependentTokenizerAnnotator
+add POSTagger
+
+// Chunkers
+load ChunkerSubPipe
+
+// Default fast dictionary lookup
+//set minimumSpan=2
+load DictionarySubPipe
+
+// Cleartk Entity Attributes (negation, uncertainty, etc.)
+load AttributeCleartkSubPipe
+
+// Location.
+//addLogged LocationOfRelationExtractorAnnotator classifierJarPath=/org/apache/ctakes/relationextractor/models/location_of/model.jar
+
+// Temporal (event, time, dtr, tlink)
+//load TemporalSubPipe
+
+// Coreferences (e.g. patient = he)
+load CorefSubPipe
+
+add ApacheConCorefWriter

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoSection.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoSection.piper?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoSection.piper (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/ApacheConDemoSection.piper Mon Nov 21 17:50:20 2022
@@ -0,0 +1,11 @@
+// Annotate sections by known regex
+//add BsvRegexSectionizer
+add SimpleSegmentAnnotator
+
+//add ParagraphAnnotator
+
+//add SentenceDetector
+addLogged SentenceDetectorAnnotatorBIO classifierJarPath=/org/apache/ctakes/core/sentdetect/model.jar
+
+// Save simple information
+add ApacheConSentenceWriter

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/Cased2020aa.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/Cased2020aa.piper?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/Cased2020aa.piper (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/Cased2020aa.piper Mon Nov 21 17:50:20 2022
@@ -0,0 +1,12 @@
+// Load a simple token processing pipeline from another pipeline file
+load DefaultTokenizerPipeline
+
+// Add non-core annotators
+addDescription POSTagger
+
+// New case-sensitive dictionary lookup
+load cased_2020aa_2
+add CasedAnnotationFinder
+
+// Simple writer for Demo
+add ApacheConAnnotationWriter

Added: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/FhirToOutput.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/FhirToOutput.piper?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/FhirToOutput.piper (added)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/FhirToOutput.piper Mon Nov 21 17:50:20 2022
@@ -0,0 +1,6 @@
+
+package org.apache.ctakes.fhir.cr
+
+reader FhirJsonFileReader
+
+add pretty.html.HtmlTextWriter
\ No newline at end of file

Modified: ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/XmiToPretty.piper
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/XmiToPretty.piper?rev=1905443&r1=1905442&r2=1905443&view=diff
==============================================================================
--- ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/XmiToPretty.piper (original)
+++ ctakes/trunk/ctakes-examples-res/src/main/resources/org/apache/ctakes/examples/pipeline/XmiToPretty.piper Mon Nov 21 17:50:20 2022
@@ -2,13 +2,16 @@
 reader XmiTreeReader
 
 // Write html
-add html.HtmlTextWriter
+add html.HtmlTextWriter SubDirectory=HTML
 
 // write -marked- plaintext
-add pretty.plaintext.PrettyTextWriterFit
+add pretty.plaintext.PrettyTextWriterFit SubDirectory=TEXT
 
 // write property list
-add property.plaintext.PropertyTextWriterFit
+//add property.plaintext.PropertyTextWriterFit
+
+// Writes a list of Semantic information about discovered annotations to files.
+add SemanticTableFileWriter SubDirectory=TUI
 
 // Announce completion
 addLast util.log.FinishedLogger

Modified: ctakes/trunk/ctakes-examples/pom.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/pom.xml?rev=1905443&r1=1905442&r2=1905443&view=diff
==============================================================================
--- ctakes/trunk/ctakes-examples/pom.xml (original)
+++ ctakes/trunk/ctakes-examples/pom.xml Mon Nov 21 17:50:20 2022
@@ -62,7 +62,8 @@
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter</artifactId>
-        <version>RELEASE</version>
+        <!--        <version>RELEASE</version>-->
+        <version>5.8.2</version>
         <scope>compile</scope>
      </dependency>
   </dependencies>

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ApacheConDemoEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ApacheConDemoEngine.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ApacheConDemoEngine.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/ae/ApacheConDemoEngine.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,50 @@
+package org.apache.ctakes.examples.ae;
+
+import org.apache.ctakes.core.util.annotation.IdentifiedAnnotationBuilder;
+import org.apache.ctakes.core.util.annotation.SemanticTui;
+import org.apache.ctakes.core.util.regex.RegexSpanFinder;
+import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
+import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
+import org.apache.uima.fit.descriptor.ConfigurationParameter;
+import org.apache.uima.jcas.JCas;
+
+
+/**
+ * Finds clinical procedures in text using regular expressions.
+ * Accepts parameters for the procedure's regular expression and the procedure's CUI.
+ */
+public class ApacheConDemoEngine extends JCasAnnotator_ImplBase {
+
+   @ConfigurationParameter(
+         name = "REGEX",
+         description = "Regular expression to use for matching clinical procedures.",
+         defaultValue = "biopsy"
+   )
+   private String _regex;
+
+   @ConfigurationParameter(
+         name = "REGEX_CUI",
+         description = "CUI for matched clinical procedure expressions.",
+         defaultValue = "AC123"
+   )
+   private String _regexCui;
+
+   /**
+    * Finds Procedures using a regular expression and creates Identified Annotations.
+    */
+   @Override
+   public void process( JCas jCas ) throws AnalysisEngineProcessException {
+      IdentifiedAnnotationBuilder builder = new IdentifiedAnnotationBuilder().concept( jCas, _regexCui,
+                                                                                       SemanticTui.T060 );
+      try ( RegexSpanFinder finder = new RegexSpanFinder( _regex ) ) {
+         finder.findSpans( jCas.getDocumentText() )
+               .forEach( span ->
+                               builder
+                                     .span( span )
+                                     .build( jCas ) );
+      } catch ( IllegalArgumentException iaE ) {
+         throw new AnalysisEngineProcessException( iaE );
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConAnnotationWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConAnnotationWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConAnnotationWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConAnnotationWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,45 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.core.util.annotation.IdentifiedAnnotationUtil;
+import org.apache.ctakes.typesystem.type.textsem.AnatomicalSiteMention;
+import org.apache.ctakes.typesystem.type.textsem.EventMention;
+import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
+import org.apache.ctakes.typesystem.type.textspan.Sentence;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ *
+ */
+public class ApacheConAnnotationWriter extends AbstractJCasFileWriter {
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+      File file = new File( outputDir, fileName + "_Annotations.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         Map<Sentence, Collection<IdentifiedAnnotation>> sentenceAnnotations
+               = JCasUtil.indexCovered( jCas, Sentence.class, IdentifiedAnnotation.class );
+         List<Sentence> sentences = new ArrayList<>( sentenceAnnotations.keySet() );
+         sentences.sort( Comparator.comparingInt( Sentence::getBegin ) );
+         for ( Sentence sentence : sentences ) {
+            for ( IdentifiedAnnotation annotation : sentenceAnnotations.get( sentence ) ) {
+               if ( annotation instanceof EventMention || annotation instanceof AnatomicalSiteMention ) {
+                  writer.write( " \"" + IdentifiedAnnotationUtil.getText( annotation ) + "\"   " );
+               }
+            }
+            writer.write( "\n" );
+         }
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConCorefWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConCorefWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConCorefWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConCorefWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,56 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.core.util.annotation.EssentialAnnotationUtil;
+import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ *
+ */
+public class ApacheConCorefWriter extends AbstractJCasFileWriter {
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+      File file = new File( outputDir, fileName + "_Corefs.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         final Map<IdentifiedAnnotation, Collection<Integer>> markableCorefs
+               = EssentialAnnotationUtil.createMarkableCorefs( jCas );
+         final Collection<IdentifiedAnnotation> requiredAnnotations
+               = EssentialAnnotationUtil.getRequiredAnnotations( jCas, markableCorefs );
+
+         final Map<Integer, Collection<IdentifiedAnnotation>> chains = new HashMap<>();
+         for ( IdentifiedAnnotation annotation : requiredAnnotations ) {
+            final Collection<Integer> corefs = markableCorefs.get( annotation );
+            if ( corefs != null ) {
+               for ( Integer coref : corefs ) {
+                  chains.computeIfAbsent( coref, c -> new HashSet<>() )
+                        .add( annotation );
+               }
+            }
+         }
+         for ( Map.Entry<Integer, Collection<IdentifiedAnnotation>> chain : chains.entrySet() ) {
+            writer.write( "Coreference Chain : " + chain.getKey() + "\n" );
+            String links = chain.getValue()
+                                .stream()
+                                .map( l -> "   " + l.getCoveredText() )
+                                .collect( Collectors.joining( "\n" ) );
+            writer.write( links + "\n" );
+         }
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConDemoWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConDemoWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConDemoWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConDemoWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,44 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.core.util.annotation.IdentifiedAnnotationUtil;
+import org.apache.ctakes.core.util.doc.NoteSpecs;
+import org.apache.ctakes.typesystem.type.textsem.EventMention;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+
+/**
+ * Writes to file with a list of document metadata
+ * and a list of information for clinical events (not anatomical sites).
+ */
+public class ApacheConDemoWriter extends AbstractJCasFileWriter {
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+      File file = new File( outputDir, documentId + "_ApacheCon.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         NoteSpecs noteSpecs = new NoteSpecs( jCas );
+         writer.write(
+               "Document ID:   " + documentId + "\n" +
+               "Document Type: " + noteSpecs.getDocumentType() + "\n" +
+               "Patient ID:  " + noteSpecs.getPatientName() + "\n" +
+               "---------------------------------------------\n" );
+         for ( EventMention event : JCasUtil.select( jCas, EventMention.class ) ) {
+            writer.write(
+                  IdentifiedAnnotationUtil.getBestSemanticGroup( event )
+                                          .getName() + " " +
+                  String.join( ", ", IdentifiedAnnotationUtil.getCuis( event ) ) + " " +
+                  "\"" + IdentifiedAnnotationUtil.getText( event ) + "\"\n" );
+         }
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConLocationWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConLocationWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConLocationWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConLocationWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,38 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.typesystem.type.relation.LocationOfTextRelation;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+import java.util.Collection;
+
+/**
+ *
+ */
+public class ApacheConLocationWriter extends AbstractJCasFileWriter {
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+      File file = new File( outputDir, fileName + "_Locations.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         Collection<LocationOfTextRelation> locations = JCasUtil.select( jCas, LocationOfTextRelation.class );
+         for ( LocationOfTextRelation location : locations ) {
+            writer.write( location.getArg1()
+                                  .getArgument()
+                                  .getCoveredText()
+                          + "  = located at =  " + location.getArg2()
+                                                           .getArgument()
+                                                           .getCoveredText() + "\n" );
+         }
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConParagraphWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConParagraphWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConParagraphWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConParagraphWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,34 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.typesystem.type.textspan.Paragraph;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+import java.util.Collection;
+
+/**
+ *
+ */
+public class ApacheConParagraphWriter extends AbstractJCasFileWriter {
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+      File file = new File( outputDir, fileName + "_Paragraphs.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         Collection<Paragraph> paragraphs = JCasUtil.select( jCas, Paragraph.class );
+         for ( Paragraph paragraph : paragraphs ) {
+            writer.write( paragraph.getCoveredText() + "\n" );
+            writer.write( "-------------------------------------------------------------------" );
+         }
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSectionWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSectionWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSectionWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSectionWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,34 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.typesystem.type.textspan.Segment;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+import java.util.Collection;
+
+/**
+ *
+ */
+public class ApacheConSectionWriter extends AbstractJCasFileWriter {
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+      File file = new File( outputDir, fileName + "_Sections.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         Collection<Segment> sections = JCasUtil.select( jCas, Segment.class );
+         for ( Segment section : sections ) {
+            writer.write( "Section ID : " + section.getId() + "\t" + "Document Text : " + section.getTagText() + "\n" );
+            writer.write( section.getCoveredText() + "\n" );
+         }
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSentenceWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSentenceWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSentenceWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConSentenceWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,34 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.typesystem.type.textspan.Sentence;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+import java.util.Collection;
+
+/**
+ *
+ */
+public class ApacheConSentenceWriter extends AbstractJCasFileWriter {
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+      File file = new File( outputDir, fileName + "_Sentences.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         Collection<Sentence> sentences = JCasUtil.select( jCas, Sentence.class );
+         for ( Sentence sentence : sentences ) {
+            writer.write( sentence.getCoveredText() + "\n" );
+            writer.write( "-------------------------------------------------------------------\n" );
+         }
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConTlinkWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConTlinkWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConTlinkWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/ApacheConTlinkWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,64 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.typesystem.type.relation.BinaryTextRelation;
+import org.apache.ctakes.typesystem.type.relation.TemporalTextRelation;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.io.*;
+import java.util.Comparator;
+import java.util.function.Function;
+import java.util.function.ToIntFunction;
+
+/**
+ *
+ */
+public class ApacheConTlinkWriter extends AbstractJCasFileWriter {
+
+   /*
+    * Given a binary text relation, returns a string with information about that relation.
+    */
+   static private final Function<BinaryTextRelation, String> toRelInfo = r ->
+         r.getArg1()
+          .getArgument()
+          .getCoveredText()
+         + "  = " + r.getCategory()
+         + " =  " + r.getArg2()
+                     .getArgument()
+                     .getCoveredText() +
+         "\n";
+
+   /*
+    * Given a binary text relation, returns the first character offset of the relation's first argument.
+    */
+   static private final ToIntFunction<BinaryTextRelation> getRelBegin = r ->
+         r.getArg1()
+          .getArgument()
+          .getBegin();
+
+   /**
+    * Writes some document metadata and discovered event information.
+    */
+   @Override
+   public void writeFile( JCas jCas,
+                          String outputDir,
+                          String documentId,
+                          String fileName ) throws IOException {
+
+      final StringBuilder sb = new StringBuilder();
+      JCasUtil.select( jCas, TemporalTextRelation.class )
+              .stream()
+              .sorted( Comparator.comparingInt( getRelBegin ) )
+              .map( toRelInfo )
+              .forEach( sb::append );
+
+      File file = new File( outputDir, fileName + "_Tlinks.txt" );
+      try ( Writer writer = new BufferedWriter( new FileWriter( file ) ) ) {
+         writer.write( sb.toString() );
+      }
+
+   }
+
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/FileTreeViewXmiWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/FileTreeViewXmiWriter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/FileTreeViewXmiWriter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/FileTreeViewXmiWriter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,81 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.core.cc.AbstractJCasFileWriter;
+import org.apache.ctakes.core.cc.XMISerializer;
+import org.apache.ctakes.core.config.ConfigParameterConstants;
+import org.apache.ctakes.core.patient.PatientViewUtil;
+import org.apache.ctakes.core.pipeline.PipeBitInfo;
+import org.apache.log4j.Logger;
+import org.apache.uima.analysis_engine.AnalysisEngine;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.impl.XmiCasSerializer;
+import org.apache.uima.fit.factory.AnalysisEngineFactory;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.xml.sax.SAXException;
+
+import java.io.*;
+import java.util.Collection;
+
+/**
+ * Write xmi files in a directory tree mimicking that of the input files
+ *
+ * @author SPF , chip-nlp
+ * @since 5/24/2021
+ */
+@PipeBitInfo(
+      name = "XMI Writer (Dir Tree, Views)",
+      description = "Writes XMI files with full representation of input text and all extracted information per View.",
+      role = PipeBitInfo.Role.WRITER,
+      dependencies = { PipeBitInfo.TypeProduct.DOCUMENT_ID },
+      usables = { PipeBitInfo.TypeProduct.DOCUMENT_ID_PREFIX }
+)
+final public class FileTreeViewXmiWriter extends AbstractJCasFileWriter {
+
+   static private final Logger LOGGER = Logger.getLogger( "FileTreeViewXmiWriter" );
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void writeFile( final JCas jCas, final String outputDir,
+                          final String documentId, final String fileName ) throws IOException {
+
+      final Collection<JCas> views = PatientViewUtil.getAllViews( jCas );
+      for ( JCas view : views ) {
+         final File xmiFile = new File( outputDir, fileName + "_" + view.getViewName() + ".xmi" );
+         LOGGER.info( "Writing XMI to " + xmiFile.getPath() + " ..." );
+         try {
+            writeXmi( jCas.getCas(), xmiFile );
+         } catch ( IOException | SAXException multE ) {
+            throw new IOException( multE );
+         }
+         LOGGER.info( "Finished Writing" );
+      }
+
+   }
+
+   /**
+    * Serialize a CAS to a file in XMI format
+    *
+    * @param cas  CAS to serialize
+    * @param file output file
+    * @throws IOException  -
+    * @throws SAXException -
+    */
+   static private void writeXmi( final CAS cas, final File file ) throws IOException, SAXException {
+      try ( OutputStream outputStream = new BufferedOutputStream( new FileOutputStream( file ) ) ) {
+         XmiCasSerializer casSerializer = new XmiCasSerializer( cas.getTypeSystem() );
+         XMISerializer xmiSerializer = new XMISerializer( outputStream );
+         casSerializer.serialize( cas, xmiSerializer.getContentHandler() );
+      }
+   }
+
+   public static AnalysisEngine createEngine( final String outputDirectory ) throws ResourceInitializationException {
+      return AnalysisEngineFactory
+            .createEngine( org.apache.ctakes.core.cc.FileTreeXmiWriter.class, ConfigParameterConstants.PARAM_OUTPUTDIR,
+                           outputDirectory );
+   }
+
+
+}
\ No newline at end of file

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/TokenPrinter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/TokenPrinter.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/TokenPrinter.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cc/TokenPrinter.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,32 @@
+package org.apache.ctakes.examples.cc;
+
+import org.apache.ctakes.typesystem.type.syntax.BaseToken;
+import org.apache.log4j.Logger;
+import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
+import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
+import org.apache.uima.fit.util.JCasUtil;
+import org.apache.uima.jcas.JCas;
+
+import java.util.Collection;
+
+/**
+ * @author SPF , chip-nlp
+ * @since {8/17/2021}
+ */
+public final class TokenPrinter extends JCasAnnotator_ImplBase {
+
+   static private final Logger LOGGER = Logger.getLogger( "TokenPrinter" );
+
+   /**
+    * Entry point for processing.
+    */
+   @Override
+   public void process( final JCas jCas ) throws AnalysisEngineProcessException {
+      final Collection<BaseToken> tokens = JCasUtil.select( jCas, BaseToken.class );
+      for ( BaseToken token : tokens ) {
+         LOGGER.info( token.getClass()
+                           .getSimpleName() + " " + token.getCoveredText() );
+      }
+   }
+
+}

Added: ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cr/ApacheConDemoReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cr/ApacheConDemoReader.java?rev=1905443&view=auto
==============================================================================
--- ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cr/ApacheConDemoReader.java (added)
+++ ctakes/trunk/ctakes-examples/src/main/java/org/apache/ctakes/examples/cr/ApacheConDemoReader.java Mon Nov 21 17:50:20 2022
@@ -0,0 +1,43 @@
+package org.apache.ctakes.examples.cr;
+
+
+import org.apache.ctakes.core.cr.AbstractFileTreeReader;
+import org.apache.uima.jcas.JCas;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * Reads a tree of files, building documents from lines starting with "Text:"
+ */
+public class ApacheConDemoReader extends AbstractFileTreeReader {
+
+   /**
+    * Places Document Text (and other information) in JCas.
+    *
+    * @param jCas unpopulated jcas data container.
+    * @param file file to be read.
+    * @throws IOException should anything bad happen.
+    */
+   protected void readFile( JCas jCas, File file ) throws IOException {
+      // Read the file, building a document only using lines preceded by "Text:"
+      String documentText;
+      try ( Stream<String> textStream = Files.lines( file.toPath() ) ) {
+         documentText = textStream
+               .filter( line -> line.startsWith( "Text:" ) )
+               .map( line -> line.substring( 5 )
+                                 .trim() )
+               .collect( Collectors.joining( "\n" ) );
+      }
+      // Based upon the file, the provided JCasBuilder attempts to determine metadata
+      // document ID, document type, patient ID, and creation time.
+      // Here we set the document text on the builder and populate the the jcas.
+      getJCasBuilder( file )
+            .setDocText( documentText )
+            .populate( jCas );
+   }
+
+}