org.apache.ctakes.preprocessor
Class ClinicalNotePreProcessor

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.ctakes.preprocessor.ClinicalNotePreProcessor
All Implemented Interfaces:
PreProcessor, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class ClinicalNotePreProcessor
extends org.xml.sax.helpers.DefaultHandler
implements PreProcessor

Given an HL7 document, the text contained inside a section is extracted.

Author:
Mayo

Field Summary
static String MD_KEY_ADMIT_DATE
           
static String MD_KEY_CUSTOMER_ID
           
static String MD_KEY_DISCHARGE_DATE
           
static String MD_KEY_DOC_CONFIDENTIAL_IND
           
static String MD_KEY_DOC_ID
           
static String MD_KEY_DOC_LINK_ID
           
static String MD_KEY_DOC_REVISION_ID
           
static String MD_KEY_DOC_STATUS_CODE
           
static String MD_KEY_EVENT_TYPE_CODE
           
static String MD_KEY_FACILITY_CODE
           
static String MD_KEY_HISTORY_SECTION
           
static String MD_KEY_LOCATION
           
static String MD_KEY_MINUTES_COUNSELING
           
static String MD_KEY_NOTE_DATE
           
static String MD_KEY_PATIENT_CITY
           
static String MD_KEY_PATIENT_CNT
           
static String MD_KEY_PATIENT_STATE
           
static String MD_KEY_PATIENT_STREET_ADDR
           
static String MD_KEY_PATIENT_ZIP
           
static String MD_KEY_PROVIDER_ID
           
static String MD_KEY_PROVIDER2_ID
           
static String MD_KEY_PT_BILLING_CODE
           
static String MD_KEY_PT_BIRTH_DATE
           
static String MD_KEY_PT_BMI
           
static String MD_KEY_PT_BSA
           
static String MD_KEY_PT_GENDER
           
static String MD_KEY_PT_HEAD_CIRCUMFERENCE
           
static String MD_KEY_PT_HEIGHT
           
static String MD_KEY_PT_RESPIRATORY_RATE
           
static String MD_KEY_PT_TEMPERATURE
           
static String MD_KEY_PT_WEIGHT
           
static String MD_KEY_REV_DATE
           
static String MD_KEY_SERVICE_CODE
           
static String MD_KEY_SIGNATURE_DATE
           
static String MD_KEY_SIGNATURE_ID
           
static String MD_KEY_SITE_CODE
           
static String MD_KEY_TOTAL_TIME
           
static String MD_KEY_TRANSCRIBER_ID
           
static String MD_KEY_TRANSCRIPTION_DATE
           
static int UNKNOWN_TABLE_TYPE
           
 
Constructor Summary
ClinicalNotePreProcessor(File dtdFile, boolean includeSectionMarkers)
          Constructor
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 DocumentMetaData process(String xml)
          Process a document to retrieve meta data about the document.
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MD_KEY_PATIENT_STREET_ADDR

public static final String MD_KEY_PATIENT_STREET_ADDR
See Also:
Constant Field Values

MD_KEY_PATIENT_CITY

public static final String MD_KEY_PATIENT_CITY
See Also:
Constant Field Values

MD_KEY_PATIENT_STATE

public static final String MD_KEY_PATIENT_STATE
See Also:
Constant Field Values

MD_KEY_PATIENT_ZIP

public static final String MD_KEY_PATIENT_ZIP
See Also:
Constant Field Values

MD_KEY_PATIENT_CNT

public static final String MD_KEY_PATIENT_CNT
See Also:
Constant Field Values

MD_KEY_DOC_ID

public static final String MD_KEY_DOC_ID
See Also:
Constant Field Values

MD_KEY_DOC_LINK_ID

public static final String MD_KEY_DOC_LINK_ID
See Also:
Constant Field Values

MD_KEY_DOC_REVISION_ID

public static final String MD_KEY_DOC_REVISION_ID
See Also:
Constant Field Values

MD_KEY_NOTE_DATE

public static final String MD_KEY_NOTE_DATE
See Also:
Constant Field Values

MD_KEY_REV_DATE

public static final String MD_KEY_REV_DATE
See Also:
Constant Field Values

MD_KEY_ADMIT_DATE

public static final String MD_KEY_ADMIT_DATE
See Also:
Constant Field Values

MD_KEY_DISCHARGE_DATE

public static final String MD_KEY_DISCHARGE_DATE
See Also:
Constant Field Values

MD_KEY_SERVICE_CODE

public static final String MD_KEY_SERVICE_CODE
See Also:
Constant Field Values

MD_KEY_SITE_CODE

public static final String MD_KEY_SITE_CODE
See Also:
Constant Field Values

MD_KEY_FACILITY_CODE

public static final String MD_KEY_FACILITY_CODE
See Also:
Constant Field Values

MD_KEY_PT_BIRTH_DATE

public static final String MD_KEY_PT_BIRTH_DATE
See Also:
Constant Field Values

MD_KEY_PT_HEIGHT

public static final String MD_KEY_PT_HEIGHT
See Also:
Constant Field Values

MD_KEY_PT_WEIGHT

public static final String MD_KEY_PT_WEIGHT
See Also:
Constant Field Values

MD_KEY_PT_HEAD_CIRCUMFERENCE

public static final String MD_KEY_PT_HEAD_CIRCUMFERENCE
See Also:
Constant Field Values

MD_KEY_PT_GENDER

public static final String MD_KEY_PT_GENDER
See Also:
Constant Field Values

MD_KEY_PT_BMI

public static final String MD_KEY_PT_BMI
See Also:
Constant Field Values

MD_KEY_PT_BSA

public static final String MD_KEY_PT_BSA
See Also:
Constant Field Values

MD_KEY_PT_TEMPERATURE

public static final String MD_KEY_PT_TEMPERATURE
See Also:
Constant Field Values

MD_KEY_PT_BILLING_CODE

public static final String MD_KEY_PT_BILLING_CODE
See Also:
Constant Field Values

MD_KEY_PT_RESPIRATORY_RATE

public static final String MD_KEY_PT_RESPIRATORY_RATE
See Also:
Constant Field Values

MD_KEY_EVENT_TYPE_CODE

public static final String MD_KEY_EVENT_TYPE_CODE
See Also:
Constant Field Values

MD_KEY_DOC_CONFIDENTIAL_IND

public static final String MD_KEY_DOC_CONFIDENTIAL_IND
See Also:
Constant Field Values

MD_KEY_DOC_STATUS_CODE

public static final String MD_KEY_DOC_STATUS_CODE
See Also:
Constant Field Values

MD_KEY_HISTORY_SECTION

public static final String MD_KEY_HISTORY_SECTION
See Also:
Constant Field Values

MD_KEY_LOCATION

public static final String MD_KEY_LOCATION
See Also:
Constant Field Values

MD_KEY_MINUTES_COUNSELING

public static final String MD_KEY_MINUTES_COUNSELING
See Also:
Constant Field Values

MD_KEY_TOTAL_TIME

public static final String MD_KEY_TOTAL_TIME
See Also:
Constant Field Values

MD_KEY_PROVIDER_ID

public static final String MD_KEY_PROVIDER_ID
See Also:
Constant Field Values

MD_KEY_PROVIDER2_ID

public static final String MD_KEY_PROVIDER2_ID
See Also:
Constant Field Values

MD_KEY_SIGNATURE_ID

public static final String MD_KEY_SIGNATURE_ID
See Also:
Constant Field Values

MD_KEY_SIGNATURE_DATE

public static final String MD_KEY_SIGNATURE_DATE
See Also:
Constant Field Values

MD_KEY_TRANSCRIBER_ID

public static final String MD_KEY_TRANSCRIBER_ID
See Also:
Constant Field Values

MD_KEY_TRANSCRIPTION_DATE

public static final String MD_KEY_TRANSCRIPTION_DATE
See Also:
Constant Field Values

MD_KEY_CUSTOMER_ID

public static final String MD_KEY_CUSTOMER_ID
See Also:
Constant Field Values

UNKNOWN_TABLE_TYPE

public static final int UNKNOWN_TABLE_TYPE
See Also:
Constant Field Values
Constructor Detail

ClinicalNotePreProcessor

public ClinicalNotePreProcessor(File dtdFile,
                                boolean includeSectionMarkers)
                         throws SAXException,
                                FileNotFoundException
Constructor

Parameters:
dtdFile - File object pointing to DTD.
includeSectionMarkers - Flag that determines whether the section markers are included as part of the section.
Throws:
SAXException
FileNotFoundException
Method Detail

process

public DocumentMetaData process(String xml)
                         throws Exception
Description copied from interface: PreProcessor
Process a document to retrieve meta data about the document.

Specified by:
process in interface PreProcessor
Returns:
Throws:
Exception

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException
See Also:
ContentHandler.startDocument()

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException
See Also:
ContentHandler.endDocument()


Copyright © 2012-2013 The Apache Software Foundation. All Rights Reserved.