Skip to content

Reading Annotations from the Document

In our application we have AnnotationReader Interface which have four abstract methods that are to be implemented by all annotation reader classes so that all the reader classes maintain same template for handling the annotations

AnnotationReader Interface

1
2
3
4
5
6
    public interface AnnotationReader {
        public void init(AnnotatedDocument annotatedDocument , int hospitalId);
        public void readRequiredAnnotationSet(int hospitalId);
        public void processAnnotationSet(int hospitalId);
        public void saveAnnotationSet(int hospitalId);
}  

In the previous session we briefly discussed about reading the annotations from the processed document,that is the processed document is passed to handleDocumentAnnotations method of AnnotationService class,from which annotation reading process is called.From this initAnnotationReadingProcess method we will refer to all the annotationReader classes

Deleting Analysis Data on the document while re running

First and foremost we refer to DeleteAnalysisDataWhileRerun class whose main intention is to delete all the data related to the document in all the tables of the database so as to avoid the duplication of entries into the database while re running the document through all the annotation readers

Stored procedure which is used to delete all the data related to the document from the database is NLP_DeleteDataByDocument.

SectionHeader Annotation Reader

Main objective:

This class is mainly intended to read the "section Header " related annotations from the processed document and save their features to the database.

Annotations Required For This Reader:

    1. SectionHeader
    2. SectionHeader2

Main features that are to be extracted from annotations:

    1. name

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into NLP_SectionHeader table

DiseaseMedicalConcept Annotation Reader

Main objective:

The main intention of this class is to get all the disease related annotations from the processed document and save their features to the database.

Annotations Required For This Reader:

    AllDis

Main features that are to be extracted from annotations:

  1. DiseaseType
  2. Content
  3. Finding
  4. History
  5. Heading

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into NLP_MedicalConcept table

AbsoluteOpMedicalConcept Annotation Reader

Main objective:

This class is mainly intended to read the procedure related medical concepts from the processed document and save their features to the database.

Annotations Required For This Reader:

    AbsoluteOp

Main features that are to be extracted from annotations:

    content

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into NLP_MedicalConcept table

KeyFeaturesMedicalConcept Annotation Reader

Main objective:

This class is mainly intended to read the key terms from the document which are required to get icd10 code combinations and save their features to the database.

Annotations Required For This Reader:

    KeyFeatures

Main features that are to be extracted from annotations:

  1. content
  2. type

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into NLP_MedicalConcept table

PcsMedicalConcept Annotation Reader

Main objective:

The main intention of this class is to read all the medical concepts related to procedure coding system(PCS) and save their features to the database

Annotations Required For This Reader:

  1. PCS3
  2. PCS4

Main features that are to be extracted from annotations:

  1. finding
  2. history
  3. content

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into NLP_MedicalConcept table

RadiologyMedicalConcept Annotation Reader

Main objective:

This class is mainly intended to read all the diseases ,findings and sign or symptoms from radiology reports(type of document) and save their features to database.

Annotations Required For This Reader:

  1. RadDis

Main features that are to be extracted from annotations:

  1. DiseaseType
  2. Content
  3. Finding
  4. History
  5. Heading

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into NLP_MedicalConcept table

FreeTextLab Annotation Reader

Main objective:

This class is mainly intended to read all the laboratory data related annotations from the processed document and save their features to database.

Annotations Required For This Reader:

  1. LaboratoryData

Main features that are to be extracted from annotations:

  1. LabTest
  2. Lab
  3. Value
  4. SecHeading
  5. transcriptionDataTime

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into NLP_Lab table

CdaLab Annotation Reader

Main objective:

This class is mainly intended to read all the laboratory related data which is in tabular format from the processed document

Annotations Required For This Reader:

  1. AllPdocLabs

Main features that are to be extracted from annotations:

  1. order
  2. test
  3. Value
  4. refRange
  5. comment
  6. status
  7. collection

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into CDA_Lab table

HomeMedication Annotation Reader

Main objective:

This class is mainly intended to read all the information regarding medications from the processed document and save it to database.

Annotations Required For This Reader:

  1. PdocHomeMedication

Main features that are to be extracted from annotations:

  1. dosage
  2. route
  3. freq(frequency)
  4. duration
  5. prn( fill-in work by a nurse)
  6. prnreason
  7. Dischargedosedue
  8. sd(start date)
  9. sectionHeading

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into CDA_HomeMedication table

InPatientMedication Annotation Reader

Main objective:

This class is mainly intended to read all the information regarding medications which are under the heading Inpatient medications from the processed document and save them database.

Annotations Required For This Reader:

  1. PdocIPMedication

Main features that are to be extracted from annotations:

  1. order(status of order)
  2. pstatus
  3. medidesc(medication description)
  4. medifreq(frequency)
  5. drname(doctor name)
  6. sectionHeading

StoredProcedures:

No stored procedures are used in this Reader

Tables:

Data retrieved from this class is inserted into CDA_IPMedication table

VitalSigns Annotation Reader

Main objective:

This class is mainly intended to read all the vitals related data from the analysed document and save them to database

Annotations Required For This Reader:

  1. PhysicalExamination2

Main features that are to be extracted from annotations:

  1. vsign
  2. VitalDate
  3. ActValue
  4. NumericResult
  5. SecHeading
  6. transcriptionDataTime

StoredProcedures:

NLP_InsertVitalSign procedure is executed by passing required parameters.

Tables:

Finally the data retrieved is saved to NLP_VitalSign table in the database.

Burns Annotation Reader

Main objective:

This class is mainly intended to read all the information related to burns that is percentage of burnt,level of burn degree etc from the analysed document and save them to database

Annotations Required For This Reader:

  1. Burns
  2. ThirdDegreeBurns
  3. DegreeOfBurns

Main features that are to be extracted from annotations:

  1. burnsPercentage
  2. burnsPercentage1
  3. Content

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertDxAnnotationByDocument and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database

DrugEffects Annotation Reader

Main objective:

This class is mainly intended to read the information regarding drugs incorporated in the document that is the name of the drug ,duration of the drug to show its effect,dosage of the drug taken and also the cause of the effect

Annotations Required For This Reader:

  1. Encounter
  2. DrugDose
  3. DrugCauses
  4. DrugNames

Main features that are to be extracted from annotations:

  1. content(from all above annotations)

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertDrugEffectData and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

DiseasesCausedByDrugs Annotation Reader

Main objective:

This class is mainly intended to read the information about the diseases caused due to the adverse effects of drugs and obtain codes for those diseases.

Annotations Required For This Reader:

  1. DrugDisease
  2. DxDrugFactor

Main features that are to be extracted from annotations:

  1. content(from above annotations)
  2. heading

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertDrugDxCombination and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

NeonatalWeightInfo Annotation Reader

Main objective:

This class is mainly intended to read all the information about the health examination of neonates ,that is newborn weight ,their age ,about prematurity

Annotations Required For This Reader:

  1. NewBornWeight
  2. Birthweight
  3. nbprematurity
  4. NeonatalAge

Main features that are to be extracted from annotations:

  1. Content1
  2. cause1
  3. WtRange
  4. Disease
  5. Weeks

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertDxAnnotationByDocument and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

NeonatalIcdCode Annotation Reader

Main objective:

This class is mainly intended to read all the information about neonatal impression that is all about diseases,cause of disease,findings ,sign or symptom or effected area of the neonates

Annotations Required For This Reader:

  1. NewbornImp

Main features that are to be extracted from annotations:

  1. Disease
  2. Manifestation
  3. Content
  4. Cause
  5. Type
  6. Cause
  7. TConcept1
  8. Finding
  9. Stage
  10. History
  11. Site
  12. Weeks
  13. shname

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertDxAnnotationByDocument and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

ObgIcdCode Annotation Reader

Main objective:

This class is mainly intended to read all the pregnancy related information that is whether pregnancy is occured or not,about the trimesters,calculation of praga and gravida count and the Postpartum information

Annotations Required For This Reader:

  1. Trimesters
  2. Trimester1
  3. Delivered
  4. Postpartum2
  5. Postpartum4
  6. nonpregnant
  7. Gravida
  8. Para

Main features that are to be extracted from annotations:

  1. gravidaCount
  2. keyword(gravida)
  3. parCount
  4. keyword(para)

StoredProcedures:

All the above retrieved pregnancy information is passed to a separate procedure NLP_InsertObgAnnotationByDocument and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

IcdCode Annotation Reader

Main objective:

This class reads all the information regarding the impressions in the document that is all the medical concepts coming under impressions are retrieved .the main intention is to obtain icd10 codes from this retrieved information

Annotations Required For This Reader:

  1. Impression1
  2. Impression2
  3. Impression3
  4. Impression4

Main features that are to be extracted from annotations:

  1. Disease
  2. Manifestation
  3. Content
  4. Cause
  5. Type
  6. TConcept1
  7. TConcept2
  8. Stage
  9. Finding
  10. History
  11. Site
  12. Site1
  13. Site2
  14. Weeks
  15. shname

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertDxAnnotationByDocument and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

Vcode Annotation Reader

Main objective:

This class is intended to read all about annotations describing the accidents in the document that means it reads about type of accident,type of person,mode of transport,injury caused in the accident etc

Annotations Required For This Reader:

  1. VFinalRule

Main features that are to be extracted from annotations:

  1. VictimVehicle
  2. ActualDesc
  3. ActualDesc1
  4. ActualDesc2
  5. OpVehicle
  6. TypeOfPerson
  7. Traffic
  8. Event

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertVseriesCombination and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument and NLP_VSeriesCode in the database.

Wcode Annotation Reader

Main objective:

This class is intended to read all about annotations regarding Slipping, tripping, stumbling and falls that means regarding cause of fall ,type of fall ,about the medium which caused the fall to happen etc are retrieved from the document

Annotations Required For This Reader:

  1. W19series
  2. W00series
  3. W26toW34
  4. W11toW18
  5. W17
  6. W53toW64
  7. W45toW49

Main features that are to be extracted from annotations:

  1. keyterm
  2. keytype
  3. state

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertWSeriesCombination and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument and NLP_WSeriesCode in the database.

Xcode Annotation Reader

Main objective:

This class is mainly intended to read all the annotations that describes about patient being exposed to external sources like smoke ,fire or forces of nature or assault by external forces or self harming.

Annotations Required For This Reader:

  1. X00series

Main features that are to be extracted from annotations:

  1. keyterm
  2. keytype
  3. state
  4. action

StoredProcedures:

All the above retrieved information is also passed to the procedure NLP_InsertWSeriesCombination and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument and NLP_WSeriesCode in the database.

Ycode Annotation Reader

Main objective:

This class is mainly intended to read all the annotations that describes about the abnormality caused because of surgical disorders or medical procedural failure or due to post medical complications or any unspecified external cause.

Annotations Required For This Reader:

  1. YFinalRule

Main features that are to be extracted from annotations:

  1. Activity
  2. Place
  3. state

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertYSeriesCombination and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

SecondaryIcdCode Annotation Reader

Main objective:

Based on the type of section headings this class gets required annotations(all types of medical concepts specific to section heading) from three different annotation readers

  1. ChiefComplaint Annotation Reader
  2. PresentIllness Annotation Reader
  3. PastMedicalHistory Annotation Reader

Annotations Required For This Reader:

  1. Complaint2
  2. Present_Illness2
  3. Past_Medical_History2

Main features that are to be extracted from annotations:

These features are extracted for each type of the above annotations

  1. Disease
  2. Manifestation
  3. Content
  4. Cause
  5. Type
  6. TConcept1
  7. TConcept2
  8. Stage
  9. Finding
  10. History
  11. Site
  12. Site1
  13. Site2
  14. Weeks
  15. shname

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertDxAnnotationByDocument and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

AllergiesDisease Annotation reader

Main objective:

This class is mainly intended to read all information about the allergies caused to the medications or drugs taken by the patient in the document that is about the cause ,severity and reaction of the drug.

Annotations Required For This Reader:

  1. Allergies

Main features that are to be extracted from annotations:

  1. Content
  2. Medicine

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertAllergyDxData and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, data is saved to NLP_Allergy and final codes are saved to NLP_DxCodeByDocument in the database.

CdaAllergies Annotation Reader

Main objective:

This class is mainly intended to read all information about the allergies caused to the medications or drugs taken by the patient in the document which are in tabular format.

Annotations Required For This Reader:

  1. PdocAllergies

Main features that are to be extracted from annotations:

  1. allergy
  2. severity
  3. reaction

StoredProcedures:

No procedures are involved in this class.

Tables:

All the above retrieved information is saved to CDA_Allergy table in database

Habits Annotation Reader

Main objective:

This class is mainly intended to read the information about the patient's habits such as smoking ,alcohol consumption,drugs usage and the quantity and duration of consumption and all the effects caused due to those habits

Annotations Required For This Reader:

  1. Habits6

Main features that are to be extracted from annotations:

  1. allergy
  2. severity
  3. reaction

StoredProcedures:

All the above retrieved information is passed to the procedure NLP_InsertHabitDxData and necessary steps are done in the procedure to calculate codes for the retrieved information

Tables:

After execution of the procedure, final codes are saved to NLP_DxCodeByDocument in the database.

CdaHabits Annotation Reader

Main objective:

This class is mainly intended to read the information which is in the tabular format about the patient's habits such as smoking ,alcohol consumption,drugs usage and the quantity and duration of consumption and all the effects caused due to those habits

Annotations Required For This Reader:

  1. PdocHabits

Main features that are to be extracted from annotations:

  1. substance
  2. usage
  3. freq
  4. duration
  5. packyears
  6. quitdate

StoredProcedures:

No procedure is used in this class

Tables:

All the above retrieved information is saved to CDA_Habit table in the database.