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 2023/02/04 01:45:59 UTC
[ctakes] branch main updated: Removed Regimen from type system. Added generic attributes and modifiers. Added generic attributes and modifiers to Medication and Procedure types. Removed outdated pbj test. A few more changes to clear up compilation warnings. Huge comment at top of type system and TODO task.
This is an automated email from the ASF dual-hosted git repository.
seanfinan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ctakes.git
The following commit(s) were added to refs/heads/main by this push:
new e786c1d Removed Regimen from type system. Added generic attributes and modifiers. Added generic attributes and modifiers to Medication and Procedure types. Removed outdated pbj test. A few more changes to clear up compilation warnings. Huge comment at top of type system and TODO task.
e786c1d is described below
commit e786c1d1d5941d658b2ef735b24ab5bc833847ad
Author: Sean Finan <se...@childrens.harvard.edu>
AuthorDate: Fri Feb 3 20:45:49 2023 -0500
Removed Regimen from type system.
Added generic attributes and modifiers.
Added generic attributes and modifiers to Medication and Procedure types.
Removed outdated pbj test.
A few more changes to clear up compilation warnings.
Huge comment at top of type system and TODO task.
---
.../medfacts/AssertionAnalysisEngineFit.java | 2 +-
.../medfacts/Converti2b2AnnotationsToCTAKES.java | 22 +-
...reateAssertionLuceneIndexFromDelimitedFile.java | 1 +
.../java/tests/xmi_test_for_FSAarray_error.java | 61 ----
.../ae/EventTimeI2B2RelationAnnotator.java | 1 +
.../ae/EventTimeSelfRelationAnnotator.java | 2 +
.../pipelines/EventAndTimeExtractionPipeline.java | 11 +-
.../TemporalExtractionPipeline_ImplBase.java | 10 +-
.../apache/ctakes/typesystem/types/TypeSystem.xml | 403 ++++++++++++++++++---
9 files changed, 366 insertions(+), 147 deletions(-)
diff --git a/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/AssertionAnalysisEngineFit.java b/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/AssertionAnalysisEngineFit.java
index f9ae740..3bf10ee 100644
--- a/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/AssertionAnalysisEngineFit.java
+++ b/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/AssertionAnalysisEngineFit.java
@@ -178,7 +178,7 @@ public class AssertionAnalysisEngineFit extends JCasAnnotator_ImplBase {
// hypothetical
// possible
// Changed from original implementation by information in https://www.mitre.org/sites/default/files/pdf/10_4676.pdf
- static private void mapI2B2AssertionValueToCtakes( final String assertionType,
+ static public void mapI2B2AssertionValueToCtakes( final String assertionType,
final IdentifiedAnnotation annotation )
throws AnalysisEngineProcessException {
if ( assertionType == null ) {
diff --git a/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/Converti2b2AnnotationsToCTAKES.java b/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/Converti2b2AnnotationsToCTAKES.java
index 47dbfcb..e82fb61 100644
--- a/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/Converti2b2AnnotationsToCTAKES.java
+++ b/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/Converti2b2AnnotationsToCTAKES.java
@@ -18,39 +18,27 @@
*/
package org.apache.ctakes.assertion.medfacts;
-import org.apache.ctakes.assertion.stub.CharacterOffsetToLineTokenConverter;
-import org.apache.ctakes.assertion.stub.CharacterOffsetToLineTokenConverterDefaultImpl;
import java.io.File;
-import java.io.FileInputStream;
import org.apache.log4j.Logger;
-import org.apache.uima.cas.impl.XmiCasDeserializer;
import org.xml.sax.SAXException;
-import org.apache.uima.collection.CollectionException;
import org.apache.uima.util.CasCreationUtils;
import org.apache.uima.analysis_engine.AnalysisEngineDescription;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.CASException;
import org.apache.uima.jcas.JCas;
-import org.apache.uima.cas.TypeSystem;
-import java.util.Collections;
import org.apache.uima.util.XMLParser;
import org.apache.uima.UIMAFramework;
import org.apache.uima.util.XMLInputSource;
import org.apache.uima.jcas.cas.FSArray;
-import org.apache.uima.jcas.cas.Sofa;
-import org.apache.uima.resource.metadata.TypeSystemDescription;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.ctakes.assertion.stub.Annotation;
import org.apache.ctakes.assertion.stub.AssertionAnnotation;
import org.apache.ctakes.assertion.stub.ConceptType;
-import org.apache.uima.cas.text.AnnotationIndex;
-//import org.apache.uima.jcas.tcas.Annotation;
import org.apache.ctakes.assertion.stub.LineAndTokenPosition;
-import java.io.PrintWriter;
import java.io.IOException;
import org.apache.ctakes.assertion.stub.SingleDocumentProcessor;
import org.apache.ctakes.assertion.stub.StringHandling;
@@ -58,8 +46,6 @@ import org.apache.ctakes.assertion.stub.LineTokenToCharacterOffsetConverter;
import org.apache.ctakes.assertion.stub.AssertionFileProcessor;
import java.util.List;
-import org.apache.ctakes.assertion.medfacts.types.Assertion;
-import org.apache.ctakes.assertion.medfacts.types.Concept;
import org.apache.ctakes.typesystem.type.textsem.EntityMention;
import org.apache.ctakes.typesystem.type.textsem.EventMention;
import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
@@ -98,9 +84,8 @@ public class Converti2b2AnnotationsToCTAKES {
* @param name
* output file
* @throws SAXException
- * @throws Exception
+ * @throws IOException
*
- * @throws ResourceProcessException
*/
private static void writeXmi(CAS aCas, File name) throws IOException, SAXException {
FileOutputStream out = null;
@@ -229,8 +214,9 @@ public class Converti2b2AnnotationsToCTAKES {
entityOrEventMention.setOntologyConceptArr(ontologyConceptArray);
//adjustAssertionAttributesByI2B2Convertion(entityOrEventMention, i2b2Assertion);
- AssertionAnalysisEngine.mapI2B2AssertionValueToCtakes(i2b2Assertion.getAssertionValue().toString().toLowerCase(), entityOrEventMention);
-
+// AssertionAnalysisEngine.mapI2B2AssertionValueToCtakes(i2b2Assertion.getAssertionValue().toString().toLowerCase(), entityOrEventMention);
+ AssertionAnalysisEngineFit.mapI2B2AssertionValueToCtakes(i2b2Assertion.getAssertionValue().toString().toLowerCase(), entityOrEventMention);
+
entityOrEventMention.addToIndexes();
logger.info(" end assertion");
}
diff --git a/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/assertion/CreateAssertionLuceneIndexFromDelimitedFile.java b/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/assertion/CreateAssertionLuceneIndexFromDelimitedFile.java
index 0abad5f..e199d86 100644
--- a/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/assertion/CreateAssertionLuceneIndexFromDelimitedFile.java
+++ b/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/assertion/CreateAssertionLuceneIndexFromDelimitedFile.java
@@ -367,6 +367,7 @@ public class CreateAssertionLuceneIndexFromDelimitedFile {
return "java LucenePopulateDriver <dir-containing-textfile(s)> [hyphenfile] [freqcutoff]";
}
+ @SuppressWarnings( "unchecked" )
protected void writeToFormatLucene(String cuePhrase, String cuePhraseCategory, String cuePhraseFamily) {
Document doc = new Document();
diff --git a/ctakes-pbj/src/main/java/tests/xmi_test_for_FSAarray_error.java b/ctakes-pbj/src/main/java/tests/xmi_test_for_FSAarray_error.java
deleted file mode 100644
index 59f7c58..0000000
--- a/ctakes-pbj/src/main/java/tests/xmi_test_for_FSAarray_error.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package tests;
-
-import org.apache.ctakes.core.cc.XMISerializer;
-import org.apache.ctakes.core.util.annotation.IdentifiedAnnotationBuilder;
-import org.apache.ctakes.typesystem.type.refsem.MedicationStrength;
-import org.apache.ctakes.typesystem.type.textsem.MedicationEventMention;
-import org.apache.ctakes.typesystem.type.textsem.MedicationStrengthModifier;
-import org.apache.uima.UIMAException;
-import org.apache.uima.cas.impl.XmiCasSerializer;
-import org.apache.uima.fit.factory.JCasFactory;
-import org.apache.uima.jcas.JCas;
-import org.apache.uima.jcas.cas.FSArray;
-import org.xml.sax.SAXException;
-
-import java.io.*;
-import java.nio.file.Files;
-
-public class xmi_test_for_FSAarray_error {
- public static void main(String[] args) throws UIMAException {
- JCas jCas = JCasFactory.createJCas();
- jCas.setDocumentText("Patient takes 40 mg Aspirin per day");
-
- // Create our main medication Aspirin
- MedicationEventMention medEventMention = new MedicationEventMention( jCas, 20, 27 );
- medEventMention.addToIndexes();
-
- // Create the strength modifier, which has an actual location in the text 40 mg
- MedicationStrengthModifier medicationStrengthModifier = new MedicationStrengthModifier( jCas, 14, 19 );
- medicationStrengthModifier.addToIndexes();
-
- // Create the strength attribute - a conceptual entity that doesn't exist in the text but
- // knows of modifiers that exist in the text.
- MedicationStrength medicationStrength = new MedicationStrength( jCas );
- medicationStrength.addToIndexes();
-
- // FSArray is a "primitive" type of array required by uima.
- // We can't use pojo (plain old java object. e.g. java.util.List<>, java.util.Set<> ) collections,
- // so we have to put modifiers into this FSArray
- FSArray mentions = new FSArray( jCas, 1 );
- mentions.addToIndexes();
- mentions.set( 0, medicationStrengthModifier );
-
- // Add the modifier mention to the attribute
- medicationStrength.setMentions( mentions );
-
- // set the attribute of the medication
- medEventMention.setMedicationStrength( medicationStrength );
-
- // write to xmi.
- final File file = new File( args[0] + ".xmi" );
- try {
- try ( OutputStream outputStream = new BufferedOutputStream(Files.newOutputStream(file.toPath())) ) {
- XmiCasSerializer casSerializer = new XmiCasSerializer(jCas.getTypeSystem() );
- XMISerializer xmiSerializer = new XMISerializer( outputStream );
- casSerializer.serialize(jCas.getCas(), xmiSerializer.getContentHandler() );
- }
- } catch (IOException | SAXException multE ) {
- //
- }
- }
-}
\ No newline at end of file
diff --git a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java
index c0a4e7e..d3ab1dd 100644
--- a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java
+++ b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeI2B2RelationAnnotator.java
@@ -126,6 +126,7 @@ public class EventTimeI2B2RelationAnnotator extends RelationExtractorAnnotator {
}
@Override
+ @SuppressWarnings( "unchecked" )
protected List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> getFeatureExtractors()
throws ResourceInitializationException {
return Lists.newArrayList(
diff --git a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
index 4fa534f..6a9bf31 100644
--- a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
+++ b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventTimeSelfRelationAnnotator.java
@@ -138,6 +138,7 @@ public class EventTimeSelfRelationAnnotator extends TemporalRelationExtractorAnn
private RelationSyntacticETEmbeddingFeatureExtractor embedingExtractor;
@Override
+ @SuppressWarnings( "unchecked" )
protected List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> getFeatureExtractors()
throws ResourceInitializationException {
final String vectorFile = "org/apache/ctakes/temporal/gloveresult_3";
@@ -147,6 +148,7 @@ public class EventTimeSelfRelationAnnotator extends TemporalRelationExtractorAnn
System.err.println("cannot find file: "+ vectorFile);
e.printStackTrace();
}
+ // TODO get rid of these google commons collection creators.
return Lists.newArrayList(
new UnexpandedTokenFeaturesExtractor()//new TokenFeaturesExtractor()
, embedingExtractor
diff --git a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java
index fa51ff9..619bb61 100644
--- a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java
+++ b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java
@@ -20,6 +20,7 @@ package org.apache.ctakes.temporal.pipelines;
import com.lexicalscope.jewel.cli.CliFactory;
import com.lexicalscope.jewel.cli.Option;
+import org.apache.ctakes.core.cc.FileTreeXmiWriter;
import org.apache.ctakes.core.cc.XmiWriterCasConsumerCtakes;
import org.apache.ctakes.core.config.ConfigParameterConstants;
import org.apache.ctakes.temporal.ae.BackwardsTimeAnnotator;
@@ -68,10 +69,12 @@ public class EventAndTimeExtractionPipeline extends TemporalExtractionPipeline_I
aggregateBuilder.add(EventAnnotator.createAnnotatorDescription(new File(options.getEventModelDirectory())));
aggregateBuilder.add(BackwardsTimeAnnotator.createAnnotatorDescription(options.getTimeModelDirectory() + "model.jar"));
AnalysisEngine xWriter = AnalysisEngineFactory.createEngine(
- XmiWriterCasConsumerCtakes.class,
- XmiWriterCasConsumerCtakes.PARAM_OUTPUTDIR,
- options.getOutputDirectory());
-
+// XmiWriterCasConsumerCtakes.class,
+// XmiWriterCasConsumerCtakes.PARAM_OUTPUTDIR,
+ FileTreeXmiWriter.class,
+ ConfigParameterConstants.PARAM_OUTPUTDIR,
+ options.getOutputDirectory());
+
SimplePipeline.runPipeline(
collectionReader,
aggregateBuilder.createAggregate(),
diff --git a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java
index 7a10e03..25fe771 100644
--- a/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java
+++ b/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/TemporalExtractionPipeline_ImplBase.java
@@ -26,7 +26,9 @@ import org.apache.ctakes.contexttokenizer.ae.ContextDependentTokenizerAnnotator;
import org.apache.ctakes.core.ae.SentenceDetector;
import org.apache.ctakes.core.ae.SimpleSegmentAnnotator;
import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
+import org.apache.ctakes.core.cc.FileTreeXmiWriter;
import org.apache.ctakes.core.cc.XmiWriterCasConsumerCtakes;
+import org.apache.ctakes.core.config.ConfigParameterConstants;
import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
import org.apache.ctakes.dependency.parser.ae.ClearNLPSemanticRoleLabelerAE;
import org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator;
@@ -93,9 +95,11 @@ public abstract class TemporalExtractionPipeline_ImplBase {
protected static AnalysisEngine getXMIWriter(String outputDirectory) throws ResourceInitializationException{
return AnalysisEngineFactory.createEngine(
- XmiWriterCasConsumerCtakes.class,
- XmiWriterCasConsumerCtakes.PARAM_OUTPUTDIR,
- outputDirectory
+// XmiWriterCasConsumerCtakes.class,
+// XmiWriterCasConsumerCtakes.PARAM_OUTPUTDIR,
+ FileTreeXmiWriter.class,
+ ConfigParameterConstants.PARAM_OUTPUTDIR,
+ outputDirectory
);
}
diff --git a/ctakes-type-system/src/main/resources/org/apache/ctakes/typesystem/types/TypeSystem.xml b/ctakes-type-system/src/main/resources/org/apache/ctakes/typesystem/types/TypeSystem.xml
index 829764e..edf4a5d 100644
--- a/ctakes-type-system/src/main/resources/org/apache/ctakes/typesystem/types/TypeSystem.xml
+++ b/ctakes-type-system/src/main/resources/org/apache/ctakes/typesystem/types/TypeSystem.xml
@@ -20,6 +20,19 @@
under the License.
-->
+<!-- The more I look into the type system the less it makes sense.
+ Types that have slots that are populated with relations that refer back to the original object?
+ Why not just populate it with the other argument of the relation?
+ There are attributes and modifiers that are actually under-representations of full events/mentions.
+ e.g. medicationAllergy. Allergy is a "disorder". Why annotate a span twice?
+ e.g. "associatedSignSymptom" takes a ManifestationOf relation. It seems -obvious- this should be just a S/S type.
+ As that associatedSignSymptom, why is the slot for just 1? D/D can have multiple S/S.
+ Why do some Types use TimeMention to fill a slot when other same-level types use DateMention?
+ Not to mention that the naming is inconsistent.
+ Why is Medication Duration an attribute/modifier while all the other durations are temporalRelations?
+ The Type System was put together piecemeal over a long time, it is "living".
+ TODO: Add, Deprecate, migrate code, then get rid of -nonsense-.
+ -->
<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
<name>org.apache.ctakes.typesystem.types.TypeSystem</name>
<description>This is a Apache cTAKES Common Type System for clinical NLP. It includes general types necessary to store annotations and interface with clinical element models</description>
@@ -654,7 +667,9 @@ More qualifying information on how the procedure was done.</description>
<description>This is an Event from the UMLS semantic group of Chemicals and Drugs, pruned by RxNORM source. Based on generic Clinical Element Models (CEMs)</description>
<supertypeName>org.apache.ctakes.typesystem.type.refsem.Event</supertypeName>
<features>
- <featureDescription>
+ <!-- features named Medication* are Deprecated in v5.
+ Please migrate all references to non-Medication specific types. -->
+ <featureDescription>
<name>medicationFrequency</name>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.refsem.MedicationFrequency</rangeTypeName>
@@ -704,6 +719,48 @@ More qualifying information on how the procedure was done.</description>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalRelation</rangeTypeName>
</featureDescription>
+ <!-- New in ctakes 5 -->
+ <featureDescription>
+ <name>dosageCount</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.DosageCount</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>dose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Dose</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>totalDose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.TotalDose</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>form</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Form</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>route</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Route</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>frequency</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Frequency</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>duration</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Duration</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>statusChange</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.StatusChange</rangeTypeName>
+ </featureDescription>
+
</features>
</typeDescription>
<typeDescription>
@@ -722,6 +779,7 @@ More qualifying information on how the procedure was done.</description>
<rangeTypeName>org.apache.ctakes.typesystem.type.refsem.BodySide</rangeTypeName>
</featureDescription>
<featureDescription>
+ <!-- Why is this a relation? This procedure will be an argument in the relation! Why not just the Anatomic Site? -->
<name>bodyLocation</name>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.relation.LocationOf</rangeTypeName>
@@ -731,11 +789,12 @@ More qualifying information on how the procedure was done.</description>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.refsem.ProcedureDevice</rangeTypeName>
</featureDescription>
- <featureDescription>
- <name>duration</name>
- <description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalRelation</rangeTypeName>
- </featureDescription>
+<!-- <featureDescription>-->
+<!-- Changed to Duration Attribute. I don't know why this was special as a relation. This procedure would be an arg. -->
+<!-- <name>duration</name>-->
+<!-- <description/>-->
+<!-- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalRelation</rangeTypeName>-->
+<!-- </featureDescription>-->
<featureDescription>
<name>endTime</name>
<description/>
@@ -756,6 +815,48 @@ More qualifying information on how the procedure was done.</description>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalRelation</rangeTypeName>
</featureDescription>
+ <!-- New in ctakes 5 -->
+ <featureDescription>
+ <name>dosageCount</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.DosageCount</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>dose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Dose</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>totalDose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.TotalDose</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>form</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Form</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>route</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Route</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>frequency</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Frequency</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>duration</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Duration</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>statusChange</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.StatusChange</rangeTypeName>
+ </featureDescription>
+
</features>
</typeDescription>
<typeDescription>
@@ -1786,6 +1887,9 @@ This instantiates a manages/treats relation which should be marked as conditiona
</featureDescription>
</features>
</typeDescription>
+
+ <!-- MedicationEventMention is Deprecated in v5.
+ Please migrate all references to Medication type. If it has a span it should be a MedicationMention. -->
<typeDescription>
<name>org.apache.ctakes.typesystem.type.textsem.MedicationEventMention</name>
<description>Deprecated. As of cTAKEs 3.1, see org.apache.ctakes.typesystem.type.textsem.MedicationMention.</description>
@@ -1838,7 +1942,10 @@ This instantiates a manages/treats relation which should be marked as conditiona
</featureDescription>
</features>
</typeDescription>
- <typeDescription>
+ <!-- MedicationEventMention is Deprecated in v5.
+ Please migrate all references to Medication type. If it has a span it should be a MedicationMention. -->
+
+ <typeDescription>
<name>org.apache.ctakes.typesystem.type.textsem.TimeMention</name>
<description>A text string (IdentifiedAnnotation) that refers to a Time (i.e., TIMEX3).</description>
<supertypeName>org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation</supertypeName>
@@ -2220,10 +2327,13 @@ More qualifying information on how the procedure was done.</description>
<supertypeName>org.apache.ctakes.typesystem.type.textsem.EventMention</supertypeName>
<features>
<featureDescription>
+ <!-- Is medicationAllergy a necessary modifier? Allergy is a disease/disorder. -->
<name>medicationAllergy</name>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.textsem.MedicationAllergyModifier</rangeTypeName>
</featureDescription>
+ <!-- features named Medication* are Deprecated in v5.
+ Please migrate all references to non-Medication specific types. -->
<featureDescription>
<name>medicationFrequency</name>
<description/>
@@ -2274,6 +2384,47 @@ More qualifying information on how the procedure was done.</description>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalTextRelation</rangeTypeName>
</featureDescription>
+ <!-- New in ctakes 5 -->
+ <featureDescription>
+ <name>dosageCount</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.DosageCountModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>dose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.DoseModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>totalDose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.TotalDoseModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>form</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.FormModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>route</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.RouteModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>frequency</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.FrequencyModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>duration</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.DurationModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>statusChange</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.StatusChangeModifier</rangeTypeName>
+ </featureDescription>
</features>
</typeDescription>
<typeDescription>
@@ -2301,11 +2452,12 @@ More qualifying information on how the procedure was done.</description>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.textsem.ProcedureDeviceModifier</rangeTypeName>
</featureDescription>
- <featureDescription>
- <name>duration</name>
- <description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalTextRelation</rangeTypeName>
- </featureDescription>
+<!-- <featureDescription>-->
+<!-- Changed to Duration Modifier. I don't know why this was special as a relation. This procedure would be an arg. -->
+<!-- <name>duration</name>-->
+<!-- <description/>-->
+<!-- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalTextRelation</rangeTypeName>-->
+<!-- </featureDescription>-->
<featureDescription>
<name>endTime</name>
<description/>
@@ -2326,6 +2478,47 @@ More qualifying information on how the procedure was done.</description>
<description/>
<rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalTextRelation</rangeTypeName>
</featureDescription>
+ <!-- New in ctakes 5 -->
+ <featureDescription>
+ <name>dosageCount</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.DosageCountModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>dose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.DoseModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>totalDose</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.TotalDoseModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>form</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.FormModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>route</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.RouteModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>frequency</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.FrequencyModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>duration</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.DurationModifier</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>statusChange</name>
+ <description/>
+ <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.StatusChangeModifier</rangeTypeName>
+ </featureDescription>
</features>
</typeDescription>
<typeDescription>
@@ -2523,93 +2716,183 @@ More qualifying information on how the procedure was done.</description>
</featureDescription>
</features>
</typeDescription>
+
+ <!-- Medication attributes do not really account for things like:
+ "1.5 pills in the morning and 1 pill in the evening."
+ There are two dosageCounts: 1.5 and 1. The frequency is 2 / day.
+ Should it be split into 2 medications? 1.5 pill x 1 / day and 1 pill x 1 / day ? -->
+
+ <!-- Replacements for Medication*** attribute types. They also apply to Procedures. -->
+ <!-- One 10 mg Pill by Mouth 4 times per day for one month starting today. -->
+ <!-- [dosage count] [dose] [form] [route] [frequency] [duration] [status change] -->
<typeDescription>
- <name>org.apache.ctakes.typesystem.type.refsem.Regimen</name>
- <description>A Therapeutic or Preventive Procedure that consists of individual notable events. No Text Span.</description>
- <supertypeName>org.apache.ctakes.typesystem.type.refsem.Event</supertypeName>
+ <!-- !! Note that the original attribute name "Dosage" can be confusing !!
+ Dosage is actually the whole Dose, Frequency, Duration, etc. expression. So this is really a "count of Dosages." -->
+ <name>org.apache.ctakes.typesystem.type.refsem.DosageCount</name>
+ <description>How many Medication or Procedure Dosage expressions. e.g. "one" in "one 5 mg tablet twice-a-day for 2 weeks"</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
<features>
<featureDescription>
- <name>startTime</name>
+ <name>value</name>
<description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Time</rangeTypeName>
- </featureDescription>
- <featureDescription>
- <name>endTime</name>
- <description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.refsem.Time</rangeTypeName>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
+ </features>
+ </typeDescription>
+ <typeDescription>
+ <!-- While this is the "medication strength" per common language, according to the AMA this is "Dose". -->
+ <name>org.apache.ctakes.typesystem.type.refsem.Dose</name>
+ <description>Dose indicates the 'strength' number and unit of a medication or procedure. e.g. 5 mg, 100 cGy, etc.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
+ <features>
<featureDescription>
- <name>duration</name>
+ <name>number</name>
<description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalRelation</rangeTypeName>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
<featureDescription>
- <name>relativeTemporalContext</name>
- <description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalRelation</rangeTypeName>
+ <name>unit</name>
+ <description>the unit of dose measurement</description>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
- <!-- Arrays for Procedures (e.g. RadioTherapy) and Medications (e.g. ChemoTherapy) -->
+ </features>
+ </typeDescription>
+ <typeDescription>
+ <!-- While this is the "medication strength" per common language, according to the AMA this is "Dose". -->
+ <name>org.apache.ctakes.typesystem.type.refsem.TotalDose</name>
+ <description>Indicates the total dose number and unit of a medication or procedure. e.g. Two 5mg tabs = 10mg.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
+ <features>
<featureDescription>
- <name>procedures</name>
+ <name>number</name>
<description/>
- <rangeTypeName>uima.cas.FSArray</rangeTypeName>
- <elementType>org.apache.ctakes.typesystem.type.refsem.Procedure</elementType>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
<featureDescription>
- <name>medications</name>
- <description/>
- <rangeTypeName>uima.cas.FSArray</rangeTypeName>
- <elementType>org.apache.ctakes.typesystem.type.refsem.Medication</elementType>
+ <name>unit</name>
+ <description>the unit of dose measurement</description>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
</features>
</typeDescription>
-
<typeDescription>
- <name>org.apache.ctakes.typesystem.type.textsem.RegimenMention</name>
- <description>A Therapeutic or Preventive Procedure that consists of individual notable events. Text Span.</description>
- <supertypeName>org.apache.ctakes.typesystem.type.textsem.EventMention</supertypeName>
+ <name>org.apache.ctakes.typesystem.type.refsem.Form</name>
+ <description>Form of a medication or procedure. e.g. tablet, brachytherapy, etc.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
<features>
- <!-- Temporal information common to all Regimen types -->
<featureDescription>
- <name>startDate</name>
+ <name>value</name>
<description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.TimeMention</rangeTypeName>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
+ </features>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.refsem.Route</name>
+ <description>Means by which the medication or procedure was taken or administered. e.g. Oral, beam path, etc.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
+ <features>
<featureDescription>
- <name>endDate</name>
+ <name>value</name>
<description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.textsem.TimeMention</rangeTypeName>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
+ </features>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.refsem.Frequency</name>
+ <description>How often a Medication or Procedure should occur. e.g., BID or b.i.d. or "twice-a-day" would have a number=2 and unit=day.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
+ <features>
<featureDescription>
- <name>duration</name>
+ <name>number</name>
<description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalTextRelation</rangeTypeName>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
<featureDescription>
- <name>frequency</name>
- <description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalTextRelation</rangeTypeName>
+ <name>unit</name>
+ <description>The periodic unit used, e.g day, month, hour, etc.</description>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
+ </features>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.refsem.Duration</name>
+ <description>Amount of time over which a medication or procedure should occur. e.g. 2 weeks</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
+ <features>
<featureDescription>
- <name>relativeTemporalContext</name>
+ <name>number</name>
<description/>
- <rangeTypeName>org.apache.ctakes.typesystem.type.relation.TemporalTextRelation</rangeTypeName>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
- <!-- Arrays for Procedures (e.g. RadioTherapy) and Medications (e.g. ChemoTherapy) -->
<featureDescription>
- <name>procedures</name>
- <description/>
- <rangeTypeName>uima.cas.FSArray</rangeTypeName>
- <elementType>org.apache.ctakes.typesystem.type.textsem.ProcedureMention</elementType>
+ <name>unit</name>
+ <description>the unit of time measurement. e.g day, month, hour, etc.</description>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
+ </features>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.refsem.StatusChange</name>
+ <description>Does this Medication or Procedure represent a change in state. e.g. start of use, increase of strength, no change.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.refsem.Attribute</supertypeName>
+ <features>
+ <!-- !! Change can occur for more than one attribute. e.g. strength increase while frequency decrease. -->
<featureDescription>
- <name>medications</name>
- <description/>
- <rangeTypeName>uima.cas.FSArray</rangeTypeName>
- <elementType>org.apache.ctakes.typesystem.type.textsem.MedicationMention</elementType>
+ <name>value</name>
+ <description>Indicates the change status of 'stop', 'start', 'increase', 'decrease', 'noChange', 'boost'.</description>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
</features>
</typeDescription>
+ <!-- Replacements for Medication*** modifier types. They also apply to Procedures. -->
+ <!-- One 10 mg Pill by Mouth 4 times per day for one month starting today. -->
+ <!-- [dosage count] [dose] [form] [route] [frequency] [duration] [status change] -->
+ <typeDescription>
+ <!-- !! Note that the original attribute name "Dosage" can be confusing !!
+ Dosage is actually the whole Dose, Frequency, Duration, etc. expression. So this is really a "count of Dosages." -->
+ <name>org.apache.ctakes.typesystem.type.textsem.DosageCountModifier</name>
+ <description>How many Medication or Procedure Dosage expressions. e.g. "one" in "one 5 mg tablet twice-a-day for 2 weeks"</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.textsem.DoseModifier</name>
+ <description>Dose indicates the 'strength' number and unit of a medication or procedure. e.g. 5 mg, 100 cGy, etc.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.textsem.TotalDoseModifier</name>
+ <description>Indicates the total dose number and unit of a medication or procedure. e.g. Two 5mg tabs = 10mg.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.textsem.FormModifier</name>
+ <description>Form of a medication or procedure. e.g. tablet, brachytherapy, etc.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.textsem.RouteModifier</name>
+ <description>Means by which the medication or procedure was taken or administered. e.g. Oral, beam path, etc.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.textsem.FrequencyModifier</name>
+ <description>How often a Medication or Procedure should occur. e.g., BID or b.i.d. or "twice-a-day" would have a number=2 and unit=day.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.ctakes.typesystem.type.textsem.DurationModifier</name>
+ <description>Amount of time over which a medication or procedure should occur. e.g. 2 weeks</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <!-- !! Change can occur for more than one attribute. e.g. strength increase while frequency decrease. -->
+ <name>org.apache.ctakes.typesystem.type.textsem.StatusChangeModifier</name>
+ <description>Does this Medication or Procedure represent a change in state. e.g. start of use, increase of strength, no change.</description>
+ <supertypeName>org.apache.ctakes.typesystem.type.textsem.Modifier</supertypeName>
+ </typeDescription>
+
</types>
</typeSystemDescription>