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 | |
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:
- DiseaseType
- Content
- Finding
- History
- 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:
- content
- 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:
- PCS3
- PCS4
Main features that are to be extracted from annotations:
- finding
- history
- 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:
- RadDis
Main features that are to be extracted from annotations:
- DiseaseType
- Content
- Finding
- History
- 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:
- LaboratoryData
Main features that are to be extracted from annotations:
- LabTest
- Lab
- Value
- SecHeading
- 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:
- AllPdocLabs
Main features that are to be extracted from annotations:
- order
- test
- Value
- refRange
- comment
- status
- 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:
- PdocHomeMedication
Main features that are to be extracted from annotations:
- dosage
- route
- freq(frequency)
- duration
- prn( fill-in work by a nurse)
- prnreason
- Dischargedosedue
- sd(start date)
- 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:
- PdocIPMedication
Main features that are to be extracted from annotations:
- order(status of order)
- pstatus
- medidesc(medication description)
- medifreq(frequency)
- drname(doctor name)
- 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:
- PhysicalExamination2
Main features that are to be extracted from annotations:
- vsign
- VitalDate
- ActValue
- NumericResult
- SecHeading
- 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:
- Burns
- ThirdDegreeBurns
- DegreeOfBurns
Main features that are to be extracted from annotations:
- burnsPercentage
- burnsPercentage1
- 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:
- Encounter
- DrugDose
- DrugCauses
- DrugNames
Main features that are to be extracted from annotations:
- 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:
- DrugDisease
- DxDrugFactor
Main features that are to be extracted from annotations:
- content(from above annotations)
- 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:
- NewBornWeight
- Birthweight
- nbprematurity
- NeonatalAge
Main features that are to be extracted from annotations:
- Content1
- cause1
- WtRange
- Disease
- 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:
- NewbornImp
Main features that are to be extracted from annotations:
- Disease
- Manifestation
- Content
- Cause
- Type
- Cause
- TConcept1
- Finding
- Stage
- History
- Site
- Weeks
- 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:
- Trimesters
- Trimester1
- Delivered
- Postpartum2
- Postpartum4
- nonpregnant
- Gravida
- Para
Main features that are to be extracted from annotations:
- gravidaCount
- keyword(gravida)
- parCount
- 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:
- Impression1
- Impression2
- Impression3
- Impression4
Main features that are to be extracted from annotations:
- Disease
- Manifestation
- Content
- Cause
- Type
- TConcept1
- TConcept2
- Stage
- Finding
- History
- Site
- Site1
- Site2
- Weeks
- 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:
- VFinalRule
Main features that are to be extracted from annotations:
- VictimVehicle
- ActualDesc
- ActualDesc1
- ActualDesc2
- OpVehicle
- TypeOfPerson
- Traffic
- 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:
- W19series
- W00series
- W26toW34
- W11toW18
- W17
- W53toW64
- W45toW49
Main features that are to be extracted from annotations:
- keyterm
- keytype
- 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:
- X00series
Main features that are to be extracted from annotations:
- keyterm
- keytype
- state
- 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:
- YFinalRule
Main features that are to be extracted from annotations:
- Activity
- Place
- 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
- ChiefComplaint Annotation Reader
- PresentIllness Annotation Reader
- PastMedicalHistory Annotation Reader
Annotations Required For This Reader:
- Complaint2
- Present_Illness2
- Past_Medical_History2
Main features that are to be extracted from annotations:
These features are extracted for each type of the above annotations
- Disease
- Manifestation
- Content
- Cause
- Type
- TConcept1
- TConcept2
- Stage
- Finding
- History
- Site
- Site1
- Site2
- Weeks
- 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:
- Allergies
Main features that are to be extracted from annotations:
- Content
- 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:
- PdocAllergies
Main features that are to be extracted from annotations:
- allergy
- severity
- 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:
- Habits6
Main features that are to be extracted from annotations:
- allergy
- severity
- 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:
- PdocHabits
Main features that are to be extracted from annotations:
- substance
- usage
- freq
- duration
- packyears
- quitdate
StoredProcedures:
No procedure is used in this class
Tables:
All the above retrieved information is saved to CDA_Habit table in the database.