Class MedExtAnnotator

  • All Implemented Interfaces:
    org.apache.uima.analysis_component.AnalysisComponent

    public class MedExtAnnotator
    extends org.apache.uima.analysis_component.JCasAnnotator_ImplBase
    Associate medication with attributes.
    Author:
    Sunghwan Sohn
    • Constructor Summary

      Constructors 
      Constructor Description
      MedExtAnnotator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int contains​(int b1, int e1, int b2, int e2)
      Returns 1 if 1 contains or equal to 2 Returns 2 if 2 contains or equal to 1 Returns 0 otherwise
      void initialize​(org.apache.uima.UimaContext uimaContext)  
      protected boolean isFalseMed1​(String med)
      Check if the given drug is true or not
      void process​(org.apache.uima.jcas.JCas jcas)  
      protected int[] setWindow​(org.apache.uima.jcas.JCas jcas, de.julielab.jcore.types.medical.Medication drug, int nextDrugBegin, int prevDrugEnd, int windowSpan)
      NOTE THAT THIS IS SPECIFIC FOR MAYO DATA return the offsets: begin of the given drug and the smaller of 1) the end of +2 sentences or 2) begin of the next drug Mayo specific: "BUT if there is newline and it does not start with Instruction or Indication, the end becomes newline"
      • Methods inherited from class org.apache.uima.analysis_component.JCasAnnotator_ImplBase

        getRequiredCasInterface, process
      • Methods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase

        getCasInstancesRequired, hasNext, next
      • Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase

        batchProcessComplete, collectionProcessComplete, destroy, getContext, getResultSpecification, reconfigure, setResultSpecification
    • Constructor Detail

      • MedExtAnnotator

        public MedExtAnnotator()
    • Method Detail

      • initialize

        public void initialize​(org.apache.uima.UimaContext uimaContext)
                        throws org.apache.uima.resource.ResourceInitializationException
        Specified by:
        initialize in interface org.apache.uima.analysis_component.AnalysisComponent
        Overrides:
        initialize in class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
        Throws:
        org.apache.uima.resource.ResourceInitializationException
      • process

        public void process​(org.apache.uima.jcas.JCas jcas)
                     throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
        Specified by:
        process in class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
        Throws:
        org.apache.uima.analysis_engine.AnalysisEngineProcessException
      • setWindow

        protected int[] setWindow​(org.apache.uima.jcas.JCas jcas,
                                  de.julielab.jcore.types.medical.Medication drug,
                                  int nextDrugBegin,
                                  int prevDrugEnd,
                                  int windowSpan)
        NOTE THAT THIS IS SPECIFIC FOR MAYO DATA return the offsets: begin of the given drug and the smaller of 1) the end of +2 sentences or 2) begin of the next drug Mayo specific: "BUT if there is newline and it does not start with Instruction or Indication, the end becomes newline"
        Parameters:
        jcas -
        drug -
        nextDrugBegin -
        Returns:
      • isFalseMed1

        protected boolean isFalseMed1​(String med)
        Check if the given drug is true or not
        Parameters:
        md -
        Returns:
        true if potentially false medication
      • contains

        protected int contains​(int b1,
                               int e1,
                               int b2,
                               int e2)
        Returns 1 if 1 contains or equal to 2 Returns 2 if 2 contains or equal to 1 Returns 0 otherwise