diff --git a/lib/parser/ccda/sections/immunizations.js b/lib/parser/ccda/sections/immunizations.js index 97d06a1b..d3956160 100644 --- a/lib/parser/ccda/sections/immunizations.js +++ b/lib/parser/ccda/sections/immunizations.js @@ -59,6 +59,23 @@ var exportImmunizationsSection = function (version) { ["value", "0..1", "h:value", shared.ConceptDescriptor] ]); + var ImmunizationSeverityObservation = component.define("immunizationSeverityObservation") + .fields([ + ["code", "0..1", "h:value", shared.ConceptDescriptor], + ["interpretation", "0..1", "h:interpretationCode", shared.ConceptDescriptor] + ]); + + var ImmunizationReaction = component.define("immunizationReaction"); + ImmunizationReaction.templateRoot(["2.16.840.1.113883.10.20.22.4.9"]); + ImmunizationReaction.fields([ + ["identifiers", "0..*", "h:id", shared.Identifier], + ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], + ["reaction", "1..1", "h:value", shared.ConceptDescriptor], + ["free_text_reaction", "0..1", "h:text", shared.TextWithReference], + ["severity", "0..1", "h:entryRelationship/h:observation", ImmunizationSeverityObservation] + ]); + ImmunizationReaction.cleanupStep(cleanup.promoteFreeTextIfNoReaction); + var ImmunizationActivity = component.define("ImmunizationActivity") .templateRoot([clinicalStatementsIDs.ImmunizationActivity, clinicalStatementsIDs.MedicationActivity]) .fields([ @@ -72,6 +89,7 @@ var exportImmunizationsSection = function (version) { ["instructions", "0..1", "h:entryRelationship[@typeCode='SUBJ']/h:act", ImmunizationInstructions], ["refusal_reason", "0..1", "h:entryRelationship/h:observation/h:code/@code", shared.SimpleCode("2.16.840.1.113883.5.8")], ["indications", "0..*", "h:entryRelationship[@typeCode='RSON']/h:observation", Indication], + ["reaction", "0..1", "h:entryRelationship[@typeCode='CAUS']/h:observation", ImmunizationReaction], ]).cleanupStep(function () { // Quick and dirty fix for when refusal_reason catches other observations in Vitera. if (this.js) { // Refusal reason should use the template id if (this.js.refusal_reason && (!_.get(this, "js.refusal_reason.js"))) { diff --git a/test/parser-ccda/ccd-immunizations/no-indications.xml b/test/parser-ccda/ccd-immunizations/no-indications.xml index 9b56b6d0..15669500 100644 --- a/test/parser-ccda/ccd-immunizations/no-indications.xml +++ b/test/parser-ccda/ccd-immunizations/no-indications.xml @@ -901,7 +901,7 @@ Immunizations section - + @@ -959,7 +959,7 @@ Immunizations section - + diff --git a/test/parser-ccda/ccd-immunizations/no-reaction.xml b/test/parser-ccda/ccd-immunizations/no-reaction.xml new file mode 100644 index 00000000..15669500 --- /dev/null +++ b/test/parser-ccda/ccd-immunizations/no-reaction.xml @@ -0,0 +1,1780 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1946 Fairfield Road + Slinger + WI + 53086 + US + + + + + + + Dustin + Carter + + + + + + + + + + + + + 4545 Hott Street + Oklahoma City + OK + 73109 + US + + + + + + + Mr. + Lester + Person + + + + + + + Little Rock + AR + 72212 + US + + + + + + + + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Henry + Seven + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Henry + Seven + + + + + + + + + + + Frank + Jones + + + + + + + + + Community Health and Hospitals + + + 1002 Healthcare Drive + Portland + OR + 99123 + US + + + + + + + + + Henry + Seven + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Beaverton + OR + 97867 + US + + + + + Mrs. + Martha + Jones + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Henry + Seven + MD + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + Allergies, Adverse Reactions & Alerts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionSeveritySusceptibilityDate and TimeStatus
Allergy to EggsUNII291P45F896EggsSevereSusceptible05-01-2010 10:00:00Active
+ ICD-9-CMV15.03Allergy to eggs + + + +
FosfomycinRxNorm808917Fosfomycin 33.3 MG/ML Oral SuspensionSevereSusceptible05-01-2010 10:00:00Active
TetracyclinesRxNorm406524Doxycycline 75 MG Enteric Coated TabletMild to moderateVery susceptible05-01-2010 10:00:00Active
+ NDF-RTN0000006275Tetracycline + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + Allergy to Eggs + Eggs + + + + + + + + + + Allergy to Eggs + Eggs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fosfomycin + Fosfomycin 33.3 MG/ML Oral Suspension + + + + + + + + + + Fosfomycin + Fosfomycin 33.3 MG/ML Oral Suspension + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tetracyclines + Doxycycline 75 MG Enteric Coated Tablet + + + + + + + + + + Tetracyclines + Doxycycline 75 MG Enteric Coated Tablet + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Encounters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Encounter Office & Outpatient ConsultCPT99241Office consultation05-01-2010 10:00:00Performed
Encounter EDCPT99281Emergency dept visit07-16-2010 10:00:00Performed
Encounter Outpatient BHCPT99241Office consultation07-17-2010 10:00:00Performed
Encounter Office & Outpatient ConsultCPT99241Office consultation10-25-2010 10:00:00Performed
+ + + + + + + + Encounter Office & Outpatient Consult + Encounter Office & Outpatient Consult + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Encounter ED + Encounter ED + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Encounter Outpatient BH + Encounter Outpatient BH + + + + + + + + + + + + + + + Encounter Office & Outpatient Consult + Encounter Office & Outpatient Consult + + + + + + + +
+
+ + +
+ + + + Immunizations + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
No data
+
+ + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1007 Health Drive + Portland + OR + 99123 + US + + + + + Harold + Hippocrates + + + + + Good Health Clinic + + + 1007 Health Drive + Portland + OR + 99123 + US + + + + + + + + + +
+
+ + +
+ + + + Medications + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Antiasthmatic steroidsRxNorm351136Albuterol 0.417 MG/ML Inhalant Solution05-01-2010 10:00:00Active
+ RxNorm82893050 ACTUAT flunisolide 0.25 MG/ACTUAT Metered Dose Inhaler + +
Short acting beta 2 agonistRxNorm630208Albuterol 0.83 MG/ML Inhalant Solution05-01-2010 10:00:00Active
Smoking Cessation AgentsRxNorm104684724 HR Nicotine 0.313 MG/HR Transdermal Patch05-01-2010 10:00:00Active
+ + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + Antiasthmatic steroids + Albuterol 0.417 MG/ML Inhalant Solution + + + + Antiasthmatic steroids + + + + + + + + + + + + + + + + + + + + + + + + Short acting beta 2 agonist + Albuterol 0.83 MG/ML Inhalant Solution + + + + Short acting beta 2 agonist + + + + + + + + + + + + + + + + + + + + + + + + Smoking Cessation Agents + 24 HR Nicotine 0.313 MG/HR Transdermal Patch + + + + Smoking Cessation Agents + + + + + + + +
+
+ + +
+ + + + Problems + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
AsthmaSNOMED-CT195979001Asthma unspecified05-01-2010 10:00:00Active
+ ICD-10-CMJ45Asthma + +
+ ICD-9-CM493.92Asthma, unspecified type, with (acute) exacerbation + +
Asthma Daytime Symptoms QuantifiedSNOMED-CT370202007Asthma causes daytime symptoms 1 to 2 times per month05-01-2010 10:00:00Active
Asthma PersistentSNOMED-CT427295004Moderate persistent asthma07-16-2010 10:00:00Active
+ ICD-10-CMJ45.42Moderate persistent asthma with status asthmaticus + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + Procedures + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Tobacco Use Cessation CounselingCPT99406Behav chng smoking 3-10 min05-01-2010 10:00:00Performed
+ SNOMED-CT384742004Smoking cessation assistance + +
+ + + + + + + + + Tobacco Use Cessation Counseling + Behav chng smoking 3-10 min + + + + + + + + + +
+
+ + +
+ + + + + + Results + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionValueUnitDate and TimeStatus
No data
+
+ + + + + + + + + + + + + + + + + + + + + No data + + + + + + +
+
+ + +
+ + + + Social History + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Tobacco UseSNOMED-CT266919005Never smoker (Never Smoked)05-01-2010 10:00:00Active
+ SNOMED-CT449868002Current every day smoker + +
+ + + + + + + + Tobacco Use + Never smoker (Never Smoked) + + + + + + + + + + + + +
+
+ + +
+ + + + + + Vital Signs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionValueUnitDate and TimeStatus
BMILOINC39156-5BMI23.5kg/m205-01-2010 10:00:00Finding
Diastolic Blood PressureLOINC8462-4BP Diastolic74mm[Hg]05-01-2010 10:00:00Finding
Systolic Blood PressureLOINC8480-6BP Systolic114mm[Hg]05-01-2010 10:00:00Finding
Diastolic Blood PressureLOINC8462-4BP Diastolic72mm[Hg]10-25-2010 10:00:00Finding
Systolic Blood PressureLOINC8480-6BP Systolic112mm[Hg]10-25-2010 10:00:00Finding
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
diff --git a/test/parser-ccda/ccd-immunizations/one-reaction.xml b/test/parser-ccda/ccd-immunizations/one-reaction.xml new file mode 100644 index 00000000..e0ee1720 --- /dev/null +++ b/test/parser-ccda/ccd-immunizations/one-reaction.xml @@ -0,0 +1,1822 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1946 Fairfield Road + Slinger + WI + 53086 + US + + + + + + + Dustin + Carter + + + + + + + + + + + + + 4545 Hott Street + Oklahoma City + OK + 73109 + US + + + + + + + Mr. + Lester + Person + + + + + + + Little Rock + AR + 72212 + US + + + + + + + + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Henry + Seven + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Henry + Seven + + + + + + + + + + + Frank + Jones + + + + + + + + + Community Health and Hospitals + + + 1002 Healthcare Drive + Portland + OR + 99123 + US + + + + + + + + + Henry + Seven + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Beaverton + OR + 97867 + US + + + + + Mrs. + Martha + Jones + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Henry + Seven + MD + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + Allergies, Adverse Reactions & Alerts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionSeveritySusceptibilityDate and TimeStatus
Allergy to EggsUNII291P45F896EggsSevereSusceptible05-01-2010 10:00:00Active
+ ICD-9-CMV15.03Allergy to eggs + + + +
FosfomycinRxNorm808917Fosfomycin 33.3 MG/ML Oral SuspensionSevereSusceptible05-01-2010 10:00:00Active
TetracyclinesRxNorm406524Doxycycline 75 MG Enteric Coated TabletMild to moderateVery susceptible05-01-2010 10:00:00Active
+ NDF-RTN0000006275Tetracycline + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + Allergy to Eggs + Eggs + + + + + + + + + + Allergy to Eggs + Eggs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fosfomycin + Fosfomycin 33.3 MG/ML Oral Suspension + + + + + + + + + + Fosfomycin + Fosfomycin 33.3 MG/ML Oral Suspension + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tetracyclines + Doxycycline 75 MG Enteric Coated Tablet + + + + + + + + + + Tetracyclines + Doxycycline 75 MG Enteric Coated Tablet + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Encounters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Encounter Office & Outpatient ConsultCPT99241Office consultation05-01-2010 10:00:00Performed
Encounter EDCPT99281Emergency dept visit07-16-2010 10:00:00Performed
Encounter Outpatient BHCPT99241Office consultation07-17-2010 10:00:00Performed
Encounter Office & Outpatient ConsultCPT99241Office consultation10-25-2010 10:00:00Performed
+ + + + + + + + Encounter Office & Outpatient Consult + Encounter Office & Outpatient Consult + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Encounter ED + Encounter ED + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Encounter Outpatient BH + Encounter Outpatient BH + + + + + + + + + + + + + + + Encounter Office & Outpatient Consult + Encounter Office & Outpatient Consult + + + + + + + +
+
+ + +
+ + + + Immunizations + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
No data
+
+ + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1007 Health Drive + Portland + OR + 99123 + US + + + + + Harold + Hippocrates + + + + + Good Health Clinic + + + 1007 Health Drive + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Medications + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Antiasthmatic steroidsRxNorm351136Albuterol 0.417 MG/ML Inhalant Solution05-01-2010 10:00:00Active
+ RxNorm82893050 ACTUAT flunisolide 0.25 MG/ACTUAT Metered Dose Inhaler + +
Short acting beta 2 agonistRxNorm630208Albuterol 0.83 MG/ML Inhalant Solution05-01-2010 10:00:00Active
Smoking Cessation AgentsRxNorm104684724 HR Nicotine 0.313 MG/HR Transdermal Patch05-01-2010 10:00:00Active
+ + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + Antiasthmatic steroids + Albuterol 0.417 MG/ML Inhalant Solution + + + + Antiasthmatic steroids + + + + + + + + + + + + + + + + + + + + + + + + Short acting beta 2 agonist + Albuterol 0.83 MG/ML Inhalant Solution + + + + Short acting beta 2 agonist + + + + + + + + + + + + + + + + + + + + + + + + Smoking Cessation Agents + 24 HR Nicotine 0.313 MG/HR Transdermal Patch + + + + Smoking Cessation Agents + + + + + + + +
+
+ + +
+ + + + Problems + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
AsthmaSNOMED-CT195979001Asthma unspecified05-01-2010 10:00:00Active
+ ICD-10-CMJ45Asthma + +
+ ICD-9-CM493.92Asthma, unspecified type, with (acute) exacerbation + +
Asthma Daytime Symptoms QuantifiedSNOMED-CT370202007Asthma causes daytime symptoms 1 to 2 times per month05-01-2010 10:00:00Active
Asthma PersistentSNOMED-CT427295004Moderate persistent asthma07-16-2010 10:00:00Active
+ ICD-10-CMJ45.42Moderate persistent asthma with status asthmaticus + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + Procedures + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Tobacco Use Cessation CounselingCPT99406Behav chng smoking 3-10 min05-01-2010 10:00:00Performed
+ SNOMED-CT384742004Smoking cessation assistance + +
+ + + + + + + + + Tobacco Use Cessation Counseling + Behav chng smoking 3-10 min + + + + + + + + + +
+
+ + +
+ + + + + + Results + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionValueUnitDate and TimeStatus
No data
+
+ + + + + + + + + + + + + + + + + + + + + No data + + + + + + +
+
+ + +
+ + + + Social History + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Tobacco UseSNOMED-CT266919005Never smoker (Never Smoked)05-01-2010 10:00:00Active
+ SNOMED-CT449868002Current every day smoker + +
+ + + + + + + + Tobacco Use + Never smoker (Never Smoked) + + + + + + + + + + + + +
+
+ + +
+ + + + + + Vital Signs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionValueUnitDate and TimeStatus
BMILOINC39156-5BMI23.5kg/m205-01-2010 10:00:00Finding
Diastolic Blood PressureLOINC8462-4BP Diastolic74mm[Hg]05-01-2010 10:00:00Finding
Systolic Blood PressureLOINC8480-6BP Systolic114mm[Hg]05-01-2010 10:00:00Finding
Diastolic Blood PressureLOINC8462-4BP Diastolic72mm[Hg]10-25-2010 10:00:00Finding
Systolic Blood PressureLOINC8480-6BP Systolic112mm[Hg]10-25-2010 10:00:00Finding
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
diff --git a/test/parser-ccda/ccd-immunizations/test-reaction-observation.js b/test/parser-ccda/ccd-immunizations/test-reaction-observation.js new file mode 100644 index 00000000..0362500a --- /dev/null +++ b/test/parser-ccda/ccd-immunizations/test-reaction-observation.js @@ -0,0 +1,38 @@ +var fs = require('fs'); +var bb = require('../../../index.js'); + +describe('reaction observation', function () { + it('no reaction', function () { + var xmlfile = fs.readFileSync(__dirname + '/no-reaction.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].reaction).not.toBeDefined(); + }); + + it('one reaction', function () { + var xmlfile = fs.readFileSync(__dirname + '/one-reaction.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].reaction).toBeDefined(); + + var reaction = result.data.immunizations[0].reaction; + expect(reaction.identifiers[0]).toEqual({"identifier": "4adc1020-7b14-11db-9fe1-0800200c9a64"}); + expect(reaction.date_time).toEqual({ + "low": {"date": "2008-02-26T16:05:00.000Z", "precision": "minute"}, + "high": {"date": "2008-02-28T20:05:00.000Z", "precision": "minute"} + }); + expect(reaction.reaction).toEqual({ + "code": "422587007", + "code_system_name": "SNOMED CT", + "name": "Nausea" + }); + expect(reaction.free_text_reaction).toBeUndefined(); + expect(reaction.severity).toEqual({ + "code": { + "code": "371924009", + "code_system_name": "SNOMED CT", + "name": "Moderate to severe" + } + }); + }); +});