Examples of OntologyConcept


Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

      FSArray ocArr = tokenAnt.getOntologyConceptArr();
      if (ocArr != null)
      {
        for (int i = 0; i < ocArr.size() && !isDrugNER; i++)
        {
          OntologyConcept oc = (OntologyConcept) ocArr.get(i);

          String scheme = oc.getCodingScheme();
          //if (scheme.compareTo("RXNORM") == 0)
          //{
            isDrugNER = true;
          //}
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

   private FSArray createOntologyConceptArr( final JCas jcas, final Collection<String> validCodes ) {
      final String CODING_SCHEME = _properties.getProperty( CODING_SCHEME_PRP_KEY );
      final FSArray ocArr = new FSArray( jcas, validCodes.size() );
      int ocArrIdx = 0;
      for ( String validCode : validCodes ) {
         final OntologyConcept oc = new OntologyConcept( jcas );
         oc.setCode( validCode );
         oc.setCodingScheme( CODING_SCHEME );
         ocArr.set( ocArrIdx, oc );
         ocArrIdx++;
      }
      return ocArr;
   }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

         for ( LookupHit lookupHit : entry.getValue() ) {
            final MetaDataHit mdh = lookupHit.getDictMetaDataHit();
            final String code = mdh.getMetaFieldValue( CODE_MF );
            if ( !codes.contains( code ) ) {
               // create only first entry in the array for a code
               final OntologyConcept oc = new OntologyConcept( jcas );
               oc.setCode( code );
               oc.setCodingScheme( CODING_SCHEME );
               ocArr.set( ocArrIdx, oc );
               ocArrIdx++;
               codes.add( code );
            }
         }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

    // convert code to ontology concept or CUI
    String code = stringSlots.remove("AssociateCode");
    if (code == null) {
      code = stringSlots.remove("associatedCode");
    }
    OntologyConcept ontologyConcept;
    if (mention.getTypeID() == CONST.NE_TYPE_ID_DRUG) {
      ontologyConcept = new OntologyConcept(jCas);
      ontologyConcept.setCode(code);
    } else {
      UmlsConcept umlsConcept = new UmlsConcept(jCas);
      umlsConcept.setCui(code);
      ontologyConcept = umlsConcept;
    }
    ontologyConcept.addToIndexes();
    mention.setOntologyConceptArr(new FSArray(jCas, 1));
    mention.setOntologyConceptArr(0, ontologyConcept);

    // add entity mention to CAS
    mention.addToIndexes();
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

    if (hasConcept)
    {
      firstConceptFS = ontologyConceptArray.get(0);
    }
    //logger.info("hasConcept: " + hasConcept);
    OntologyConcept ontologyConcept = (OntologyConcept)firstConceptFS;
    boolean isRxnorm = false;
    boolean isUmls = false;

    UmlsConcept umlsConcept = null;
    if (ontologyConcept == null)
    {
      // do nothing -- leave isRxnorm and isUmls as false
      return null;
    }
    if (ontologyConcept instanceof UmlsConcept)
    {
      isUmls = true;
      umlsConcept = (UmlsConcept)firstConceptFS;
    } else
    {
      isRxnorm = "RXNORM".equalsIgnoreCase(ontologyConcept.getCodingScheme());
    }
   
    //logger.info(String.format("isUmls: %b; isRxnorm: %b", isUmls, isRxnorm));
   
    if (isRxnorm)
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

//    FSIndexRepository fsIndexRepository = jcas.getFSIndexRepository();
//    fsIndexRepository.addFS();
//    fsIndexRepository.

    FSArray ontologyConceptArray = new FSArray(jcas, 1);
    OntologyConcept ontologyConcept = new OntologyConcept(jcas);
    String codingScheme = null;
    String code = null;
    if (conceptType.equals(ConceptType.TREATMENT))
    {
    codingScheme = "RXNORM";
    code = ConceptLookup.REVERSE_LOOKUP_TREATMENT_TUI;
    } else if (conceptType.equals(ConceptType.PROBLEM))
    {
    codingScheme = "SNOMEDCT";
    code = ConceptLookup.REVERSE_LOOKUP_PROBLEM_TUI;
    } else if (conceptType.equals(ConceptType.TEST))
    {
    codingScheme = "SNOMEDCT";
    code = ConceptLookup.REVERSE_LOOKUP_TEST_TUI;
    } else
    {
    codingScheme = null;
    code = null;
    }
    ontologyConcept.setCode(code);
    ontologyConcept.setCodingScheme(codingScheme);
   
    ontologyConceptArray.set(0,  ontologyConcept);
   
    return ontologyConceptArray;
   
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

      // assign ontology concept OID values
      FSArray ocArr = neAnnot.getOntologyConceptArr();
      if (ocArr != null) {
        for (int i = 0; i < ocArr.size(); i++) {
          OntologyConcept oc = (OntologyConcept) ocArr.get(i);
          String code = oc.getCode();
          String scheme = oc.getCodingScheme();

          StringBuffer oid = new StringBuffer();
          oid.append(code);
          oid.append("#");
          oid.append(scheme);
          oc.setOid(oid.toString());
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

        neEnd = lh.getEndOffset();

        //MetaDataHit mdh = lh.getGazMetaDataHit();
        MetaDataHit mdh = lh.getDictMetaDataHit();
       
        OntologyConcept oc = new OntologyConcept(jcas);
        oc.setCode(mdh.getMetaFieldValue(iv_props.getProperty(CODE_MF_PRP_KEY)));
        oc.setCodingScheme(iv_props.getProperty(CODING_SCHEME_PRP_KEY));

        ocArr.set(ocArrIdx, oc);
        ocArrIdx++;
      }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

        neBegin = lh.getStartOffset();
        neEnd = lh.getEndOffset();
        //MetaDataHit mdh = lh.getGazMetaDataHit();
        MetaDataHit mdh = lh.getDictMetaDataHit();

        OntologyConcept oc = new OntologyConcept(jcas);
        oc.setCode(mdh.getMetaFieldValue(iv_props.getProperty(CODE_MF_PRP_KEY)));
        oc.setCodingScheme(iv_props.getProperty(CODING_SCHEME_PRP_KEY));

        ocArr.set(ocArrIdx, oc);
        ocArrIdx++;
      }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.refsem.OntologyConcept

        neBegin = lh.getStartOffset();
        neEnd = lh.getEndOffset();
        //MetaDataHit mdh = lh.getGazMetaDataHit();
        MetaDataHit mdh = lh.getDictMetaDataHit();

        OntologyConcept oc = new OntologyConcept(jcas);
        oc.setCode(mdh.getMetaFieldValue(iv_props.getProperty(CODE_MF_PRP_KEY)));
        oc.setCodingScheme(iv_props.getProperty(CODING_SCHEME_PRP_KEY));

        ocArr.set(ocArrIdx, oc);
        ocArrIdx++;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.