You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by ja...@apache.org on 2013/07/01 19:28:08 UTC

svn commit: r1498581 - in /ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae: OrangeBookFilterConsumerImpl.java UmlsToSnomedConsumerImpl.java

Author: james-masanz
Date: Mon Jul  1 17:28:07 2013
New Revision: 1498581

URL: http://svn.apache.org/r1498581
Log:
CTAKES-190 - more related to MedicationMention being used instead of MedicationEventMention as of 3.1. (Will make several separate commits because of timeouts occurring while svn is temporarily routed through EU)

Modified:
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java?rev=1498581&r1=1498580&r2=1498581&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java (original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/OrangeBookFilterConsumerImpl.java Mon Jul  1 17:28:07 2013
@@ -24,7 +24,7 @@ import org.apache.ctakes.dictionary.look
 import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.refsem.OntologyConcept;
 import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
-import org.apache.ctakes.typesystem.type.textsem.MedicationEventMention;
+import org.apache.ctakes.typesystem.type.textsem.MedicationMention;
 import org.apache.log4j.Logger;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.*;
@@ -99,7 +99,7 @@ public class OrangeBookFilterConsumerImp
                validCodes.add( code );
             }
             final FSArray ocArr = createOntologyConceptArr( jcas, validCodes );
-            IdentifiedAnnotation neAnnot = new MedicationEventMention( jcas ); // medication NEs are EventMention
+            IdentifiedAnnotation neAnnot = new MedicationMention( jcas ); // medication NEs are EventMention
             neAnnot.setTypeID( CONST.NE_TYPE_ID_DRUG );
             neAnnot.setBegin( neBegin );
             neAnnot.setEnd( neEnd );

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java?rev=1498581&r1=1498580&r2=1498581&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java (original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedConsumerImpl.java Mon Jul  1 17:28:07 2013
@@ -98,100 +98,6 @@ public abstract class UmlsToSnomedConsum
    protected abstract Set<String> getSnomedCodes( final String umlsCode ) throws SQLException, DictionaryException;
 
 
-//   /**
-//    * {@inheritDoc}
-//    */
-//   @Override
-//   public void consumeHits( final JCas jcas, final Iterator<LookupHit> lhItr ) throws AnalysisEngineProcessException {
-//      try {
-//         final String cuiPropKey = props.getProperty( CUI_MF_PRP_KEY );
-//         final String tuiPropKey = props.getProperty( TUI_MF_PRP_KEY );
-//         final Iterator hitsByOffsetItr = organizeByOffset( lhItr );
-//         while ( hitsByOffsetItr.hasNext() ) {
-//            final Collection hitsAtOffsetCol = (Collection) hitsByOffsetItr.next();
-//
-//            // Iterate over the LookupHit objects and group Snomed codes by NE type
-//            // For each NE type for which there is a hit, get all the Snomed codes
-//            // that map to the given CUI.
-//
-//            // Use key "cui,tui" to avoid duplicates at this offset
-//            final Set<String> cuiTuiSet = new HashSet<String>();
-//
-//            // key = type of named entity (java.lang.Integer)
-//            // val = set of UmlsConcept objects (java.util.Set)
-//            final Map<Integer,Set<UmlsConcept>> conceptMap = new HashMap<Integer,Set<UmlsConcept>>();
-//
-//            final Iterator lhAtOffsetItr = hitsAtOffsetCol.iterator();
-//            int neBegin = -1;
-//            int neEnd = -1;
-//            while ( lhAtOffsetItr.hasNext() ) {
-//               final LookupHit lh = (LookupHit) lhAtOffsetItr.next();
-//               neBegin = lh.getStartOffset();
-//               neEnd = lh.getEndOffset();
-//
-//               final MetaDataHit mdh = lh.getDictMetaDataHit();
-//               final String cui = mdh.getMetaFieldValue( cuiPropKey );
-//               final String tui = mdh.getMetaFieldValue( tuiPropKey );
-//
-//               //String text = lh.getDictMetaDataHit().getMetaFieldValue("text");
-//               if ( !_validTuiSet.contains( tui ) ) {
-//                  continue;
-//               }
-//               final String cuiTuiKey = getUniqueKey( cui, tui );
-//               if ( cuiTuiSet.contains( cuiTuiKey ) ) {
-//                  continue;
-//               }
-//               cuiTuiSet.add( cuiTuiKey );
-//               final Set<String> snomedCodeSet = getSnomedCodes( cui );
-//               if ( !snomedCodeSet.isEmpty() ) {
-//                  final Integer neType = getNamedEntityType( tui );
-//                  Set<UmlsConcept> conceptSet;
-//                  if ( conceptMap.containsKey( neType ) ) {
-//                     conceptSet = conceptMap.get( neType );
-//                  } else {
-//                     conceptSet = new HashSet<UmlsConcept>();
-//                  }
-//                  final Collection<UmlsConcept> conceptCol = createConceptCol( jcas, cui, tui, snomedCodeSet );
-//                  conceptSet.addAll( conceptCol );
-//                  conceptMap.put( neType, conceptSet );
-//               }
-//            }
-//
-//            final Collection<Integer> conceptKeys = conceptMap.keySet();
-//            for ( Integer conceptKey : conceptKeys ) {
-//               final Set<UmlsConcept> conceptSet = conceptMap.get( conceptKey );
-//
-//               // Skip updating CAS if all Concepts for this type were filtered out
-//               // for this span.
-//               if ( !conceptSet.isEmpty() ) {
-//                  FSArray conceptArr = new FSArray( jcas, conceptSet.size() );
-//                  int arrIdx = 0;
-//                  for ( UmlsConcept umlsConcept : conceptSet ) {
-//                     conceptArr.set( arrIdx, umlsConcept );
-//                     arrIdx++;
-//                  }
-//
-//                  IdentifiedAnnotation neAnnot;
-//                  if ( conceptKey == CONST.NE_TYPE_ID_DRUG ) {
-//                     neAnnot = new MedicationEventMention( jcas );
-//                  } else {
-//                     neAnnot = new EntityMention( jcas );
-//                  }
-//                  neAnnot.setTypeID( conceptKey );
-//                  neAnnot.setBegin( neBegin );
-//                  neAnnot.setEnd( neEnd );
-//                  neAnnot.setDiscoveryTechnique( CONST.NE_DISCOVERY_TECH_DICT_LOOKUP );
-//                  neAnnot.setOntologyConceptArr( conceptArr );
-//                  neAnnot.addToIndexes();
-//               }
-//            }
-//         }
-//      } catch ( Exception e ) {
-//         throw new AnalysisEngineProcessException( e );
-//      }
-//   }
-
-
    /**
     * {@inheritDoc}
     */