You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by st...@apache.org on 2013/02/15 00:52:18 UTC

svn commit: r1446403 - /incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java

Author: stevenbethard
Date: Thu Feb 14 23:52:17 2013
New Revision: 1446403

URL: http://svn.apache.org/r1446403
Log:
Adds support for parsing allergy indicator normalized form

Modified:
    incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java

Modified: incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java?rev=1446403&r1=1446402&r2=1446403&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java (original)
+++ incubator/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java Thu Feb 14 23:52:17 2013
@@ -1030,9 +1030,20 @@ public class SHARPKnowtatorXMLReader ext
         // already handled in "Value" above
 
       } else if ("allergy_indicator_class".equals(annotation.type)) {
-        // TODO: where does this code go?
-        String code = stringSlots.remove("allergy_indicator_normalization");
+        String value = stringSlots.remove("allergy_indicator_normalization");
         MedicationAllergyModifier modifier = new MedicationAllergyModifier(jCas, coveringSpan.begin, coveringSpan.end);
+        if (null == value) {
+          modifier.setIndicated(false);
+        } else if ("indicator_present".equals(value)) {
+          modifier.setIndicated(true);
+        } else if ("indicator_absent".equals(value)) {
+          modifier.setIndicated(false);
+        } else {
+          LOGGER.error(String.format(
+              "unrecognized allergy-indicator value \"%s\" on annotation with id \"%s\"",
+              value,
+              annotation.id));
+        }
         modifier.addToIndexes();
         idAnnotationMap.put(annotation.id, modifier);