org.apache.ctakes.drugner
Class DrugMention

java.lang.Object
  extended by org.apache.ctakes.drugner.DrugMention
All Implemented Interfaces:
DrugModel

public class DrugMention
extends java.lang.Object
implements DrugModel

Contains information from a single document - is not the result of data mining.


Field Summary
 AssociatedPrimaryCodeElement associatedCodePrimary
           
 AssociatedPrimaryCodeElement associatedCodeSecondary
          terminology unique identifier (e.g.
 DrugChangeStatusElement changeStatus
          aka change.
 ConfidenceScoreElement confidence
           
 DosageElement dosage
          e.g.
 TextMentionElement drugMentionText
          The word(s) in the note that indicate the drug.
 DurationElement duration
          e.g.
 DateToken endDate
           
 boolean findMaxValue
           
 FormElement form
          Span the drug form, if available.
 FrequencyElement frequency
          e.g.
 FrequencyUnitElement frequencyUnit
          e.g.
 RouteElement route
          e.g oral Topical Examples include medications applied onto the skin, asthma medications, enema, eye or ear drops, decongestants, vaginal creams.
 StartDateElement startDate
          If there is a specific date in the note associated with the drug mention, the specific date.
 StrengthElement strength
           
 StrengthUnitElement strengthUnit
          Span the drug form, if available.
 
Constructor Summary
DrugMention(org.apache.uima.jcas.JCas jcas, int beginPos, int endPos)
           
 
Method Summary
 java.lang.String convertFromTextToNum(java.lang.String firstTerm)
           
 java.lang.String convertToChangeStatus(java.lang.String firstTerm)
           
 int getChangeStatusBegin()
           
 int getChangeStatusEnd()
           
 double getConfidenceScoreElement()
           
 int getDosageBegin()
           
 java.lang.String getDosageElement()
           
 int getDosageEnd()
           
 java.lang.String getDrugChangeStatusElement()
           
 int getDuratationBegin()
           
 int getDuratationEnd()
           
 java.lang.String getDurationElement()
           
 java.lang.String getEndDateElement()
           
 int getFormBegin()
           
 java.lang.String getFormElement()
           
 int getFormEnd()
           
 int getFrequencyBegin()
           
 java.lang.String getFrequencyElement()
           
 int getFrequencyEnd()
           
 java.lang.String getFrequencyUnitElement()
           
 int getFUBegin()
           
 int getFUENd()
           
 java.lang.String getPrimaryAssociatedCodeElement()
           
 int getRouteBegin()
           
 java.lang.String getRouteElement()
           
 int getRouteEnd()
           
 java.lang.String getSecondaryAssociatedCodeElement()
           
 java.lang.String getStartDateElement()
           
 int getStrengthBegin()
           
 java.lang.String getStrengthElement()
           
 int getStrengthEnd()
           
 int getStrengthUnitBegin()
           
 java.lang.String getStrengthUnitElement()
           
 int getStrengthUnitEnd()
           
static int indexOfRegex(java.lang.String lookIn, java.util.regex.Pattern lookFor)
          Scan a string for the first occurrence of some regex Pattern.
 double parseDoubleValue(java.lang.Object strength)
           
 int parseIntValue(java.lang.Object strength)
           
 void setConfidenceScoreElement(double score, int beginOffset, int endOffset)
           
 void setDosageElement(java.lang.String dose, int beginOffset, int endOffset)
           
 void setDrugChangeStatusElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setDurationElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setEndDateElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setFormElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setFrequencyElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setFrequencyUnitElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setPrimaryAssociatedCodeElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setRouteElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setSecondaryAssociatedCodeElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setStartDateElement(java.lang.String date, int beginOffset, int endOffset)
           
 void setStrengthElement(java.lang.String name, int beginOffset, int endOffset)
           
 void setStrengthUnitElement(java.lang.String name, int beginOffset, int endOffset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

drugMentionText

public TextMentionElement drugMentionText
The word(s) in the note that indicate the drug.


associatedCodePrimary

public AssociatedPrimaryCodeElement associatedCodePrimary

associatedCodeSecondary

public AssociatedPrimaryCodeElement associatedCodeSecondary
terminology unique identifier (e.g. RxNorm identifier). if not in the terminology, we will use the drug mention as the id.


startDate

public StartDateElement startDate
If there is a specific date in the note associated with the drug mention, the specific date. Also time might be capture by more general markers, e.g. "subsequently".


endDate

public DateToken endDate

dosage

public DosageElement dosage
e.g. 5 mg


frequency

public FrequencyElement frequency
e.g. twice daily


frequencyUnit

public FrequencyUnitElement frequencyUnit
e.g. twice daily


duration

public DurationElement duration
e.g. "for 2 weeks"


route

public RouteElement route
e.g oral Topical Examples include medications applied onto the skin, asthma medications, enema, eye or ear drops, decongestants, vaginal creams. Enteral (oral) Most drugs taken by mouth such as tablets or capsules. Enteral (gastric) Examples include medications given through a gastric or duodenal tube. Enteral (rectal) Drugs in suppositories or enema form. Parenteral (intravenous) Parenteral (intra-arterial) Parenteral (intramuscular) Parenteral (intracardiac) Parenteral (subcutaneous) Medications such as insulin. Parenteral (intrathecal) Into the spinal canal. Parenteral (intraperitoneal) Parenteral (transdermal) Such as patches. Parenteral (transmucosal)


strength

public StrengthElement strength

strengthUnit

public StrengthUnitElement strengthUnit
Span the drug form, if available. The spanned mention needs to be mapped to the standard form available in the dropdown menu. In general don't infer. However, for a medication described in terms of cc or mL, the number of cc's or mL's is usually not a strength - for example "5 cc 0.5%" (or 5 mL 0.5%), indicates a strength of 0.5% -- for those, create a Form, with "cc" or "mL" spanned, and mapped to liquid, so that we capture the unit such as cc or mL.


form

public FormElement form
Span the drug form, if available. The spanned mention needs to be mapped to the standard form available in the dropdown menu. In general don't infer. However, for a medication described in terms of cc or mL, the number of cc's or mL's is usually not a strength - for example "5 cc 0.5%" (or 5 mL 0.5%), indicates a strength of 0.5% -- for those, create a Form, with "cc" or "mL" spanned, and mapped to liquid, so that we capture the unit such as cc or mL.


changeStatus

public DrugChangeStatusElement changeStatus
aka change. - start: refers to an explicit mention of when the drug was started - stop: refers to an explicit mention of when the drug was stopped - increase and decrease: refer to explicit mentions of drug attribute changes - noChange: nothing is explicitly stated regarding changes. This will be the default case and does not need to be created. If there is some mention on the text such as "I told the patient to continue with his dosage of XXX 300 mg", then there would be textual evidence for noChange.


confidence

public ConfidenceScoreElement confidence

findMaxValue

public boolean findMaxValue
Constructor Detail

DrugMention

public DrugMention(org.apache.uima.jcas.JCas jcas,
                   int beginPos,
                   int endPos)
Method Detail

setPrimaryAssociatedCodeElement

public void setPrimaryAssociatedCodeElement(java.lang.String name,
                                            int beginOffset,
                                            int endOffset)
Specified by:
setPrimaryAssociatedCodeElement in interface DrugModel

setSecondaryAssociatedCodeElement

public void setSecondaryAssociatedCodeElement(java.lang.String name,
                                              int beginOffset,
                                              int endOffset)
Specified by:
setSecondaryAssociatedCodeElement in interface DrugModel

setStartDateElement

public void setStartDateElement(java.lang.String date,
                                int beginOffset,
                                int endOffset)
Specified by:
setStartDateElement in interface DrugModel

setEndDateElement

public void setEndDateElement(java.lang.String name,
                              int beginOffset,
                              int endOffset)
Specified by:
setEndDateElement in interface DrugModel

setDosageElement

public void setDosageElement(java.lang.String dose,
                             int beginOffset,
                             int endOffset)
Specified by:
setDosageElement in interface DrugModel

setFrequencyElement

public void setFrequencyElement(java.lang.String name,
                                int beginOffset,
                                int endOffset)
Specified by:
setFrequencyElement in interface DrugModel

setFrequencyUnitElement

public void setFrequencyUnitElement(java.lang.String name,
                                    int beginOffset,
                                    int endOffset)
Specified by:
setFrequencyUnitElement in interface DrugModel

setFormElement

public void setFormElement(java.lang.String name,
                           int beginOffset,
                           int endOffset)
Specified by:
setFormElement in interface DrugModel

setDurationElement

public void setDurationElement(java.lang.String name,
                               int beginOffset,
                               int endOffset)
Specified by:
setDurationElement in interface DrugModel

setRouteElement

public void setRouteElement(java.lang.String name,
                            int beginOffset,
                            int endOffset)
Specified by:
setRouteElement in interface DrugModel

setDrugChangeStatusElement

public void setDrugChangeStatusElement(java.lang.String name,
                                       int beginOffset,
                                       int endOffset)
Specified by:
setDrugChangeStatusElement in interface DrugModel

setConfidenceScoreElement

public void setConfidenceScoreElement(double score,
                                      int beginOffset,
                                      int endOffset)
Specified by:
setConfidenceScoreElement in interface DrugModel

setStrengthElement

public void setStrengthElement(java.lang.String name,
                               int beginOffset,
                               int endOffset)
Specified by:
setStrengthElement in interface DrugModel

getStrengthUnitElement

public java.lang.String getStrengthUnitElement()
Specified by:
getStrengthUnitElement in interface DrugModel

setStrengthUnitElement

public void setStrengthUnitElement(java.lang.String name,
                                   int beginOffset,
                                   int endOffset)
Specified by:
setStrengthUnitElement in interface DrugModel

getPrimaryAssociatedCodeElement

public java.lang.String getPrimaryAssociatedCodeElement()
Specified by:
getPrimaryAssociatedCodeElement in interface DrugModel

getSecondaryAssociatedCodeElement

public java.lang.String getSecondaryAssociatedCodeElement()
Specified by:
getSecondaryAssociatedCodeElement in interface DrugModel

getStartDateElement

public java.lang.String getStartDateElement()
Specified by:
getStartDateElement in interface DrugModel

getEndDateElement

public java.lang.String getEndDateElement()
Specified by:
getEndDateElement in interface DrugModel

getDosageElement

public java.lang.String getDosageElement()
Specified by:
getDosageElement in interface DrugModel

getFrequencyElement

public java.lang.String getFrequencyElement()
Specified by:
getFrequencyElement in interface DrugModel

getFrequencyUnitElement

public java.lang.String getFrequencyUnitElement()
Specified by:
getFrequencyUnitElement in interface DrugModel

getFormElement

public java.lang.String getFormElement()
Specified by:
getFormElement in interface DrugModel

getDurationElement

public java.lang.String getDurationElement()
Specified by:
getDurationElement in interface DrugModel

getRouteElement

public java.lang.String getRouteElement()
Specified by:
getRouteElement in interface DrugModel

getDrugChangeStatusElement

public java.lang.String getDrugChangeStatusElement()
Specified by:
getDrugChangeStatusElement in interface DrugModel

getStrengthElement

public java.lang.String getStrengthElement()
Specified by:
getStrengthElement in interface DrugModel

getConfidenceScoreElement

public double getConfidenceScoreElement()
Specified by:
getConfidenceScoreElement in interface DrugModel

parseIntValue

public int parseIntValue(java.lang.Object strength)

parseDoubleValue

public double parseDoubleValue(java.lang.Object strength)

convertFromTextToNum

public java.lang.String convertFromTextToNum(java.lang.String firstTerm)

convertToChangeStatus

public java.lang.String convertToChangeStatus(java.lang.String firstTerm)

getDosageBegin

public int getDosageBegin()

getDosageEnd

public int getDosageEnd()

getFrequencyBegin

public int getFrequencyBegin()

getFrequencyEnd

public int getFrequencyEnd()

getFUBegin

public int getFUBegin()

getFUENd

public int getFUENd()

getFormBegin

public int getFormBegin()

getFormEnd

public int getFormEnd()

getDuratationBegin

public int getDuratationBegin()

getDuratationEnd

public int getDuratationEnd()

getRouteBegin

public int getRouteBegin()

getRouteEnd

public int getRouteEnd()

getStrengthUnitBegin

public int getStrengthUnitBegin()

getStrengthUnitEnd

public int getStrengthUnitEnd()

getStrengthBegin

public int getStrengthBegin()

getStrengthEnd

public int getStrengthEnd()

getChangeStatusBegin

public int getChangeStatusBegin()

getChangeStatusEnd

public int getChangeStatusEnd()

indexOfRegex

public static int indexOfRegex(java.lang.String lookIn,
                               java.util.regex.Pattern lookFor)
Scan a string for the first occurrence of some regex Pattern.

Parameters:
lookForAlpha - the pattern to look for
lookIn - the String to scan.
Returns:
offset relative to start of lookIn where it first found the pattern, -1 if not found.