From 7400665b3cb7d40012c8bbbd85d7690d99ba6f6c Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Tue, 18 Oct 2022 14:56:06 -0500 Subject: [PATCH 01/36] Basic runner script --- run.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 run.js diff --git a/run.js b/run.js new file mode 100644 index 00000000..1c8dc4ad --- /dev/null +++ b/run.js @@ -0,0 +1,9 @@ +const fs = require('fs'); +const path = require('path'); +const bb = require('./'); + +const file = path.join('test/fixtures/parser-ccda/CCD_SocialHistory_PQ_value.xml'); +const xml = fs.readFileSync(file, {encoding: 'utf-8'}); +const result = bb.parse(xml); + +console.log(JSON.stringify(result, null, 2)); From 38c4e8247801cf3b9306ad8533496132121f8943 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Tue, 18 Oct 2022 14:56:06 -0500 Subject: [PATCH 02/36] Tests for different numbers of indications --- lib/parser/ccda/sections/immunizations.js | 9 + run.js | 9 + .../multiple-indications.xml | 1807 +++++++++++++++++ .../ccd-immunizations/no-indications.xml | 1780 ++++++++++++++++ .../ccd-immunizations/one-indication.xml | 1793 ++++++++++++++++ .../ccd-immunizations/test-indications.js | 32 + 6 files changed, 5430 insertions(+) create mode 100644 run.js create mode 100644 test/parser-ccda/ccd-immunizations/multiple-indications.xml create mode 100644 test/parser-ccda/ccd-immunizations/no-indications.xml create mode 100644 test/parser-ccda/ccd-immunizations/one-indication.xml create mode 100644 test/parser-ccda/ccd-immunizations/test-indications.js diff --git a/lib/parser/ccda/sections/immunizations.js b/lib/parser/ccda/sections/immunizations.js index cda68db9..97d06a1b 100644 --- a/lib/parser/ccda/sections/immunizations.js +++ b/lib/parser/ccda/sections/immunizations.js @@ -51,6 +51,14 @@ var exportImmunizationsSection = function (version) { ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"], ]); + var Indication = component.define("Indication") + .fields([ + ["identifiers", "0..*", "h:id", shared.Identifier], + ["code", "0..1", "h:code", shared.ConceptDescriptor], + ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], + ["value", "0..1", "h:value", shared.ConceptDescriptor] + ]); + var ImmunizationActivity = component.define("ImmunizationActivity") .templateRoot([clinicalStatementsIDs.ImmunizationActivity, clinicalStatementsIDs.MedicationActivity]) .fields([ @@ -63,6 +71,7 @@ var exportImmunizationsSection = function (version) { ["performer", "0..1", "h:performer/h:assignedEntity", shared.assignedEntity], ["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], ]).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/run.js b/run.js new file mode 100644 index 00000000..05ffb1ab --- /dev/null +++ b/run.js @@ -0,0 +1,9 @@ +var fs = require('fs'); +var path = require('path'); +var bb = require('./'); + +var file = path.join('test/fixtures/parser-ccda/CCD_SocialHistory_PQ_value.xml'); +var xml = fs.readFileSync(file, {encoding: 'utf-8'}); +var result = bb.parse(xml); + +console.log(JSON.stringify(result, null, 2)); diff --git a/test/parser-ccda/ccd-immunizations/multiple-indications.xml b/test/parser-ccda/ccd-immunizations/multiple-indications.xml new file mode 100644 index 00000000..ab0a1283 --- /dev/null +++ b/test/parser-ccda/ccd-immunizations/multiple-indications.xml @@ -0,0 +1,1807 @@ + + + + + + + + + + + + + + + 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/no-indications.xml b/test/parser-ccda/ccd-immunizations/no-indications.xml new file mode 100644 index 00000000..9b56b6d0 --- /dev/null +++ b/test/parser-ccda/ccd-immunizations/no-indications.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-indication.xml b/test/parser-ccda/ccd-immunizations/one-indication.xml new file mode 100644 index 00000000..11d8ccbe --- /dev/null +++ b/test/parser-ccda/ccd-immunizations/one-indication.xml @@ -0,0 +1,1793 @@ + + + + + + + + + + + + + + + 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-indications.js b/test/parser-ccda/ccd-immunizations/test-indications.js new file mode 100644 index 00000000..dc8f4d92 --- /dev/null +++ b/test/parser-ccda/ccd-immunizations/test-indications.js @@ -0,0 +1,32 @@ +var fs = require('fs'); + +var bb = require('../../../index.js'); + +describe('immunizations', function () { + it('no indications', function () { + var xmlfile = fs.readFileSync(__dirname + '/no-indications.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].indications).not.toBeDefined(); + }); + + it('one indication', function () { + var xmlfile = fs.readFileSync(__dirname + '/one-indication.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].indications.length).toBe(1); + + var indication = result.data.immunizations[0].indications[0]; + expect(indication.identifiers[0]).toEqual({"identifier": "db734647-fc99-424c-a864-7e3cda82e703"}); + expect(indication.code).toEqual({"code": "ASSERTION", "code_system_name": "ActCode"}); + expect(indication.date_time).toEqual({"low": {"date": "2010-05-01T00:00:00.000Z", "precision": "day"}}); + expect(indication.value).toEqual({"code": "32398004", "code_system_name": "SNOMED CT", "name": "Bronchitis"}); + }); + + it('multiple indications', function () { + var xmlfile = fs.readFileSync(__dirname + '/multiple-indications.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].indications.length).toBe(2); + }); +}); From 74a6571a822b2982684ad8d8db62878dd0486659 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Fri, 21 Oct 2022 18:29:30 -0500 Subject: [PATCH 03/36] Correct comment --- test/parser-ccda/ccd-immunizations/no-indications.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 - + From bb4e9453f1b777a88a2dae20731ed67c6c64ec25 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Fri, 21 Oct 2022 18:30:28 -0500 Subject: [PATCH 04/36] Include immunization reaction --- lib/parser/ccda/sections/immunizations.js | 18 + .../ccd-immunizations/no-reaction.xml | 1780 ++++++++++++++++ .../ccd-immunizations/one-reaction.xml | 1822 +++++++++++++++++ .../test-reaction-observation.js | 38 + 4 files changed, 3658 insertions(+) create mode 100644 test/parser-ccda/ccd-immunizations/no-reaction.xml create mode 100644 test/parser-ccda/ccd-immunizations/one-reaction.xml create mode 100644 test/parser-ccda/ccd-immunizations/test-reaction-observation.js 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-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" + } + }); + }); +}); From eb616705dc616a71411d4e918d94fadfbe1b703b Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Mon, 24 Oct 2022 11:00:44 -0700 Subject: [PATCH 05/36] intial changes to social history for tobacco use --- lib/parser/ccda/sections/social_history.js | 12 +- .../multiple-indications.xml | 1807 +++++++++++++++++ .../ccd-social-history/no-indications.xml | 1780 ++++++++++++++++ .../ccd-social-history/one-indication.xml | 1793 ++++++++++++++++ .../ccd-social-history/test-tobacco-use.js | 32 + 5 files changed, 5423 insertions(+), 1 deletion(-) create mode 100644 test/parser-ccda/ccd-social-history/multiple-indications.xml create mode 100644 test/parser-ccda/ccd-social-history/no-indications.xml create mode 100644 test/parser-ccda/ccd-social-history/one-indication.xml create mode 100644 test/parser-ccda/ccd-social-history/test-tobacco-use.js diff --git a/lib/parser/ccda/sections/social_history.js b/lib/parser/ccda/sections/social_history.js index 6b30dfe3..ad5d4739 100644 --- a/lib/parser/ccda/sections/social_history.js +++ b/lib/parser/ccda/sections/social_history.js @@ -10,6 +10,15 @@ var exportSocialHistorySection = function (version) { var sectionIDs = bbm.CCDA["sections" + version]; var clinicalStatementsIDs = bbm.CCDA["statements" + version]; + var tobaccoUse = component.define("tobaccoUse") + .templateRoot([clinicalStatementsIDs.TobaccoUse]) + .fields([ + ["identifiers", "0..*", "h:id", shared.Identifier], + ["code", "0..1", "h:code", shared.ConceptDescriptor], + ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], + ["value", "0..1", "h:value[@xsi:type='CD']/text()"], + ]) + var socialHistoryObservation = component.define("socialHistoryObservation") .templateRoot([ clinicalStatementsIDs.SocialHistoryObservation, // the correct templateId (smoking status) @@ -53,7 +62,8 @@ var exportSocialHistorySection = function (version) { var socialHistorySection = component.define("socialHistorySection") .templateRoot([sectionIDs.SocialHistorySection, sectionIDs.SocialHistorySectionEntriesOptional]) .fields([ - ["smoking_statuses", "0..*", socialHistoryObservation.xpath(), socialHistoryObservation] + ["smoking_statuses", "0..*", socialHistoryObservation.xpath(), socialHistoryObservation], + ["tobacco_use", "0..*", tobaccoUse.xpath(), tobaccoUse] ]); socialHistorySection.cleanupStep(cleanup.replaceWithField('smoking_statuses')); diff --git a/test/parser-ccda/ccd-social-history/multiple-indications.xml b/test/parser-ccda/ccd-social-history/multiple-indications.xml new file mode 100644 index 00000000..ab0a1283 --- /dev/null +++ b/test/parser-ccda/ccd-social-history/multiple-indications.xml @@ -0,0 +1,1807 @@ + + + + + + + + + + + + + + + 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-social-history/no-indications.xml b/test/parser-ccda/ccd-social-history/no-indications.xml new file mode 100644 index 00000000..9b56b6d0 --- /dev/null +++ b/test/parser-ccda/ccd-social-history/no-indications.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-social-history/one-indication.xml b/test/parser-ccda/ccd-social-history/one-indication.xml new file mode 100644 index 00000000..11d8ccbe --- /dev/null +++ b/test/parser-ccda/ccd-social-history/one-indication.xml @@ -0,0 +1,1793 @@ + + + + + + + + + + + + + + + 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-social-history/test-tobacco-use.js b/test/parser-ccda/ccd-social-history/test-tobacco-use.js new file mode 100644 index 00000000..dc8f4d92 --- /dev/null +++ b/test/parser-ccda/ccd-social-history/test-tobacco-use.js @@ -0,0 +1,32 @@ +var fs = require('fs'); + +var bb = require('../../../index.js'); + +describe('immunizations', function () { + it('no indications', function () { + var xmlfile = fs.readFileSync(__dirname + '/no-indications.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].indications).not.toBeDefined(); + }); + + it('one indication', function () { + var xmlfile = fs.readFileSync(__dirname + '/one-indication.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].indications.length).toBe(1); + + var indication = result.data.immunizations[0].indications[0]; + expect(indication.identifiers[0]).toEqual({"identifier": "db734647-fc99-424c-a864-7e3cda82e703"}); + expect(indication.code).toEqual({"code": "ASSERTION", "code_system_name": "ActCode"}); + expect(indication.date_time).toEqual({"low": {"date": "2010-05-01T00:00:00.000Z", "precision": "day"}}); + expect(indication.value).toEqual({"code": "32398004", "code_system_name": "SNOMED CT", "name": "Bronchitis"}); + }); + + it('multiple indications', function () { + var xmlfile = fs.readFileSync(__dirname + '/multiple-indications.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.immunizations[0].indications.length).toBe(2); + }); +}); From 63bbd097d5dc912fadbb3d481060fb7e6fa88851 Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Mon, 24 Oct 2022 14:52:32 -0700 Subject: [PATCH 06/36] medication addition test --- lib/parser/ccda/sections/medications.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index 505cf893..c0ef988c 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -86,11 +86,12 @@ var exportMedicationsSection = function (version) { // *************************************************************************** var medicationInformation; + var medicationImmunization; var medicationSupplyOrder; var medicationActivity; var medicationsSection; - if (version === "") { + if (version === "") {//default version medicationInformation = component.define("medicationInformation") .templateRoot("2.16.840.1.113883.10.20.22.4.23") .fields([ @@ -100,6 +101,15 @@ var exportMedicationsSection = function (version) { ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"] ]); + medicationImmunization = component.define("medicationImmunization") + .templateRoot("2.16.840.1.113883.10.20.22.4.54") + .fields([ + ["identifiers", "0..*", "h:id", shared.Identifier], + // ["product", "1..1", "h:manufacturedMaterial/h:code", shared.ConceptDescriptor], + ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"], + ["material", "1..1", "h:manufacturedMaterial/h:name/text()"] + ]); + medicationSupplyOrder = component.define("medicationSupplyOrder") .fields([ ["identifiers", "0..*", "h:assignedEntity/h:id", shared.Identifier], @@ -133,7 +143,8 @@ var exportMedicationsSection = function (version) { ["identifiers", "0..*", "h:id", shared.Identifier], ["performer", "0..1", "h:performer", MedicationPerformer], ["supply", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply", medicationSupplyOrder], - ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation] + ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation], + ["information", "0..1", "h:product/h:manufacturedMaterial", medicationImmunization] ]); medicationActivity = component.define("medicationActivity") @@ -212,6 +223,13 @@ var exportMedicationsSection = function (version) { ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], ]); + medicationImmunization = component.define("medicationImmunization") + .templateRoot("2.16.840.1.113883.10.20.1.54") + .fields([ + ["unencoded_name", "0..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], + ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], + ]); + medicationSupplyOrder = component.define("medicationSupplyOrder") .templateRoot("2.16.840.1.113883.10.20.1.34") .fields([ From 5cba59cd6223332353f9842cae6cd5ea4f084d4f Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Mon, 24 Oct 2022 15:19:59 -0700 Subject: [PATCH 07/36] for paul to check out --- lib/parser/ccda/sections/social_history.js | 30 +++++-- package-lock.json | 95 +--------------------- package.json | 5 +- 3 files changed, 30 insertions(+), 100 deletions(-) diff --git a/lib/parser/ccda/sections/social_history.js b/lib/parser/ccda/sections/social_history.js index ad5d4739..d32ac32c 100644 --- a/lib/parser/ccda/sections/social_history.js +++ b/lib/parser/ccda/sections/social_history.js @@ -17,6 +17,7 @@ var exportSocialHistorySection = function (version) { ["code", "0..1", "h:code", shared.ConceptDescriptor], ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], ["value", "0..1", "h:value[@xsi:type='CD']/text()"], + ["history_type", "1..1", "h:templateId/@root"] ]) var socialHistoryObservation = component.define("socialHistoryObservation") @@ -37,6 +38,7 @@ var exportSocialHistorySection = function (version) { //["observation_value2", "0..1", "h:value[@xsi:type='CD']/@displayName"] ["referencedValue", "0..1", "h:value[@xsi:type='ED']", shared.TextWithReference], ["nullCodeReplacementText", "0..1", "h:code/h:originalText", shared.TextWithReference] + ["history_type", "1..1", "h:templateId/@root"] ]) .cleanupStep(cleanup.replaceWithObject("code2", { "name": "Smoking Status" @@ -55,17 +57,33 @@ var exportSocialHistorySection = function (version) { }) // custom step to put null flavor name on value field if present .cleanupStep(cleanup.replaceStringFieldWithNullFlavorName("value")); + + var socialHistorySectionUnion = component.define('socialHistorySectionUnion') + socialHistorySectionUnion.templateRoot([[sectionIDs.SocialHistorySection, sectionIDs.SocialHistorySectionEntriesOptional]]) + socialHistorySectionUnion.fields([ + ["smoking_statuses", "0..*", socialHistoryObservation.xpath(), socialHistoryObservation], + ["tobacco_use", "0..*", tobaccoUse.xpath(), tobaccoUse] + ]) + socialHistorySectionUnion.cleanupStep(cleanup.replaceWithField('smoking_statuses')); + socialHistorySectionUnion.cleanupStep(cleanup.extractAllFields(["smoking_statuses", "tobacco_use"])); + socialHistorySectionUnion.cleanupStep(function () { + var typeMap = { + [sectionIDs.SocialHistorySection]: "smoking_statuses", // ccda + [sectionIDs.SocialHistorySectionEntriesOptional]: "smoking_statuses", + [clinicalStatementsIDs.TobaccoUse]: "tobacco_use", + }; + var t = this.js['procedure_type']; + this.js['procedure_type'] = typeMap[t]; + }); // when other flavors of social history is implemented (pregnancy, social observation, tobacco use) // this should probably be structured similar to procedures with types. if another structure // is chosen procedures need to be updated as well. var socialHistorySection = component.define("socialHistorySection") - .templateRoot([sectionIDs.SocialHistorySection, sectionIDs.SocialHistorySectionEntriesOptional]) - .fields([ - ["smoking_statuses", "0..*", socialHistoryObservation.xpath(), socialHistoryObservation], - ["tobacco_use", "0..*", tobaccoUse.xpath(), tobaccoUse] - ]); - socialHistorySection.cleanupStep(cleanup.replaceWithField('smoking_statuses')); + socialHistorySection.templateRoot([sectionIDs.SocialHistorySection, sectionIDs.SocialHistorySectionEntriesOptional]); + socialHistorySection.fields([ + ["entry", "0..*", socialHistorySectionUnion.xpath(), socialHistorySectionUnion] + ]) return [socialHistorySection, socialHistoryObservation]; }; diff --git a/package-lock.json b/package-lock.json index addaa6d9..de37acf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,16 @@ { "name": "@amida-tech/blue-button", - "version": "1.10.7", + "version": "1.10.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@amida-tech/blue-button", - "version": "1.10.7", + "version": "1.10.8", "license": "Apache-2.0", "dependencies": { "@amida-tech/blue-button-cms": "^1.5.6", "@amida-tech/blue-button-meta": "^1.7.3", - "@amida-tech/blue-button-model": "^1.10.3", "@amida-tech/blue-button-xml": "^1.8.5", "lodash": "^4.17.21", "winston": "^3.8.1" @@ -73,50 +72,6 @@ "node": ">= 14.19.3" } }, - "node_modules/@amida-tech/blue-button-model": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/@amida-tech/blue-button-model/-/blue-button-model-1.10.3.tgz", - "integrity": "sha512-K0sv0EmVS2Ffy2sQcCYupW7Knuv8P2zx5nuMUTiMMXDpv5o1UNzGGwW+U4jXEeO/r2jiHb32qxFOQe4w/zKpAw==", - "dependencies": { - "lodash": "^4.17.21", - "z-schema": "^5.0.3" - }, - "engines": { - "node": ">= 14.19.3" - } - }, - "node_modules/@amida-tech/blue-button-model/node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" - }, - "node_modules/@amida-tech/blue-button-model/node_modules/validator": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", - "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/@amida-tech/blue-button-model/node_modules/z-schema": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.3.tgz", - "integrity": "sha512-sGvEcBOTNum68x9jCpCVGPFJ6mWnkD0YxOcddDlJHRx3tKdB2q8pCHExMVZo/AV/6geuVJXG7hljDaWG8+5GDw==", - "dependencies": { - "lodash.get": "^4.4.2", - "lodash.isequal": "^4.5.0", - "validator": "^13.7.0" - }, - "bin": { - "z-schema": "bin/z-schema" - }, - "engines": { - "node": ">=8.0.0" - }, - "optionalDependencies": { - "commander": "^2.20.3" - } - }, "node_modules/@amida-tech/blue-button-xml": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@amida-tech/blue-button-xml/-/blue-button-xml-1.8.5.tgz", @@ -2035,7 +1990,7 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "devOptional": true + "dev": true }, "node_modules/concat-map": { "version": "0.0.1", @@ -4975,11 +4930,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" - }, "node_modules/lodash.isfinite": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", @@ -7317,38 +7267,6 @@ "resolved": "https://registry.npmjs.org/@amida-tech/blue-button-meta/-/blue-button-meta-1.7.3.tgz", "integrity": "sha512-IS0XPsZ7E5n88f6GgTl50NwuCzi1+kXhwuRnFgg+hAIIyNVulKJZ1tSniwu8i8L90tJg/RrXtAPMmDz9TmSlcg==" }, - "@amida-tech/blue-button-model": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/@amida-tech/blue-button-model/-/blue-button-model-1.10.3.tgz", - "integrity": "sha512-K0sv0EmVS2Ffy2sQcCYupW7Knuv8P2zx5nuMUTiMMXDpv5o1UNzGGwW+U4jXEeO/r2jiHb32qxFOQe4w/zKpAw==", - "requires": { - "lodash": "^4.17.21", - "z-schema": "^5.0.3" - }, - "dependencies": { - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" - }, - "validator": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", - "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" - }, - "z-schema": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.3.tgz", - "integrity": "sha512-sGvEcBOTNum68x9jCpCVGPFJ6mWnkD0YxOcddDlJHRx3tKdB2q8pCHExMVZo/AV/6geuVJXG7hljDaWG8+5GDw==", - "requires": { - "commander": "^2.20.3", - "lodash.get": "^4.4.2", - "lodash.isequal": "^4.5.0", - "validator": "^13.7.0" - } - } - } - }, "@amida-tech/blue-button-xml": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@amida-tech/blue-button-xml/-/blue-button-xml-1.8.5.tgz", @@ -8866,7 +8784,7 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "devOptional": true + "dev": true }, "concat-map": { "version": "0.0.1", @@ -11209,11 +11127,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" - }, "lodash.isfinite": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", diff --git a/package.json b/package.json index b7ec6729..5622e21e 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "dependencies": { "@amida-tech/blue-button-cms": "^1.5.6", "@amida-tech/blue-button-meta": "^1.7.3", - "@amida-tech/blue-button-model": "^1.10.3", "@amida-tech/blue-button-xml": "^1.8.5", "lodash": "^4.17.21", "winston": "^3.8.1" @@ -52,8 +51,8 @@ "devDependencies": { "brfs": "^2.0.2", "grunt": "^1.5.3", - "grunt-contrib-jshint": "^3.2.0", "grunt-contrib-connect": "^3.0.0", + "grunt-contrib-jshint": "^3.2.0", "grunt-contrib-watch": "^1.1.0", "grunt-jsbeautifier": "^0.2.13", "grunt-run": "^0.8.1", @@ -76,4 +75,4 @@ "url": "https://github.com/amida-tech/blue-button/issues" }, "homepage": "https://github.com/amida-tech/blue-button" -} \ No newline at end of file +} From ff6a7c8daa6f196c365d601feaff748452af3b3c Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Mon, 24 Oct 2022 16:11:31 -0700 Subject: [PATCH 08/36] getting closer --- lib/parser/ccda/sections/social_history.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/parser/ccda/sections/social_history.js b/lib/parser/ccda/sections/social_history.js index d32ac32c..7fc068b0 100644 --- a/lib/parser/ccda/sections/social_history.js +++ b/lib/parser/ccda/sections/social_history.js @@ -17,7 +17,7 @@ var exportSocialHistorySection = function (version) { ["code", "0..1", "h:code", shared.ConceptDescriptor], ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], ["value", "0..1", "h:value[@xsi:type='CD']/text()"], - ["history_type", "1..1", "h:templateId/@root"] + // ["history_type", "1..1", "h:templateId/@root"] ]) var socialHistoryObservation = component.define("socialHistoryObservation") @@ -37,8 +37,8 @@ var exportSocialHistorySection = function (version) { ["value", "0..1", "h:value[@xsi:type='ST']/text() | h:value[@xsi:type='CD']/@displayName | h:value[@xsi:type='PQ']/@value"], //["observation_value2", "0..1", "h:value[@xsi:type='CD']/@displayName"] ["referencedValue", "0..1", "h:value[@xsi:type='ED']", shared.TextWithReference], - ["nullCodeReplacementText", "0..1", "h:code/h:originalText", shared.TextWithReference] - ["history_type", "1..1", "h:templateId/@root"] + ["nullCodeReplacementText", "0..1", "h:code/h:originalText", shared.TextWithReference], + // ["history_type", "1..1", "h:templateId/@root"] ]) .cleanupStep(cleanup.replaceWithObject("code2", { "name": "Smoking Status" @@ -59,17 +59,19 @@ var exportSocialHistorySection = function (version) { .cleanupStep(cleanup.replaceStringFieldWithNullFlavorName("value")); - var socialHistorySectionUnion = component.define('socialHistorySectionUnion') - socialHistorySectionUnion.templateRoot([[sectionIDs.SocialHistorySection, sectionIDs.SocialHistorySectionEntriesOptional]]) + var socialHistorySectionUnion = component.define("socialHistorySectionUnion") + // template idea for socaial history entries smoking status meaingful user + socialHistorySectionUnion.templateRoot([clinicalStatementsIDs.TobaccoUse, clinicalStatementsIDs.SocialHistoryObservation]) socialHistorySectionUnion.fields([ - ["smoking_statuses", "0..*", socialHistoryObservation.xpath(), socialHistoryObservation], - ["tobacco_use", "0..*", tobaccoUse.xpath(), tobaccoUse] + // xpaths update - find template by ID, and go up /.. a level + ["smoking_statuses", "0..1", socialHistoryObservation.xpath(), socialHistoryObservation], + ["tobacco_use", "0..1", tobaccoUse.xpath(), tobaccoUse], ]) - socialHistorySectionUnion.cleanupStep(cleanup.replaceWithField('smoking_statuses')); + socialHistorySectionUnion.cleanupStep(cleanup.replaceWithField("smoking_statuses")); socialHistorySectionUnion.cleanupStep(cleanup.extractAllFields(["smoking_statuses", "tobacco_use"])); socialHistorySectionUnion.cleanupStep(function () { var typeMap = { - [sectionIDs.SocialHistorySection]: "smoking_statuses", // ccda + [sectionIDs.SocialHistorySection]: "smoking_statuses", [sectionIDs.SocialHistorySectionEntriesOptional]: "smoking_statuses", [clinicalStatementsIDs.TobaccoUse]: "tobacco_use", }; From c8f7c1c89bcd7a96c8ea174b98a918f06e11c853 Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Mon, 24 Oct 2022 16:55:27 -0700 Subject: [PATCH 09/36] IMI Comments --- lib/parser/ccda/sections/medications.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index c0ef988c..131af664 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -144,7 +144,7 @@ var exportMedicationsSection = function (version) { ["performer", "0..1", "h:performer", MedicationPerformer], ["supply", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply", medicationSupplyOrder], ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation], - ["information", "0..1", "h:product/h:manufacturedMaterial", medicationImmunization] + ["immunization", "0..1", "h:product/h:manufacturedMaterial", medicationImmunization] ]); medicationActivity = component.define("medicationActivity") @@ -159,6 +159,11 @@ var exportMedicationsSection = function (version) { ["performer", "0..1", "h:performer", MedicationPerformer], ["drug_vehicle", "0..1", "h:participant[@typeCode='CSM']/h:participantRole/h:playingEntity[@classCode='MMAT']/h:code", shared.ConceptDescriptor], ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition], + /* array, explained: + [0] => name of array elements; + [1] => cardinality (zero or one, exactly 1, or many); + [2] => ns:xml tag[optional]; + [3] => associated var*/ ["indication", "0..1", "h:entryRelationship[@typeCode='RSON']/h:observation", MedicationIndication], //["instructions", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply/*/*/h:templateId[@root='2.16.840.1.113883.10.20.22.4.20']", MedicationInstructions], ["dispense", "0..1", MedicationDispense.xpath(), MedicationDispense] From 41ddb5e6e453dac48d9c6ac7bee75af48f37b9de Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Tue, 25 Oct 2022 08:25:36 -0700 Subject: [PATCH 10/36] var-names --- lib/parser/ccda/sections/medications.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index 131af664..10ac8312 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -86,7 +86,7 @@ var exportMedicationsSection = function (version) { // *************************************************************************** var medicationInformation; - var medicationImmunization; + var immunizationMedicationInformation; var medicationSupplyOrder; var medicationActivity; var medicationsSection; @@ -101,7 +101,7 @@ var exportMedicationsSection = function (version) { ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"] ]); - medicationImmunization = component.define("medicationImmunization") + immunizationMedicationInformation = component.define("immunizationMedicationInformation") .templateRoot("2.16.840.1.113883.10.20.22.4.54") .fields([ ["identifiers", "0..*", "h:id", shared.Identifier], @@ -144,7 +144,7 @@ var exportMedicationsSection = function (version) { ["performer", "0..1", "h:performer", MedicationPerformer], ["supply", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply", medicationSupplyOrder], ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation], - ["immunization", "0..1", "h:product/h:manufacturedMaterial", medicationImmunization] + ["immunization", "0..1", "h:product/h:manufacturedMaterial", immunizationMedicationInformation] ]); medicationActivity = component.define("medicationActivity") @@ -228,11 +228,13 @@ var exportMedicationsSection = function (version) { ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], ]); - medicationImmunization = component.define("medicationImmunization") + immunizationMedicationInformation = component.define("immunizationMedicationInformation") .templateRoot("2.16.840.1.113883.10.20.1.54") .fields([ - ["unencoded_name", "0..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], - ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], + ["identifiers", "0..*", "h:id", shared.Identifier], + ["products", "0..1", "h:code", shared.ConceptDescriptor], + ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"], + ["material", "1..1", "h:manufacturedMaterial/h:name/text()"] ]); medicationSupplyOrder = component.define("medicationSupplyOrder") From 8479d0cf3cb2834245564ca68894ab682a3c0f29 Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Tue, 25 Oct 2022 08:32:47 -0700 Subject: [PATCH 11/36] xml --- test/fixtures/parser-ccda/ccd-101.xml | 1916 +++++++++++++++++++++++++ 1 file changed, 1916 insertions(+) create mode 100644 test/fixtures/parser-ccda/ccd-101.xml diff --git a/test/fixtures/parser-ccda/ccd-101.xml b/test/fixtures/parser-ccda/ccd-101.xml new file mode 100644 index 00000000..a7793217 --- /dev/null +++ b/test/fixtures/parser-ccda/ccd-101.xml @@ -0,0 +1,1916 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 960 Hardman Road + Essex Junction + VT + 5452 + US + + + + + + + Elaine + King + + + + + + + + + + + + + 4264 Bobcat Drive + Washington + MD + 20200 + US + + + + + + + Mr. + William + Stafford + + + + + + + Gaithersburg + MD + 20877 + 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 EggsUNII291P45F896 + + Eggs + + + Moderate to severe + Moderately Susceptible04-25-2010 10:00:00Active
+ ICD-9-CMV15.03Allergy to eggs + + + +
Bakers YeastRxNorm892677 + + Baker's yeast allergenic extract 100 MG/ML Injectable Solution + + + Mild to moderate + Susceptible04-25-2010 10:00:00Active
Penicillin VNDF-RTN0000011298 + + Penicillin V + + + Fatal + Moderately Susceptible04-25-2010 10:00:00Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + Allergy to Eggs + Eggs + + + + + + + + + + Allergy to Eggs + Eggs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bakers Yeast + Baker's yeast allergenic extract 100 MG/ML Injectable Solution + + + + + + + + + + Bakers Yeast + Baker's yeast allergenic extract 100 MG/ML Injectable Solution + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Penicillin V + Penicillin V + + + + + + + + + + Penicillin V + Penicillin V + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Encounters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Encounter OutpatientCPT99213 + + Office/outpatient visit, est + 04-25-2010 10:00:00Performed
+ ICD-9-CMV70.0Routine general medical examination at a health care facility + +
Encounter Outpatient Including Orthopedics anCPT98940 + + Chiropractic manipulation + 05-28-2010 10:00:00Performed
Encounter OutpatientCPT99213 + + Office/outpatient visit, est + 06-28-2010 10:00:00Performed
+ ICD-9-CMV70.0Routine general medical examination at a health care facility + +
+
+ + + + + + + + Encounter Outpatient + Encounter Outpatient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Encounter Outpatient Including Orthopedics an + Encounter Outpatient Including Orthopedics an + + + + + + + + + + + + + + + Encounter Outpatient + Encounter Outpatient + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Immunizations + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
No data
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Medications + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Antihypertensive combinationsRxNorm858828 + + Enalapril Maleate 10 MG / Hydrochlorothiazide 25 MG Oral Tablet + 04-25-2010 10:00:00Active
+
+ + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immunopop Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + Antihypertensive combinations + Enalapril Maleate 10 MG / Hydrochlorothiazide 25 MG Oral Tablet + + + + Antihypertensive combinations + + + + + + + +
+
+ + +
+ + + + Problems + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
low back painSNOMED-CT279039007 + + Low back pain + 04-25-2010 10:00:00Active
+ ICD-10-CMM54.9Dorsalgia, unspecified + +
+ ICD-9-CM724.2Lumbago + +
HypertensionSNOMED-CT59621000 + + Essential hypertension + 06-28-2010 10:00:00Active
+ ICD-10-CMI10Essential (primary) hypertension + +
+ ICD-9-CM401.9Unspecified essential hypertension + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + Procedures + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
dietary consultation orderSNOMED-CT103699006 + + Patient referral to dietitian + 04-25-2010 10:00:00Performed
Imaging Study-SpinalCPT72010 + + X-ray exam of spine + 05-28-2010 10:00:00Performed
+ SNOMED-CT91583001Diagnostic radiography of spine, survey study + +
+
+ + + + + + + + + dietary consultation order + Patient referral to dietitian + + + + + + + + + + + + + + + + + Imaging Study-Spinal + X-ray exam of spine + + + + + + + + + +
+
+ + +
+ + + + + + Results + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionValueUnitReference RangeDate and TimeStatus
Pap TestLOINC10524-7 + + Cyto Cervix + normalNA06-28-2010 10:00:00Completed
+ CPT88174Cytopath, c/v auto, in fluid + + + + +
+ HCPCSG0147Scr c/v cyto, automated sys + + + + +
+ ICD-10-CMZ12.4Encounter for screening for malignant neoplasm of cervix + + + + +
+ ICD-9-CMV72.32Encounter for Papanicolaou cervical smear to confirm findings of recent normal smear following initial abnormal smear + + + + +
+ SNOMED-CT440623000Microscopic examination of cervical Papanicolaou smear + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + NA + + + + + + +
+
+ + +
+ + + + Social History + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Tobacco UseSNOMED-CT266919005 + + Never smoker (Never Smoked) + 04-25-2010 10:00:00Active
+ SNOMED-CT449868002Current every day smoker + +
+
+ + + + + + + + Tobacco Use + Never smoker (Never Smoked) + + + + + + + + + + + + +
+
+ + +
+ + + + + + Vital Signs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionValueUnitDate and TimeStatus
BMILOINC39156-5 + + BMI + 28.8kg/m204-25-2010 10:00:00Finding
Diastolic Blood PressureLOINC8462-4 + + BP Diastolic + 84mm[Hg]04-25-2010 10:00:00Finding
Systolic Blood PressureLOINC8480-6 + + BP Systolic + 134mm[Hg]04-25-2010 10:00:00Finding
BMILOINC39156-5 + + BMI + 28.4kg/m205-28-2010 10:00:00Finding
Diastolic Blood PressureLOINC8462-4 + + BP Diastolic + 86mm[Hg]05-28-2010 10:00:00Finding
Systolic Blood PressureLOINC8480-6 + + BP Systolic + 130mm[Hg]05-28-2010 10:00:00Finding
BMILOINC39156-5 + + BMI + 28.8kg/m206-28-2010 10:00:00Finding
Diastolic Blood PressureLOINC8462-4 + + BP Diastolic + 84mm[Hg]06-28-2010 10:00:00Finding
Systolic Blood PressureLOINC8480-6 + + BP Systolic + 132mm[Hg]06-28-2010 10:00:00Finding
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
\ No newline at end of file From 503acda70f741e3097068ed481939f62834fd977 Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Tue, 25 Oct 2022 09:37:31 -0700 Subject: [PATCH 12/36] xml-changes --- test/fixtures/parser-ccda/ccd-101.xml | 148 ++++++++++++++++++++++++-- 1 file changed, 141 insertions(+), 7 deletions(-) diff --git a/test/fixtures/parser-ccda/ccd-101.xml b/test/fixtures/parser-ccda/ccd-101.xml index a7793217..f178cb60 100644 --- a/test/fixtures/parser-ccda/ccd-101.xml +++ b/test/fixtures/parser-ccda/ccd-101.xml @@ -991,16 +991,16 @@ Medications section - - - - - 1 + + + + + 1 - Health LS - Immunopop Inc. + Health LS - Immunopop Inc. - + @@ -1038,6 +1038,140 @@ Medications section + +
+ + + + Medications + + + + + + + + + + + + + + + + + + + + + + + +
Group DescriptionCode SystemCodeCode DescriptionDate and TimeStatus
Antihypertensive combinationsRxNorm858828 + + Enalapril Maleate 10 MG / Hydrochlorothiazide 25 MG Oral Tablet + 04-25-2010 10:00:00Active
+
+ + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immunopop2 Inc. + + + + + + + + + + + + + +
- - - - - - - 1 - - - Health LS - Immunopop Inc. - - - - - - - - - - - - - - + + + + - - + + + + + + - - + + + - - - Antihypertensive combinations + Enalapril Maleate 10 MG / Hydrochlorothiazide 25 MG Oral Tablet - - - - Antihypertensive combinations + + + + + + + + + + + @@ -1138,36 +1127,31 @@ Medications section displayName="Hypertension" codeSystem="2.16.840.1.113883.6.96" /> - - - - - - - - - - - - - - - - - 1 - - - Health LS - Immunopop2 Inc. - - - - - - - - - + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immunopop2 Inc. + + + + From 4919b45ac62c8cd7d03cb12b79723b137db73129 Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Tue, 25 Oct 2022 14:16:24 -0700 Subject: [PATCH 14/36] figure stuff out still --- lib/parser/ccda/sections/social_history.js | 63 ++++++++++++++++------ test/fixtures/parser-ccda/CCD_1.xml | 22 ++++++++ 2 files changed, 69 insertions(+), 16 deletions(-) diff --git a/lib/parser/ccda/sections/social_history.js b/lib/parser/ccda/sections/social_history.js index 7fc068b0..ea3d3101 100644 --- a/lib/parser/ccda/sections/social_history.js +++ b/lib/parser/ccda/sections/social_history.js @@ -6,6 +6,32 @@ var cleanup = require("../cleanup"); var bbm = require("@amida-tech/blue-button-meta"); var _ = require("lodash"); + +var stupidCleanup = function (flist) { // We need cleanup function to become objects + var r = function () { + flist.forEach(function (k) { + var tmp; + + if (this.js !== undefined && this.js !== null) { + // console.log( this.js[k]); + tmp = this.js[k]; + delete this.js[k]; + } + if (tmp) { //HACK: added this if + if (tmp.js) { + Object.keys(tmp.js).forEach(function (m) { + if (this.js[m] === undefined) { + this.js[m] = tmp.js[m]; + } + }, this); + } + } + }, this); + }; + return r; +}; + + var exportSocialHistorySection = function (version) { var sectionIDs = bbm.CCDA["sections" + version]; var clinicalStatementsIDs = bbm.CCDA["statements" + version]; @@ -17,7 +43,7 @@ var exportSocialHistorySection = function (version) { ["code", "0..1", "h:code", shared.ConceptDescriptor], ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], ["value", "0..1", "h:value[@xsi:type='CD']/text()"], - // ["history_type", "1..1", "h:templateId/@root"] + ["history_type", "1..1", "h:templateId/@root"], ]) var socialHistoryObservation = component.define("socialHistoryObservation") @@ -38,7 +64,7 @@ var exportSocialHistorySection = function (version) { //["observation_value2", "0..1", "h:value[@xsi:type='CD']/@displayName"] ["referencedValue", "0..1", "h:value[@xsi:type='ED']", shared.TextWithReference], ["nullCodeReplacementText", "0..1", "h:code/h:originalText", shared.TextWithReference], - // ["history_type", "1..1", "h:templateId/@root"] + ["history_type", "1..1", "h:templateId/@root"], ]) .cleanupStep(cleanup.replaceWithObject("code2", { "name": "Smoking Status" @@ -61,32 +87,37 @@ var exportSocialHistorySection = function (version) { var socialHistorySectionUnion = component.define("socialHistorySectionUnion") // template idea for socaial history entries smoking status meaingful user - socialHistorySectionUnion.templateRoot([clinicalStatementsIDs.TobaccoUse, clinicalStatementsIDs.SocialHistoryObservation]) + socialHistorySectionUnion.templateRoot(["2.16.840.1.113883.10.20.22.4.78", "2.16.840.1.113883.10.20.22.4.85"]) socialHistorySectionUnion.fields([ // xpaths update - find template by ID, and go up /.. a level - ["smoking_statuses", "0..1", socialHistoryObservation.xpath(), socialHistoryObservation], - ["tobacco_use", "0..1", tobaccoUse.xpath(), tobaccoUse], + ["smoking_statuses", "0..1", ".//h:templateId[@root='2.16.840.1.113883.10.20.22.4.78,']/..", socialHistoryObservation], + ["tobacco_use", "0..1", ".//h:templateId[@root='2.16.840.1.113883.10.20.22.4.85']/..", tobaccoUse], ]) - socialHistorySectionUnion.cleanupStep(cleanup.replaceWithField("smoking_statuses")); - socialHistorySectionUnion.cleanupStep(cleanup.extractAllFields(["smoking_statuses", "tobacco_use"])); + // socialHistorySectionUnion.cleanupStep(cleanup.replaceWithField("smoking_statuses")); + // socialHistorySectionUnion.cleanupStep(cleanup.extractAllFields(["smoking_statuses", "tobacco_use"])); + socialHistorySectionUnion.cleanupStep(stupidCleanup(["smoking_statuses", "tobacco_use"])); socialHistorySectionUnion.cleanupStep(function () { - var typeMap = { - [sectionIDs.SocialHistorySection]: "smoking_statuses", - [sectionIDs.SocialHistorySectionEntriesOptional]: "smoking_statuses", - [clinicalStatementsIDs.TobaccoUse]: "tobacco_use", - }; - var t = this.js['procedure_type']; - this.js['procedure_type'] = typeMap[t]; + if (this.js) { + var typeMap = { + "2.16.840.1.113883.10.20.22.4.78": "smoking", + // [sectionIDs.SocialHistorySectionEntriesOptional]: "smoking", + "2.16.840.1.113883.10.20.22.4.85": "tobacco", + }; + var t = this.js['history_type']; + this.js['history_type'] = typeMap[t]; + } }); // when other flavors of social history is implemented (pregnancy, social observation, tobacco use) // this should probably be structured similar to procedures with types. if another structure // is chosen procedures need to be updated as well. var socialHistorySection = component.define("socialHistorySection") - socialHistorySection.templateRoot([sectionIDs.SocialHistorySection, sectionIDs.SocialHistorySectionEntriesOptional]); + socialHistorySection.templateRoot([ + sectionIDs.SocialHistorySection, + // sectionIDs.SocialHistorySectionEntriesOptional + ]); socialHistorySection.fields([ ["entry", "0..*", socialHistorySectionUnion.xpath(), socialHistorySectionUnion] ]) - return [socialHistorySection, socialHistoryObservation]; }; exports.socialHistorySection = exportSocialHistorySection; diff --git a/test/fixtures/parser-ccda/CCD_1.xml b/test/fixtures/parser-ccda/CCD_1.xml index bb0058b6..e053cb61 100644 --- a/test/fixtures/parser-ccda/CCD_1.xml +++ b/test/fixtures/parser-ccda/CCD_1.xml @@ -3028,6 +3028,28 @@ codeSystem="2.16.840.1.113883.6.96"/> + + + + + + + + + + + + + + + + + + From 4dc7e8962e1fa41675615e86a600eba47ccb8cca Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Tue, 25 Oct 2022 17:51:34 -0500 Subject: [PATCH 15/36] Adding support for a few more social history types --- lib/parser/ccda/sections/social_history.js | 84 ++++++++++++++-------- test/fixtures/parser-ccda/CCD_1.xml | 26 +++++-- 2 files changed, 74 insertions(+), 36 deletions(-) diff --git a/lib/parser/ccda/sections/social_history.js b/lib/parser/ccda/sections/social_history.js index ea3d3101..923a8de4 100644 --- a/lib/parser/ccda/sections/social_history.js +++ b/lib/parser/ccda/sections/social_history.js @@ -11,7 +11,7 @@ var stupidCleanup = function (flist) { // We need cleanup function to become obj var r = function () { flist.forEach(function (k) { var tmp; - + if (this.js !== undefined && this.js !== null) { // console.log( this.js[k]); tmp = this.js[k]; @@ -42,16 +42,27 @@ var exportSocialHistorySection = function (version) { ["identifiers", "0..*", "h:id", shared.Identifier], ["code", "0..1", "h:code", shared.ConceptDescriptor], ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], - ["value", "0..1", "h:value[@xsi:type='CD']/text()"], + ["value", "0..1", "h:value[@xsi:type='CD']/@displayName"], ["history_type", "1..1", "h:templateId/@root"], - ]) + ]); + + // https://hl7.org/ccdasearch/templates/2.16.840.1.113883.10.20.22.4.109.html + var characteristicsOfHome = component.define("characteristicsOfHome") + .templateRoot(['2.16.840.1.113883.10.20.22.4.109']) + .fields([ + ["identifiers", "0..*", "h:id", shared.Identifier], + ["code", "0..1", "h:code", shared.ConceptDescriptor], + ["value", "0..1", "h:value[@xsi:type='CD']/@displayName"], + ["history_type", "1..1", "h:templateId/@root"], + ]); + var socialHistoryTemplateIds = [ + clinicalStatementsIDs.SocialHistoryObservation, // the correct templateId (smoking status) + clinicalStatementsIDs.SmokingStatusObservation, + "2.16.840.1.113883.10.22.4.78", // incorrect id published in 1.1 DSTU + ]; var socialHistoryObservation = component.define("socialHistoryObservation") - .templateRoot([ - clinicalStatementsIDs.SocialHistoryObservation, // the correct templateId (smoking status) - clinicalStatementsIDs.SmokingStatusObservation, - "2.16.840.1.113883.10.22.4.78", // incorrect id published in 1.1 DSTU - ]) + .templateRoot(socialHistoryTemplateIds) .fields([ //["value", "1..1", "h:code[@code!='ASSERTION']/@displayName"],//, shared.SimpleCode("2.16.840.1.113883.11.20.9.38")], //["value2", "1..1", "h:code[@code='ASSERTION']/@codeSystem"],//, shared.SimpleCode("2.16.840.1.113883.11.20.9.38")], @@ -83,41 +94,56 @@ var exportSocialHistorySection = function (version) { }) // custom step to put null flavor name on value field if present .cleanupStep(cleanup.replaceStringFieldWithNullFlavorName("value")); - + + function xpathTemplateParent(id) { + return ".//h:templateId[@root='" + id + "']/.."; + } + + // A subset of the handful of social history entry types are unioned together + // here just like how it's done in the procedure section. var socialHistorySectionUnion = component.define("socialHistorySectionUnion") // template idea for socaial history entries smoking status meaingful user - socialHistorySectionUnion.templateRoot(["2.16.840.1.113883.10.20.22.4.78", "2.16.840.1.113883.10.20.22.4.85"]) + socialHistorySectionUnion.templateRoot(socialHistoryTemplateIds + .concat(["2.16.840.1.113883.10.20.22.4.85", "2.16.840.1.113883.10.20.22.4.109"])) socialHistorySectionUnion.fields([ // xpaths update - find template by ID, and go up /.. a level - ["smoking_statuses", "0..1", ".//h:templateId[@root='2.16.840.1.113883.10.20.22.4.78,']/..", socialHistoryObservation], - ["tobacco_use", "0..1", ".//h:templateId[@root='2.16.840.1.113883.10.20.22.4.85']/..", tobaccoUse], + [ + "smoking_statuses", + "0..1", + socialHistoryTemplateIds.map(xpathTemplateParent).join(' | '), + socialHistoryObservation + ], + ["tobacco_use", "0..1", xpathTemplateParent("2.16.840.1.113883.10.20.22.4.85"), tobaccoUse], + ["characteristics_of_home", "0..1", xpathTemplateParent("2.16.840.1.113883.10.20.22.4.109"), characteristicsOfHome] ]) - // socialHistorySectionUnion.cleanupStep(cleanup.replaceWithField("smoking_statuses")); - // socialHistorySectionUnion.cleanupStep(cleanup.extractAllFields(["smoking_statuses", "tobacco_use"])); - socialHistorySectionUnion.cleanupStep(stupidCleanup(["smoking_statuses", "tobacco_use"])); + socialHistorySectionUnion.cleanupStep(cleanup.extractAllFields(["smoking_statuses", "tobacco_use", "characteristics_of_home"])); socialHistorySectionUnion.cleanupStep(function () { if (this.js) { - var typeMap = { - "2.16.840.1.113883.10.20.22.4.78": "smoking", - // [sectionIDs.SocialHistorySectionEntriesOptional]: "smoking", + var typeMap = socialHistoryTemplateIds.reduce(function(ids, curr) { + ids[curr] = 'smoking'; + return ids; + }, { "2.16.840.1.113883.10.20.22.4.85": "tobacco", - }; + "2.16.840.1.113883.10.20.22.4.109": "home" + }); + var t = this.js['history_type']; this.js['history_type'] = typeMap[t]; } }); - // when other flavors of social history is implemented (pregnancy, social observation, tobacco use) - // this should probably be structured similar to procedures with types. if another structure - // is chosen procedures need to be updated as well. + var socialHistorySection = component.define("socialHistorySection") - socialHistorySection.templateRoot([ - sectionIDs.SocialHistorySection, - // sectionIDs.SocialHistorySectionEntriesOptional - ]); - socialHistorySection.fields([ - ["entry", "0..*", socialHistorySectionUnion.xpath(), socialHistorySectionUnion] - ]) + socialHistorySection.templateRoot([ + sectionIDs.SocialHistorySection, + // sectionIDs.SocialHistorySectionEntriesOptional + ]); + socialHistorySection.fields([ + ["entry", "0..*", socialHistorySectionUnion.xpath(), socialHistorySectionUnion] + ]) + + socialHistorySection.cleanupStep(cleanup.replaceWithField('entry')); return [socialHistorySection, socialHistoryObservation]; + // return [socialHistorySectionUnion]; }; exports.socialHistorySection = exportSocialHistorySection; diff --git a/test/fixtures/parser-ccda/CCD_1.xml b/test/fixtures/parser-ccda/CCD_1.xml index e053cb61..a9b59261 100644 --- a/test/fixtures/parser-ccda/CCD_1.xml +++ b/test/fixtures/parser-ccda/CCD_1.xml @@ -1,15 +1,15 @@ - + - - @@ -177,7 +177,7 @@ - @@ -2310,9 +2310,9 @@ - @@ -3013,6 +3013,18 @@ + + + + + + + + + + + From 7f7b81dadeff3c3e3741e816ace365715cb7d8a2 Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Wed, 26 Oct 2022 11:01:54 -0700 Subject: [PATCH 16/36] nutrition --- lib/nutrition.js | 143 +++++++++++++++++++++++ lib/parser/ccda/sections/medications.js | 17 +-- lib/parser/ccda/sections/nutrition.js | 144 ++++++++++++++++++++++++ 3 files changed, 296 insertions(+), 8 deletions(-) create mode 100644 lib/nutrition.js create mode 100644 lib/parser/ccda/sections/nutrition.js diff --git a/lib/nutrition.js b/lib/nutrition.js new file mode 100644 index 00000000..ac44e5de --- /dev/null +++ b/lib/nutrition.js @@ -0,0 +1,143 @@ +module.exports = { // this needs work or the section needs or both + "id": "nutrition", + "type": "object", + "properties": { + /* "date_time": { + "$ref": "cda_date" + }, */ + /* "identifiers": { + "type": "string", + "item": { + "$ref": "cda_id" + }, + }, */ + /* "value": { + "type": "string" + }, */ + "code": { + "type": "string" + }, + "title": { + "type": "string" + }, + "text": { + "type": "string" + }, + "entry": { + "type": "array", + "observation": { + "type": "object", + "properties": { + "id": { + "type": "array" + }, + "statusCode": { + "type": "string" + }, + "code": { + "type": "string" + }, + "templateId": { + "type": "string" + }, + "title": { + "type": "string" + }, + "effectiveTime": { + "type": "string" + }, + "value": { + "type": "string" + }, + "entryRelationship": { + "type": "array", + "nutritionAssessment": { + "type": "object", + "properties": { + /* "identifiers": { + "type": "string", + "item": { + "$ref": "cda_id" + }, + }, */ + "templateId": { + "type": "string" + }, + "id": { + "type": "array" + }, + /* "classCode": { + "type": "string" + }, + "moodCode": { + "type": "string" + }, */ + "code": { + "type": "string" + }, + /* "codeSystem": { + "type": "string" + }, */ + "statusCode": { + "type": "string" + }, + "effectiveTime": { + "$ref": "cda_date" + }, + "value": { + "type": "string" + }, + "authorParticipation": { + "type": "object", + "properties": { + "templateId": { + "type": "string" + }, + "time": { + "$ref": "cda_date" + }, + "assignedAuthor": { + "type": "string", + "id": { + "type": "string" + }, + "code": { + "type": "string" + }, + "assignedPerson": { + "type": "string" + }, + "name": { + "type": "array" + }, + "representedOrganization": { + "type": "string", + "id": { + "type": "array" + }, + "name": { + "type": "array" + }, + "telecom": { + "type": "array" + }, + "addr": { + "type": "array" + } + } + } + } + } + } + } + } + } + } + } + }, + "additionalProperties": false, + "minProperties": 1, + // "required": [ + // "value" + // ] +}; \ No newline at end of file diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index 10ac8312..a93a0dce 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -160,10 +160,10 @@ var exportMedicationsSection = function (version) { ["drug_vehicle", "0..1", "h:participant[@typeCode='CSM']/h:participantRole/h:playingEntity[@classCode='MMAT']/h:code", shared.ConceptDescriptor], ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition], /* array, explained: - [0] => name of array elements; + [0] => name of array elements (appear to match the model objects); [1] => cardinality (zero or one, exactly 1, or many); - [2] => ns:xml tag[optional]; - [3] => associated var*/ + [2] => ns:xml tag[@attributes]; + [3] => processor, built-in or user-defined*/ ["indication", "0..1", "h:entryRelationship[@typeCode='RSON']/h:observation", MedicationIndication], //["instructions", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply/*/*/h:templateId[@root='2.16.840.1.113883.10.20.22.4.20']", MedicationInstructions], ["dispense", "0..1", MedicationDispense.xpath(), MedicationDispense] @@ -208,11 +208,12 @@ var exportMedicationsSection = function (version) { // ignore negationInd medications - medicationsSection = component.define("medicationsSection"); - medicationsSection.templateRoot(["2.16.840.1.113883.10.20.22.2.1", "2.16.840.1.113883.10.20.22.2.1.1"]); - medicationsSection.fields([ - ["medications", "0..*", medicationActivity.xpath(), medicationActivity] - ]); + medicationsSection = component.define("medicationsSection") + .templateRoot(["2.16.840.1.113883.10.20.22.2.1", "2.16.840.1.113883.10.20.22.2.1.1"]) + .fields([ + ["medications", "0..*", medicationActivity.xpath(), medicationActivity]// seems to include all of activity and everything defined in it + ]); + // console.log(medicationsSection) medicationsSection.cleanupStep(cleanup.replaceWithField('medications')); return [medicationsSection, medicationActivity]; diff --git a/lib/parser/ccda/sections/nutrition.js b/lib/parser/ccda/sections/nutrition.js new file mode 100644 index 00000000..0f88f078 --- /dev/null +++ b/lib/parser/ccda/sections/nutrition.js @@ -0,0 +1,144 @@ +"use strict"; + +var shared = require("../shared"); +var component = require("@amida-tech/blue-button-xml").component.withNullFlavor(); +var cleanup = require("../cleanup"); +// var processor = require("@amida-tech/blue-button-xml").processor; + +/* var bbm = require("@amida-tech/blue-button-meta"); +var _ = require("lodash"); */ + + + + + + + + + +// this needs work or the model needs or both + + +var exportNutritionSection = function (version) { + + var nutritionalStatusObservation; + var nutritionSection; + var nutritionAssessment; + var authorParticipation; + var representedOrganization; + var assignedAuthor; + var assignedPerson; + // if (version === "") {//default version -- version not used anywhere -- not using the if statement + + representedOrganization = component.define("representedOrganization") + .fields([ + ["id", "0..*", "h:root", shared.Identifier], + ["name", "0..*", "h:name"], + ["telecom", "0..*", "h:telecom"], + ["addr", "0..*", "h:addr", shared.Address], + ]); + assignedPerson = component.define("assignedPerson") + .fields([ + ["name", "0..*", "h.name"] + ]); + assignedAuthor = component.define("assignedAuthor") + .fields([ + ["id", "0..*", "h:root", shared.Identifier], + ["code", "0..1", "h:code"], + ["assignedPerson", "0..1", "h:assignedPerson", assignedPerson], + ["representedOrganization", "0..1", "h:representedOrganization", representedOrganization] + ]); + authorParticipation = component.define("authorParticipation") + .templateRoot("2.16.840.1.113883.10.20.22.4.119") + .fields([ + // ["identifiers", "1..*", "h:id", shared.Identifier], + ["templateId", "1..1", "h:templateId[@root='2.16.840.1.113883.10.20.22.4.119']"], + ["time", "1..1", "h:time", shared.EffectiveTime], + ["assignedAuthor", "1..1", "h:assignedAuthor", assignedAuthor], + ["name", "0..*", "h:name", [shared.assignedEntity, shared.IndividualName] ] + ]); + + nutritionAssessment = component.define("nutritionAssessment") + .templateRoot("2.16.840.1.113883.10.20.22.4.138") + .fields([ + // ["identifiers", "1..*", "h:id", shared.Identifier], + ["templateId", "1..1", "h:templateId[@root='2.16.840.1.113883.10.20.22.4.138']"], +/* ["moodCode", "1..1", "h:observation[@moodCode='EVN']"], + ["classCode", "1..1", "h:observation[@classCode='OBS']"], */ + ["code", "1..1", "h:code[@code='75303-8', @codeSystem='2.16.840.1.113883.6.1']"], + ["id", "1..*", "@root"], + // ["codeSystem", "1..1", "h:observation[]"], + ["statusCode", "1..1", "h:statusCode[ @code='completed']"], + ["effectiveTime", "1..1", "h:effectiveTime", shared.EffectiveTime], + ["entryRelationship", "1..1", "h:entryRelationship[@typeCode='SUBJ']"], + ["value", "1..1", "h:value"], + ["assignedAuthor", "1..1", "h:assignedAuthor", authorParticipation] + ]); + nutritionalStatusObservation = component.define("nutritionalStatusObservation") + .templateRoot("2.16.840.1.113883.10.20.22.4.124") + .fields([ + // ["identifiers", "1..*", "h:id", shared.Identifier], + ["templateId", "1..1", "h:templateId[@root='2.16.840.1.113883.10.20.22.4.124']"], + ["id", "1..*", "@root"], + // ["moodCode", "1..1", "h:observation[@moodCode='EVN']"], + // ["classCode", "1..1", "h:observation[@classCode='OBS']"], + // ["codeSystem", "1..1", "h:observation[@codeSystem='2.16.840.1.113883.6.1']"], + ["statusCode", "1..1", "h:statusCode[@code='completed']"], + ["entryRelationship", "1..1", "h:entryRelationship[@typeCode='SUBJ']", nutritionAssessment], + ["code", "1..1", "h:code[@code='75305-3',@codeSystem='2.16.840.1.113883.6.1']"], + ["effectiveTime", "1..1", "h:effectiveTime", shared.EffectiveTime], + ["value", "1..1", "h:value"], + // ["title", "1..1", "h:title"], + // ["nutritionAssessment", "1..1", "h:observation", nutritionAssessment] + ]); + + nutritionSection = component.define("nutritionSection") + .templateRoot("2.16.840.1.113883.10.20.22.2.57") + .fields([ + ["templateId", "1..1", "h:id[@root='2.16.840.1.113883.10.20.22.2.57']", shared.Identifier], + ["code", "1..1", "h:code[@code='61144-2', @codeSystem='2.16.840.1.113883.6.1']", shared.TextWithReference], + // , "1..1", "h:codeSystem", shared.ConceptDescriptor], + ["title", "1..1", "h:title"], + ["text", "1..1", "h:paragraph"], + ["entry", "1..1", "h:observation", nutritionalStatusObservation], + // ["observation", "1..1", "h:observation", nutritionalStatusObservation] + ]); + // console.log(authorParticipation, nutritionalAssessment, nutritionalStatusObservation, nutritionSection) + nutritionSection.cleanupStep(cleanup.replaceWithField('nutrition')); + return nutritionSection; +}; + +exports.nutritionSection = exportNutritionSection; +exports.nutritionEntry = exportNutritionSection; + +/* +{ + TextWithReference: { + }, + NegationIndicator: { + }, + ConceptDescriptor: { + }, + AgeDescriptor: { + }, + SimplifiedCode: { + }, + PhysicalQuantity: { + }, + XsiTypedValue: { + }, + EventOffset: { + }, + EffectiveTime: { + }, + IndividualName: { + }, + Address: { + }, + Organization: { + }, + assignedEntity: { + }, + serviceDeliveryLocation: { + } +} */ \ No newline at end of file From 1c916d3c0f9b1ab05463186db984e2b3cf2f4b2a Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Wed, 26 Oct 2022 11:15:57 -0700 Subject: [PATCH 17/36] initial --- lib/nutrition.js | 3 + lib/parser/ccda/sections/nutrition.js | 1 + lib/parser/router.js | 2 + run.js | 2 +- test1.json | 2385 +++++++++++++++++++++++++ 5 files changed, 2392 insertions(+), 1 deletion(-) create mode 100644 test1.json diff --git a/lib/nutrition.js b/lib/nutrition.js index ac44e5de..dde3bd9f 100644 --- a/lib/nutrition.js +++ b/lib/nutrition.js @@ -14,6 +14,9 @@ module.exports = { // this needs work or the section needs or both /* "value": { "type": "string" }, */ + /* "value": { + "type": "string" + }, */ "code": { "type": "string" }, diff --git a/lib/parser/ccda/sections/nutrition.js b/lib/parser/ccda/sections/nutrition.js index 0f88f078..91c3738c 100644 --- a/lib/parser/ccda/sections/nutrition.js +++ b/lib/parser/ccda/sections/nutrition.js @@ -29,6 +29,7 @@ var exportNutritionSection = function (version) { var assignedAuthor; var assignedPerson; // if (version === "") {//default version -- version not used anywhere -- not using the if statement + // if (version === "") {//default version -- version not used anywhere -- not using the if statement representedOrganization = component.define("representedOrganization") .fields([ diff --git a/lib/parser/router.js b/lib/parser/router.js index 7c2540e7..99b29416 100644 --- a/lib/parser/router.js +++ b/lib/parser/router.js @@ -39,6 +39,7 @@ var generateComponents = function (version) { ccda_header: require("./ccda/header").header, ccda_vitals: require("./ccda/sections/vitals").vitalSignsSection(version)[0], ccda_medications: require("./ccda/sections/medications").medicationsSection(version)[0], + ccda_nutrition: require("./ccda/sections/nutrition").nutritionSection(version)[0], ccda_problems: require("./ccda/sections/problems").problemsSection(version)[0], ccda_immunizations: require("./ccda/sections/immunizations").immunizationsSection(version)[0], ccda_results: require("./ccda/sections/results").resultsSection(version)[0], @@ -56,6 +57,7 @@ var generateComponents = function (version) { //exposing individual entries just in case ccda_vitals_entry: require("./ccda/sections/vitals").vitalSignsEntry(version)[1], ccda_medications_entry: require("./ccda/sections/medications").medicationsEntry(version)[1], + ccda_nutrition: require("./ccda/sections/nutrition").nutritionSection(version)[1], ccda_problems_entry: require("./ccda/sections/problems").problemsEntry(version)[1], ccda_immunizations_entry: require("./ccda/sections/immunizations").immunizationsEntry(version)[1], ccda_results_entry: require("./ccda/sections/results").resultsEntry(version)[1], diff --git a/run.js b/run.js index 6cc05c8c..99953756 100644 --- a/run.js +++ b/run.js @@ -2,7 +2,7 @@ var fs = require('fs'); var path = require('path'); var bb = require('./'); -var file = path.join(__dirname, 'test/fixtures/parser-ccda/CCD_SocialHistory_PQ_value.xml'); +var file = path.join(__dirname, 'test/fixtures/parser-ccda/Transfer_Summary.xml'); var xml = fs.readFileSync(file, {encoding: 'utf-8'}); var result = bb.parse(xml); diff --git a/test1.json b/test1.json new file mode 100644 index 00000000..9f0c2138 --- /dev/null +++ b/test1.json @@ -0,0 +1,2385 @@ +{ + "data": { + "header": { + "identifiers": [ + { + "identifier": "04fc2b90-10e0-11e2-892e-0800200c9a66" + } + ], + "confidentiality_code": { + "code": "N", + "name": "Normal", + "code_system_name": "Confidentiality Code" + }, + "code": { + "name": "Provider Unspecified Transfer Summary", + "code": "18761-7", + "code_system_name": "LOINC" + }, + "template": [ + "2.16.840.1.113883.10.20.22.1.1", + "2.16.840.1.113883.10.20.22.1.13" + ], + "title": "Transfer Summary", + "date_time": { + "point": { + "date": "2013-09-21T13:00:00.000Z", + "precision": "minute" + } + }, + "author": { + "author": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.4.6", + "extension": "5555555555" + } + ], + "name": [ + { + "middle": [ + "Patty" + ], + "last": "Primary", + "suffix": "M.D.", + "first": "Patricia" + } + ], + "address": [ + { + "street_lines": [ + "1004 Healthcare Drive" + ], + "city": "Portland", + "state": "OR", + "zip": "99123", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1004", + "type": "work place" + } + ], + "code": [ + { + "name": "Adult Medicine", + "code": "207QA0505X", + "code_system_name": "Healthcare Provider Taxonomy (HIPAA)" + } + ] + } + ], + "date_time": { + "point": { + "date": "2013-07-30T00:00:00.000Z", + "precision": "day" + } + } + }, + "data_enterer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.4.6", + "extension": "333777777" + } + ], + "name": [ + { + "last": "Enter", + "first": "Ellen" + } + ], + "address": [ + { + "street_lines": [ + "1007 Healthcare Drive" + ], + "city": "Portland", + "state": "OR", + "zip": "99123", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1050", + "type": "work place" + } + ] + }, + "informant": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5", + "extension": "888888888" + } + ], + "name": [ + { + "last": "Hippocrates", + "suffix": "D.O.", + "first": "Harold" + } + ], + "address": [ + { + "street_lines": [ + "1007 Healthcare Drive" + ], + "city": "Portland", + "state": "OR", + "zip": "99123", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1003", + "type": "work place" + } + ] + }, + "custodian": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.4.6", + "extension": "321CX" + } + ], + "name": [ + "Good Health HIE" + ], + "address": [ + { + "street_lines": [ + "1009 Healthcare Drive" + ], + "city": "Portland", + "state": "OR", + "zip": "99123", + "country": "US", + "use": "work place" + } + ], + "phone": [ + { + "number": "+1(555)555-1009", + "type": "work place" + } + ] + }, + "service_event": { + "date_time": { + "low": { + "date": "2013-06-01T00:00:00.000Z", + "precision": "day" + }, + "high": { + "date": "2013-08-15T00:00:00.000Z", + "precision": "day" + } + }, + "performer": [ + { + "performer": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.4.6", + "extension": "5555555555" + } + ], + "name": [ + { + "middle": [ + "Patty" + ], + "last": "Primary", + "suffix": "M.D.", + "first": "Patricia" + } + ], + "address": [ + { + "street_lines": [ + "1004 Healthcare Drive" + ], + "city": "Portland", + "state": "OR", + "zip": "99123", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1004", + "type": "work place" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "1.1.1.1.1.1.1.1.2", + "extension": "219BX" + } + ], + "name": [ + "Good Health Hospital" + ], + "address": [ + { + "street_lines": [ + "1004 Health Drive" + ], + "city": "Portland", + "state": "OR", + "zip": "99123", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-5000", + "type": "work place" + } + ] + } + ], + "code": [ + { + "name": "Adult Medicine", + "code": "207QA0505X", + "code_system_name": "Healthcare Provider Taxonomy (HIPAA)" + } + ] + } + ], + "code": { + "name": "Primary Care Provider", + "code": "PCP", + "code_system_name": "ParticipationFunction" + } + }, + { + "performer": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.4.6", + "extension": "5555555555" + } + ], + "name": [ + { + "middle": [ + "Renal" + ], + "last": "Primary", + "suffix": "M.D.", + "first": "Rory" + } + ], + "address": [ + { + "street_lines": [ + "1004 Healthcare Drive" + ], + "city": "Ann Arbor", + "state": "MA", + "zip": "99123", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1038", + "type": "work place" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "1.1.1.1.1.1.1.1.2", + "extension": "219BX" + } + ], + "name": [ + "Good Health Hospital" + ], + "address": [ + { + "street_lines": [ + "1036 Health Drive" + ], + "city": ">Ann Arbor", + "state": "MA", + "zip": "99123", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1039", + "type": "work place" + } + ] + } + ], + "code": [ + { + "name": "Nephrologist", + "code": "207RN0300X", + "code_system_name": "Healthcare Provider Taxonomy (HIPAA)" + } + ] + } + ] + } + ] + } + }, + "demographics": { + "name": { + "last": "Betterhalf", + "first": "Eve" + }, + "dob": { + "point": { + "date": "1945-05-01T00:00:00.000Z", + "precision": "day" + } + }, + "gender": { + "name": "Female", + "code": "F", + "code_system_name": "HL7 AdministrativeGender" + }, + "identifiers": [ + { + "identifier": "2.16.840.1.113883.4.1", + "extension": "444222222" + } + ], + "marital_status": { + "name": "Married", + "code": "M", + "code_system_name": "HL7 Marital Status" + }, + "addresses": [ + { + "street_lines": [ + "2222 Home Street" + ], + "city": "Beaverton", + "state": "OR", + "zip": "97867", + "country": "US", + "use": "primary home" + } + ], + "phone": [ + { + "number": "+1(555)555-2003", + "type": "primary home" + } + ], + "race": { + "name": "White", + "code": "2106-3", + "code_system_name": "Race and Ethnicity - CDC" + }, + "ethnicity": { + "name": "Not Hispanic or Latino", + "code": "2186-5", + "code_system_name": "Race and Ethnicity - CDC" + }, + "languages": [ + { + "language": { + "code": "eng" + }, + "preferred": true, + "mode": { + "name": "Expressed spoken", + "code": "ESP", + "code_system_name": "LanguageAbilityMode" + }, + "proficiency": { + "name": "Good", + "code": "G", + "code_system_name": "LanguageAbilityProficiency" + } + } + ], + "religion": { + "name": "Christian (non-Catholic, non-specific)", + "code": "1013", + "code_system_name": "HL7 Religious Affiliation" + }, + "birthplace": { + "street_lines": [ + "4444 Home Street" + ], + "city": "Beaverton", + "state": "OR", + "zip": "97867", + "country": "US" + }, + "guardians": [ + { + "relation": { + "name": "Power of Attorney", + "code": "POWATT", + "code_system_name": "ResponsibleParty" + }, + "addresses": [ + { + "street_lines": [ + "2222 Home Street" + ], + "city": "Beaverton", + "state": "OR", + "zip": "97867", + "country": "US", + "use": "primary home" + } + ], + "names": [ + { + "middle": [ + "Bo" + ], + "last": "Betterhalf", + "first": "Boris" + } + ], + "phone": [ + { + "number": "+1(555)555-2008", + "type": "mobile contact" + } + ] + } + ] + }, + "vitals": [ + { + "identifiers": [ + { + "identifier": "ed9589fd-fda0-41f7-a3d0-dc537554f5c2" + } + ], + "vital": { + "name": "Height", + "code": "8302-2", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2012-09-10T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 177, + "unit": "cm" + }, + { + "identifiers": [ + { + "identifier": "f4e729e2-a97f-4a7e-8e23-c92f9b6b55cf" + } + ], + "vital": { + "name": "Patient Body Weight - Measured", + "code": "3141-9", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2013-02-12T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 86, + "unit": "kg" + }, + { + "identifiers": [ + { + "identifier": "a0e39c70-9674-4b2a-9837-cdf74200d8d5" + } + ], + "vital": { + "name": "Intravascular Systolic", + "code": "8480-6", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2013-08-01T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 132, + "unit": "mm[Hg]" + }, + { + "identifiers": [ + { + "identifier": "1c2748b7-e440-41ba-bc01-dde97d84a036" + } + ], + "vital": { + "name": "BP Diastolic", + "code": "8462-4", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2012-09-10T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 88, + "unit": "mm[Hg]" + }, + { + "identifiers": [ + { + "identifier": "05c047cd-28c3-41cd-be6c-56f8cc0c3f2f" + } + ], + "vital": { + "name": "Height", + "code": "8302-2", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2011-09-01T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 177, + "unit": "cm" + }, + { + "identifiers": [ + { + "identifier": "21b0f3d5-7d07-4f4f-ad7e-c33dc2ca3835" + } + ], + "vital": { + "name": "Patient Body Weight - Measured", + "code": "3141-9", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2011-09-01T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 88, + "unit": "kg" + }, + { + "identifiers": [ + { + "identifier": "b046c35a-59c7-4215-ae09-9a8409a30b21" + } + ], + "vital": { + "name": "BP Systolic", + "code": "8480-6", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2011-09-01T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 128, + "unit": "mm[Hg]" + }, + { + "identifiers": [ + { + "identifier": "44f54e66-fb4b-4ee5-9ced-9574ef307a23" + } + ], + "vital": { + "name": "BP Diastolic", + "code": "8462-4", + "code_system_name": "LOINC" + }, + "status": "completed", + "date_time": { + "point": { + "date": "2011-09-01T00:00:00.000Z", + "precision": "day" + } + }, + "interpretations": [ + "Normal" + ], + "value": 80, + "unit": "mm[Hg]" + } + ], + "results": [ + { + "identifiers": [ + { + "identifier": "7d5a02b0-67a4-11db-bd13-0800200c9a66" + } + ], + "result_set": { + "name": "CBC W Auto Differential panel in Blood", + "code": "57021-8", + "code_system_name": "LOINC" + }, + "results": [ + { + "identifiers": [ + { + "identifier": "107c2dc0-67a5-11db-bd13-0800200c9a66" + } + ], + "result": { + "name": "Hemoglobin", + "code": "718-7", + "code_system_name": "LOINC" + }, + "date_time": { + "point": { + "date": "2013-03-11T16:30:00.000Z", + "precision": "minute" + } + }, + "status": "completed", + "reference_range": { + "low": "12.0", + "high": "15.5", + "unit": "g/dL" + }, + "interpretations": [ + { + "code": "N", + "name": "Normal", + "code_system_name": "HL7 Result Interpretation" + } + ], + "value": 13.2, + "unit": "g/dL" + }, + { + "identifiers": [ + { + "identifier": "a69b3d60-2ffd-4440-958b-72b3335ff35f" + } + ], + "result": { + "name": "Leukocytes", + "code": "6690-2", + "code_system_name": "LOINC" + }, + "date_time": { + "point": { + "date": "2013-03-11T16:30:00.000Z", + "precision": "minute" + } + }, + "status": "completed", + "reference_range": { + "low": "4.3", + "high": "10.8", + "unit": "10*9/L" + }, + "interpretations": [ + { + "code": "N", + "name": "Normal", + "code_system_name": "HL7 Result Interpretation" + } + ], + "value": 6.7, + "unit": "10*9/L" + }, + { + "identifiers": [ + { + "identifier": "ef5c1c58-4665-4556-a8e8-6e720d82f572" + } + ], + "result": { + "name": "Platelets", + "code": "777-3", + "code_system_name": "LOINC" + }, + "date_time": { + "point": { + "date": "2013-03-11T16:30:00.000Z", + "precision": "minute" + } + }, + "status": "completed", + "reference_range": { + "low": "150", + "high": "350", + "unit": "10*9/L" + }, + "interpretations": [ + { + "code": "LX", + "name": "below low threshold", + "code_system_name": "HL7 Result Interpretation" + } + ], + "value": 123, + "unit": "10*9/L" + }, + { + "identifiers": [ + { + "identifier": "7c0704bb-9c40-41b5-9c7d-26b2d59e234f" + } + ], + "result": { + "name": "Hematocrit", + "code": "4544-3", + "code_system_name": "LOINC" + }, + "date_time": { + "point": { + "date": "2013-03-11T16:30:00.000Z", + "precision": "minute" + } + }, + "status": "completed", + "reference_range": { + "low": "34.9", + "high": "44.5", + "unit": "%" + }, + "interpretations": [ + { + "name": "below low threshold", + "code": "LX", + "code_system_name": "HL7 Result Interpretation" + } + ], + "value": 35.3, + "unit": "%" + }, + { + "identifiers": [ + { + "identifier": "bccd6fc9-0c7f-455e-8616-923ed0d04d09" + } + ], + "result": { + "name": "Erythrocytes", + "code": "789-8", + "code_system_name": "LOINC" + }, + "date_time": { + "point": { + "date": "2013-03-11T16:30:00.000Z", + "precision": "minute" + } + }, + "status": "completed", + "reference_range": { + "low": "3.90", + "high": "5.03", + "unit": "10*12/L" + }, + "interpretations": [ + { + "code": "N", + "name": "Normal", + "code_system_name": "HL7 Result Interpretation" + } + ], + "value": 4.21, + "unit": "10*12/L" + } + ] + }, + { + "identifiers": [ + { + "identifier": "122ed3ae-6d9e-43d0-bfa2-434ea34b1426" + } + ], + "result_set": { + "name": "Blood chemistry test", + "code": "166312007", + "code_system_name": "SNOMED CT" + }, + "results": [ + { + "identifiers": [ + { + "identifier": "aed821af-3330-4138-97f0-e84dfe5f3c35" + } + ], + "result": { + "name": "Urea nitrogen, Serum", + "code": "3094-0", + "code_system_name": "LOINC" + }, + "date_time": { + "point": { + "date": "2008-03-20T17:30:00.000Z", + "precision": "minute" + } + }, + "status": "active", + "interpretations": [ + { + "name": "normal", + "code": "N", + "code_system_name": "HL7 Result Interpretation" + } + ] + } + ] + } + ], + "medications": [ + { + "date_time": { + "low": { + "date": "2013-01-03T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "cdbd33f0-6cde-11db-9fe1-0800200c9a66" + } + ], + "status": "Completed", + "product": { + "identifiers": [ + { + "identifier": "2a620155-9d11-439e-92b3-5d9815ff4ee8" + } + ], + "product": { + "name": "Proventil 0.09 MG/ACTUAT inhalant solution", + "code": "573621", + "code_system_name": "RXNORM" + }, + "manufacturer": "Medication Factory Inc." + }, + "administration": { + "route": { + "name": "RESPIRATORY (INHALATION)", + "code": "C38216", + "code_system_name": "Medication Route FDA" + }, + "form": { + "name": "Puff", + "code": "PUFF", + "code_system_name": "orderableDrugForm" + }, + "dose": { + "value": 2 + }, + "interval": { + "period": { + "value": 6, + "unit": "h" + }, + "frequency": true + } + }, + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.4.6", + "extension": "5555555555" + } + ], + "phone": [ + { + "number": "+1(555)555-1004", + "type": "work place" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.1393" + } + ], + "name": [ + "Community Health and Hospitals" + ], + "phone": [ + { + "number": "+1(555)555-5000", + "type": "work place" + } + ] + } + ] + }, + "drug_vehicle": { + "name": "Aerosol", + "code": "324049", + "code_system_name": "RXNORM" + }, + "indication": { + "identifiers": [ + { + "identifier": "db734647-fc99-424c-a864-7e3cda82e703", + "extension": "45665" + } + ], + "code": { + "name": "Finding", + "code": "404684003", + "code_system_name": "SNOMED CT" + }, + "date_time": { + "low": { + "date": "2013-01-03T00:00:00.000Z", + "precision": "day" + } + }, + "value": { + "name": "Asthma", + "code": "195967001", + "code_system_name": "SNOMED CT" + } + } + }, + { + "date_time": { + "low": { + "date": "2012-03-18T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "6c844c75-aa34-411c-b7bd-5e4a9f206e29" + } + ], + "status": "Completed", + "product": { + "identifiers": [ + { + "identifier": "2a620155-9d11-439e-92b3-5d9815ff4ee8" + } + ], + "product": { + "name": "Atenolol 25 MG Oral Tablet", + "code": "197380", + "code_system_name": "RXNORM" + } + }, + "administration": { + "route": { + "name": "ORAL", + "code": "C38288", + "code_system_name": "Medication Route FDA" + }, + "dose": { + "value": 1 + }, + "interval": { + "period": { + "value": 12, + "unit": "h" + }, + "frequency": true + } + }, + "indication": { + "identifiers": [ + { + "identifier": "e63166c7-6482-4a44-83a1-37ccdbde725b" + } + ], + "code": { + "name": "Finding", + "code": "404684003", + "code_system_name": "SNOMED CT" + }, + "value": { + "name": "Hypertension", + "code": "38341003", + "code_system_name": "SNOMED CT" + } + } + } + ], + "encounters": [ + { + "encounter": { + "name": "Office consultation - 15 minutes", + "code": "99241", + "code_system_name": "CPT", + "translations": [ + { + "name": "Ambulatory", + "code": "AMB", + "code_system_name": "ActCode" + } + ] + }, + "identifiers": [ + { + "identifier": "2a620155-9d11-439e-92b3-5d9815ff4de8" + } + ], + "date_time": {}, + "performers": [ + { + "name": [ + { + "last": "Assigned", + "first": "Amanda" + } + ], + "address": [ + { + "street_lines": [ + "102 Health Drive" + ], + "city": "Ann Arbor", + "state": "MI", + "zip": "99099", + "country": "US" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.1394" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ], + "code": [ + { + "name": "General Physician", + "code": "59058001", + "code_system_name": "SNOMED CT" + } + ] + } + ], + "locations": [ + { + "name": "Good Health Clinic", + "location_type": { + "name": "Inpatient medical ward", + "code": "1060-3", + "code_system_name": "HealthcareServiceLocation" + }, + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US" + } + ] + } + ], + "findings": [ + { + "identifiers": [ + { + "identifier": "db734647-fc99-424c-a864-7e3cda82e703" + } + ], + "value": { + "name": "Bronchitis", + "code": "32398004", + "code_system_name": "SNOMED CT" + } + } + ] + } + ], + "allergies": [ + { + "identifiers": [ + { + "identifier": "36e3e930-7b14-11db-9fe1-0800200c9a66" + } + ], + "date_time": { + "low": { + "date": "1998-05-01T19:45:00.000Z", + "precision": "minute" + } + }, + "observation": { + "identifiers": [ + { + "identifier": "4adc1020-7b14-11db-9fe1-0800200c9a66" + } + ], + "allergen": { + "name": "Penicillin", + "code": "70618", + "code_system_name": "RXNORM" + }, + "intolerance": { + "name": "Allergy to substance", + "code": "419199007", + "code_system_name": "SNOMED CT" + }, + "date_time": { + "low": { + "date": "1998-05-01T00:00:00.000Z", + "precision": "day" + } + }, + "reactions": [ + { + "identifiers": [ + { + "identifier": "4adc1020-7b14-11db-9fe1-0800200c9a64" + } + ], + "date_time": { + "low": { + "date": "2008-02-26T16:05:00.000Z", + "precision": "minute" + }, + "high": { + "date": "2008-02-28T20:05:00.000Z", + "precision": "minute" + } + }, + "reaction": { + "name": "Nausea", + "code": "422587007", + "code_system_name": "SNOMED CT" + }, + "severity": { + "code": { + "name": "Mild", + "code": "255604002", + "code_system_name": "SNOMED CT" + } + } + } + ], + "status": { + "name": "Active", + "code": "55561003", + "code_system_name": "SNOMED CT" + } + } + }, + { + "identifiers": [ + { + "identifier": "b03805bd-2eb6-4ab8-a9ff-473c6653971a" + } + ], + "date_time": { + "low": { + "date": "1998-05-01T19:45:00.000Z", + "precision": "minute" + } + }, + "observation": { + "identifiers": [ + { + "identifier": "901db0f8-9355-4794-81cd-fd951ef07917" + } + ], + "allergen": { + "name": "Codeine", + "code": "2670", + "code_system_name": "RXNORM" + }, + "intolerance": { + "name": "Allergy to substance", + "code": "419199007", + "code_system_name": "SNOMED CT" + }, + "reactions": [ + { + "identifiers": [ + { + "identifier": "38c63dea-1a43-4f84-ab71-1ffd04f6a1dd" + } + ], + "reaction": { + "name": "Wheezing", + "code": "56018004", + "code_system_name": "SNOMED CT" + }, + "severity": { + "code": { + "name": "Moderate", + "code": "6736007", + "code_system_name": "SNOMED CT" + } + } + } + ], + "severity": { + "code": { + "name": "Mild", + "code": "255604002", + "code_system_name": "SNOMED CT" + } + }, + "status": { + "name": "Active", + "code": "55561003", + "code_system_name": "SNOMED CT" + } + } + } + ], + "immunizations": [ + { + "date_time": { + "point": { + "date": "1999-11-01T00:00:00.000Z", + "precision": "month" + } + }, + "identifiers": [ + { + "identifier": "e6f1ba43-c0ed-4b9b-9f12-f435d8ad8f92" + } + ], + "status": "complete", + "product": { + "product": { + "name": "Influenza virus vaccine", + "code": "88", + "code_system_name": "CVX", + "translations": [ + { + "name": "Influenza, seasonal, injectable", + "code": "141", + "code_system_name": "CVX" + } + ] + }, + "lot_number": "1", + "manufacturer": "Health LS - Immuno Inc." + }, + "administration": { + "route": { + "name": "Intramuscular injection", + "code": "C28161", + "code_system_name": "Medication Route FDA" + }, + "dose": { + "value": 50, + "unit": "ug" + } + }, + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.456", + "extension": "2981824" + } + ], + "name": [ + { + "last": "Assigned", + "first": "Amanda" + } + ], + "address": [ + { + "street_lines": [ + "102 Health Drive" + ], + "city": "Ann Arbor", + "state": "MI", + "zip": "99099", + "country": "US" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.1394" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ] + }, + "instructions": { + "code": { + "name": "immunization education", + "code": "171044003", + "code_system_name": "SNOMED CT" + }, + "free_text": "Possible flu-like symptoms for three days." + } + }, + { + "date_time": { + "point": { + "date": "1998-12-15T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "e6f1ba43-c0ed-4b9b-9f12-f435d8ad8f92" + } + ], + "status": "refused", + "product": { + "product": { + "name": "Influenza virus vaccine", + "code": "88", + "code_system_name": "CVX", + "translations": [ + { + "name": "Influenza, seasonal, injectable", + "code": "141", + "code_system_name": "CVX" + } + ] + }, + "lot_number": "1", + "manufacturer": "Health LS - Immuno Inc." + }, + "administration": { + "route": { + "name": "Intramuscular injection", + "code": "C28161", + "code_system_name": "Medication Route FDA" + }, + "dose": { + "value": 50, + "unit": "ug" + } + }, + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.456", + "extension": "2981824" + } + ], + "name": [ + { + "last": "Assigned", + "first": "Amanda" + } + ], + "address": [ + { + "street_lines": [ + "102 Health Drive" + ], + "city": "Ann Arbor", + "state": "MI", + "zip": "99099", + "country": "US" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.1394" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ] + }, + "instructions": { + "code": { + "name": "immunization education", + "code": "171044003", + "code_system_name": "SNOMED CT" + }, + "free_text": "Possible flu-like symptoms for three days." + } + }, + { + "date_time": { + "point": { + "date": "1998-12-15T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "e6f1ba43-c0ed-4b9b-9f12-f435d8ad8f92" + } + ], + "status": "complete", + "product": { + "product": { + "name": "Pneumococcal polysaccharide vaccine", + "code": "33", + "code_system_name": "CVX", + "translations": [ + { + "name": "Pneumococcal NOS", + "code": "109", + "code_system_name": "CVX" + } + ] + }, + "lot_number": "1", + "manufacturer": "Health LS - Immuno Inc." + }, + "administration": { + "route": { + "name": "Intramuscular injection", + "code": "C28161", + "code_system_name": "Medication Route FDA" + }, + "dose": { + "value": 50, + "unit": "ug" + } + }, + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.456", + "extension": "2981824" + } + ], + "name": [ + { + "last": "Assigned", + "first": "Amanda" + } + ], + "address": [ + { + "street_lines": [ + "102 Health Drive" + ], + "city": "Ann Arbor", + "state": "MI", + "zip": "99099", + "country": "US" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.1394" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ] + } + }, + { + "date_time": { + "point": { + "date": "1998-12-15T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "e6f1ba43-c0ed-4b9b-9f12-f435d8ad8f92" + } + ], + "status": "refused", + "product": { + "product": { + "name": "Tetanus and diphtheria toxoids - preservative free", + "code": "103", + "code_system_name": "CVX", + "translations": [ + { + "name": "Tetanus and diphtheria toxoids - preservative free", + "code": "09", + "code_system_name": "CVX" + } + ] + }, + "lot_number": "1", + "manufacturer": "Health LS - Immuno Inc." + }, + "administration": { + "route": { + "name": "Intramuscular injection", + "code": "C28161", + "code_system_name": "Medication Route FDA" + }, + "dose": { + "value": 50, + "unit": "ug" + } + }, + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.456", + "extension": "2981824" + } + ], + "name": [ + { + "last": "Assigned", + "first": "Amanda" + } + ], + "address": [ + { + "street_lines": [ + "102 Health Drive" + ], + "city": "Ann Arbor", + "state": "MI", + "zip": "99099", + "country": "US" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.1394" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ] + }, + "refusal_reason": "Patient objection", + "indications": [ + { + "identifiers": [ + { + "identifier": "2a620155-9d11-439e-92b3-5d9815ff4dd8" + } + ], + "code": { + "name": "Patient Objection", + "code": "PATOBJ", + "code_system_name": "Act Reason" + } + } + ] + }, + { + "date_time": { + "point": { + "date": "2013-08-01T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "de10790f-1496-4719-8fe6-f1b87b6219f7" + } + ], + "status": "complete", + "product": { + "product": { + "name": "Hepatitis B vaccine", + "code": "45", + "code_system_name": "CVX" + }, + "lot_number": "1" + }, + "administration": { + "route": { + "name": "Intramuscular injection", + "code": "C28161", + "code_system_name": "Medication Route FDA" + } + }, + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.456", + "extension": "2981824" + } + ], + "name": [ + { + "last": "Assigned", + "first": "Amanda" + } + ], + "address": [ + { + "street_lines": [ + "102 Health Drive" + ], + "city": "Ann Arbor", + "state": "MI", + "zip": "99099", + "country": "US" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5.9999.1394" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ] + } + } + ], + "social_history": [ + { + "date_time": { + "point": { + "date": "2013-03-12T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "9b56c25d-9104-45ee-9fa4-e0f3afaa01c1" + } + ], + "code": { + "name": "Alcoholic drinks per day", + "code": "74013-4", + "code_system_name": "LOINC" + }, + "value": "1" + }, + { + "date_time": { + "point": { + "date": "2013-06-21T00:00:00.000Z", + "precision": "day" + } + }, + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19", + "extension": "123456789" + } + ], + "code": { + "name": "Tobacco smoking status NHIS", + "code": "72166-2", + "code_system_name": "LOINC" + }, + "value": "Former smoker" + } + ], + "problems": [ + { + "date_time": { + "low": { + "date": "2013-07-06T19:45:00.000Z", + "precision": "minute" + } + }, + "identifiers": [ + { + "identifier": "ab1791b0-5c71-11db-b0de-0800200c9a66" + } + ], + "problem": { + "code": { + "name": "malignant neoplasm of liver (disorder)", + "code": "93870000", + "code_system_name": "SNOMED CT" + }, + "date_time": { + "low": { + "date": "2013-07-03T00:00:00.000Z", + "precision": "day" + } + } + }, + "status": { + "name": "Active" + }, + "source_list_identifiers": [ + { + "identifier": "ec8a6ff8-ed4b-4f7e-82c3-e98e58b45de7" + } + ] + }, + { + "date_time": { + "low": { + "date": "2007-04-14T23:15:00.000Z", + "precision": "minute" + } + }, + "identifiers": [ + { + "identifier": "11d088a8-b957-401c-8ee0-3bd20a772fc0" + }, + { + "identifier": "4991db40-4c4f-41e8-9146-50c12d716424" + } + ], + "problem": { + "code": { + "name": "Chest pain", + "code": "29857009", + "code_system_name": "SNOMED CT" + }, + "date_time": { + "low": { + "date": "2007-04-14T00:00:00.000Z", + "precision": "day" + } + } + }, + "source_list_identifiers": [ + { + "identifier": "682f6be1-0793-42f4-904b-e199e6e8e457" + } + ] + }, + { + "date_time": { + "low": { + "date": "1998-03-10T18:30:00.000Z", + "precision": "minute" + }, + "high": { + "date": "1998-05-04T19:45:00.000Z", + "precision": "minute" + } + }, + "identifiers": [ + { + "identifier": "10506b4d-c30a-4220-8bec-97bff9568fd1" + } + ], + "problem": { + "code": { + "name": "Pneumonia", + "code": "233604007", + "code_system_name": "SNOMED CT" + }, + "date_time": { + "low": { + "date": "1998-03-10T00:00:00.000Z", + "precision": "day" + }, + "high": { + "date": "1998-03-16T00:00:00.000Z", + "precision": "day" + } + } + }, + "source_list_identifiers": [ + { + "identifier": "b5159d48-04aa-4927-b355-00d1dcb7158c" + } + ] + } + ], + "procedures": [ + { + "procedure": { + "name": "Colonic polypectomy", + "code": "274025005", + "code_system_name": "SNOMED CT" + }, + "identifiers": [ + { + "identifier": "d68b7e32-7810-4f5b-9cc2-acd54b0fd85d" + } + ], + "status": "Completed", + "date_time": { + "point": { + "date": "2011-02-15T00:00:00.000Z", + "precision": "day" + } + }, + "specimen": { + "identifiers": [ + { + "identifier": "c2ee9ee9-ae31-4628-a919-fec1cbb58683" + } + ], + "code": { + "name": "colonic polyp sample", + "code": "309226005", + "code_system_name": "SNOMED CT" + } + }, + "performers": [ + { + "identifiers": [ + { + "identifier": "c2ee9ee9-ae31-4628-a919-fec1cbb58687" + } + ], + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1234", + "type": "work place" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "c2ee9ee9-ae31-4628-a919-fec1cbb58686" + } + ], + "name": [ + "Good Health Clinic" + ], + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1234", + "type": "work place" + } + ] + } + ] + } + ], + "procedure_type": "procedure" + }, + { + "procedure": { + "name": "Colonic polypectomy", + "code": "274025005", + "code_system_name": "SNOMED CT" + }, + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19", + "extension": "123456789" + } + ], + "status": "Aborted", + "date_time": { + "point": { + "date": "2011-02-03T00:00:00.000Z", + "precision": "day" + } + }, + "body_sites": [ + { + "name": "Abdomen and pelvis", + "code": "416949008", + "code_system_name": "SNOMED CT" + } + ], + "priority": { + "name": "Callback results", + "code": "CR", + "code_system_name": "ActPriority" + }, + "performers": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5", + "extension": "1234" + } + ], + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1234", + "type": "work place" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ] + } + ], + "locations": [ + { + "name": "Good Health Clinic", + "location_type": { + "name": "Inpatient medical ward", + "code": "1060-3", + "code_system_name": "HealthcareServiceLocation" + }, + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US" + } + ] + } + ], + "procedure_type": "observation" + }, + { + "procedure": { + "name": "Colonic polypectomy", + "code": "274025005", + "code_system_name": "SNOMED CT" + }, + "identifiers": [ + { + "identifier": "1.2.3.4.5.6.7.8", + "extension": "1234567" + } + ], + "status": "Completed", + "date_time": { + "point": { + "date": "2011-02-03T00:00:00.000Z", + "precision": "day" + } + }, + "priority": { + "name": "Callback results", + "code": "CR", + "code_system_name": "ActPriority" + }, + "performers": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19", + "extension": "1234" + } + ], + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US" + } + ], + "phone": [ + { + "number": "+1(555)555-1234", + "type": "work place" + } + ], + "organization": [ + { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19.5" + } + ], + "name": [ + "Good Health Clinic" + ] + } + ] + } + ], + "locations": [ + { + "name": "Good Health Clinic", + "location_type": { + "name": "Inpatient medical ward", + "code": "1060-3", + "code_system_name": "HealthcareServiceLocation" + }, + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US" + } + ] + } + ], + "procedure_type": "act" + } + ], + "plan_of_care": [ + { + "plan": { + "name": "encounter for check-up (procedure)", + "code": "185349003", + "code_system_name": "SNOMED CT" + }, + "identifiers": [ + { + "identifier": "9a6d1bac-17d3-4195-89a4-1121bc809b4d" + } + ], + "date_time": { + "point": { + "date": "2013-06-15T00:00:00.000Z", + "precision": "day" + } + }, + "type": "encounter", + "status": { + "code": "active" + }, + "subType": "Intent" + }, + { + "plan": { + "name": "wound care (regime/therapy)", + "code": "225358003", + "code_system_name": "SNOMED CT" + }, + "identifiers": [ + { + "identifier": "9a6d1bac-17d3-4195-89a4-1121bc809a5c" + } + ], + "date_time": { + "point": { + "date": "2013-06-15T00:00:00.000Z", + "precision": "day" + } + }, + "type": "act", + "status": { + "code": "active" + }, + "subType": "Intent" + }, + { + "plan": { + "name": "Colonoscopy", + "code": "73761001", + "code_system_name": "SNOMED CT" + }, + "identifiers": [ + { + "identifier": "9a6d1bac-17d3-4195-89c4-1121bc809b5a" + } + ], + "date_time": { + "point": { + "date": "2013-06-13T00:00:00.000Z", + "precision": "day" + } + }, + "type": "procedure", + "status": { + "code": "active" + }, + "subType": "Request" + } + ], + "payers": [ + { + "identifiers": [ + { + "identifier": "1fe2cdd0-7aad-11db-9fe1-0800200c9a66" + } + ], + "policy": { + "identifiers": [ + { + "identifier": "3e676a50-7aac-11db-9fe1-0800200c9a66" + } + ], + "code": { + "code": "SELF", + "code_system_name": "HL7 RoleCode" + }, + "insurance": { + "code": { + "code": "PAYOR", + "code_system_name": "HL7 RoleCode" + }, + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19" + } + ], + "address": [ + { + "street_lines": [ + "123 Insurance Road" + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US", + "use": "work place" + } + ], + "phone": [ + { + "number": "+1(781)555-1515", + "type": "work place" + } + ], + "organization": [ + { + "name": [ + "Good Health Insurance" + ] + } + ], + "code": [ + { + "code": "PAYOR", + "code_system_name": "HL7 RoleCode" + } + ] + } + } + }, + "participant": { + "code": { + "name": "Self", + "code": "SELF", + "code_system_name": "HL7 Role" + }, + "performer": { + "identifiers": [ + { + "identifier": "14d4a520-7aae-11db-9fe1-0800200c9a66", + "extension": "1138345" + } + ], + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "use": "primary home" + } + ], + "code": [ + { + "name": "Self", + "code": "SELF", + "code_system_name": "HL7 Role" + } + ] + }, + "name": [ + { + "prefix": "Mr.", + "middle": [ + "A." + ], + "last": "Everyman", + "first": "Frank" + } + ] + }, + "policy_holder": { + "performer": { + "identifiers": [ + { + "identifier": "2.16.840.1.113883.19", + "extension": "1138345" + } + ], + "address": [ + { + "street_lines": [ + "17 Daws Rd." + ], + "city": "Blue Bell", + "state": "MA", + "zip": "02368", + "country": "US", + "use": "primary home" + } + ] + } + }, + "authorization": { + "identifiers": [ + { + "identifier": "f4dce790-8328-11db-9fe1-0800200c9a66" + } + ], + "procedure": { + "code": { + "name": "Colonoscopy", + "code": "73761001", + "code_system_name": "SNOMED CT" + } + } + } + } + ], + "reason_for_referral": { + "title": "REASON FOR REFERRAL", + "text": "Patient referral for consultation for full care. Referral Nurse: Nurse Florence,RN" + } + }, + "meta": { + "version": "1.10.8", + "identifiers": [ + { + "identifier": "04fc2b90-10e0-11e2-892e-0800200c9a66" + } + ], + "confidentiality": "Normal", + "set_id": { + "identifier": "2.16.840.1.113883.19.5.99999.19", + "extension": "sTT988" + }, + "sections": [ + "header", + "demographics", + "vitals", + "results", + "medications", + "encounters", + "allergies", + "immunizations", + "social_history", + "problems", + "procedures", + "plan_of_care", + "payers", + "reason_for_referral" + ] + }, + "errors": [ + "cardinality error: found 61 when expecting 0..1 at //h:author", + "cardinality error: found 2 when expecting 1..1 at h:patient/h:name", + "nullFlavor alert: missing but required precondition in medicationActivity -> medicationsSection -> CCD", + "nullFlavor alert: missing but required precondition in medicationActivity -> medicationsSection -> CCD", + "nullFlavor alert: missing but required identifier in Identifier -> assignedEntity -> activity -> encountersSection -> CCD", + "nullFlavor alert: missing but required date_time in finding -> activity -> encountersSection -> CCD", + "cardinality error: found 2 when expecting 0..1 at h:entryRelationship/h:observation", + "cardinality error: found 2 when expecting 1..1 at .//h:templateId[@root='2.16.840.1.113883.10.20.22.4.4']/..", + "nullFlavor alert: missing but required location_type in serviceDeliveryLocation -> procedureProcedure -> procedureUnion -> proceduresSection -> CCD", + "nullFlavor alert: missing but required street_lines in Address -> Organization -> assignedEntity -> insurance -> policy -> entry -> payers_section -> CCD", + "nullFlavor alert: missing but required city in Address -> Organization -> assignedEntity -> insurance -> policy -> entry -> payers_section -> CCD", + "cardinality error: found 2 when expecting 1..1 at h:performer", + "nullFlavor alert: missing but required guarantor in entry -> payers_section -> CCD", + "nullFlavor alert: missing but required code in participant -> entry -> payers_section -> CCD", + "cardinality error: found 2 when expecting 1..1 at h:entryRelationship/h:act/h:participant" + ] +} From bb1ff4aa5945c413a451a672e8a2d3faab78c417 Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Wed, 26 Oct 2022 14:35:42 -0700 Subject: [PATCH 18/36] ready for review --- lib/parser/ccda/ccd.js | 4 +- lib/parser/ccda/sections/review_of_systems.js | 37 +++++++++++++++++++ test/fixtures/parser-ccda/CCD_1.xml | 17 +++++++++ test/parser-ccda/test-parser-ccda.js | 1 + 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 lib/parser/ccda/sections/review_of_systems.js diff --git a/lib/parser/ccda/ccd.js b/lib/parser/ccda/ccd.js index b5906298..6d7247a7 100644 --- a/lib/parser/ccda/ccd.js +++ b/lib/parser/ccda/ccd.js @@ -21,6 +21,7 @@ var exportCCD = function (version) { var hospital_discharge_instructions_section = require("./sections/hospital_discharge_instructions").hospital_discharge_instructions_section(version)[0]; var hospital_discharge_medications_section = require("./sections/hospital_discharge_medications").hospital_discharge_medications_section(version)[0]; var functional_status_section = require("./sections/functional_status").functionalStatusSection(version)[0]; + var review_of_systems_section = require("./sections/review_of_systems").reviewOfSystemsSection(version)[0]; return component.define("CCD") .fields([ @@ -41,7 +42,8 @@ var exportCCD = function (version) { ["reason_for_referral", "0..1", reason_for_referral_section.xpath(), reason_for_referral_section], ["hospital_discharge_instructions", "0..1", hospital_discharge_instructions_section.xpath(), hospital_discharge_instructions_section], ["hospital_discharge_medications", "0..1", hospital_discharge_medications_section.xpath(), hospital_discharge_medications_section], - ["functional_statuses", "0..1", functional_status_section.xpath(), functional_status_section] + ["functional_statuses", "0..1", functional_status_section.xpath(), functional_status_section], + ["review_of_systems", "0..1", review_of_systems_section.xpath(), review_of_systems_section] ]); }; diff --git a/lib/parser/ccda/sections/review_of_systems.js b/lib/parser/ccda/sections/review_of_systems.js new file mode 100644 index 00000000..65db136d --- /dev/null +++ b/lib/parser/ccda/sections/review_of_systems.js @@ -0,0 +1,37 @@ +"use strict"; + +var shared = require("../shared"); +var component = require("@amida-tech/blue-button-xml").component.withNullFlavor(); +var cleanup = require("../cleanup"); +var bbm = require("@amida-tech/blue-button-meta"); +var processor = require("@amida-tech/blue-button-xml").processor; + + +var exportReviewOfSystemsSection= function (version) { + var sectionIDs = bbm.CCDA["sections" + version]; + var clinicalStatementsIDs = bbm.CCDA["statements" + version]; + + var reviewOfSystemsSection = component.define("reviewOfSystems"); + reviewOfSystemsSection.templateRoot([ + sectionIDs.ReviewOfSystemsSection + ]) + reviewOfSystemsSection.fields([ + ["code", "1..1", "h:code", shared.ConceptDescriptor], + ["title", "1..1", "h:title", processor.asString], + ["text", "1..1", "h:text", shared.asString], + ]) + + var exportReviewOfSystemsSection = component.define("socialHistorySection") + exportReviewOfSystemsSection.templateRoot([ + sectionIDs.ReviewOfSystemsSection + ]); + exportReviewOfSystemsSection.fields([ + ["entry", "0..*", exportReviewOfSystemsSection.xpath(), reviewOfSystemsSection] + ]) + + exportReviewOfSystemsSection.cleanupStep(cleanup.replaceWithField('entry')); + + return [exportReviewOfSystemsSection]; +} + +exports.reviewOfSystemsSection = exportReviewOfSystemsSection; \ No newline at end of file diff --git a/test/fixtures/parser-ccda/CCD_1.xml b/test/fixtures/parser-ccda/CCD_1.xml index a9b59261..8c5de5ab 100644 --- a/test/fixtures/parser-ccda/CCD_1.xml +++ b/test/fixtures/parser-ccda/CCD_1.xml @@ -833,6 +833,23 @@ + + +
+ + + REVIEW OF SYSTEMS + + + Patient denies recent history of fever or malaise. Positive + For weakness and shortness of breath. One episode of melena. No recent + headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
diff --git a/test/parser-ccda/test-parser-ccda.js b/test/parser-ccda/test-parser-ccda.js index 8b8c03b3..4b7b8ac1 100644 --- a/test/parser-ccda/test-parser-ccda.js +++ b/test/parser-ccda/test-parser-ccda.js @@ -10,6 +10,7 @@ describe('parser.js', function () { //convert string into JSON var result = bb.parse(xmlfile); + console.log(result.data.review_of_systems); expect(result).toBeDefined(); //console.log(JSON.stringify(result.data.header, null, 4)); From 43bd892c782396fbe2e85a9940f68b7dd2de1442 Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Wed, 26 Oct 2022 14:38:57 -0700 Subject: [PATCH 19/36] cleaning up --- lib/parser/ccda/sections/social_history.js | 26 ---------------------- test/parser-ccda/test-parser-ccda.js | 1 - 2 files changed, 27 deletions(-) diff --git a/lib/parser/ccda/sections/social_history.js b/lib/parser/ccda/sections/social_history.js index 923a8de4..7ebb36f1 100644 --- a/lib/parser/ccda/sections/social_history.js +++ b/lib/parser/ccda/sections/social_history.js @@ -6,32 +6,6 @@ var cleanup = require("../cleanup"); var bbm = require("@amida-tech/blue-button-meta"); var _ = require("lodash"); - -var stupidCleanup = function (flist) { // We need cleanup function to become objects - var r = function () { - flist.forEach(function (k) { - var tmp; - - if (this.js !== undefined && this.js !== null) { - // console.log( this.js[k]); - tmp = this.js[k]; - delete this.js[k]; - } - if (tmp) { //HACK: added this if - if (tmp.js) { - Object.keys(tmp.js).forEach(function (m) { - if (this.js[m] === undefined) { - this.js[m] = tmp.js[m]; - } - }, this); - } - } - }, this); - }; - return r; -}; - - var exportSocialHistorySection = function (version) { var sectionIDs = bbm.CCDA["sections" + version]; var clinicalStatementsIDs = bbm.CCDA["statements" + version]; diff --git a/test/parser-ccda/test-parser-ccda.js b/test/parser-ccda/test-parser-ccda.js index 4b7b8ac1..8b8c03b3 100644 --- a/test/parser-ccda/test-parser-ccda.js +++ b/test/parser-ccda/test-parser-ccda.js @@ -10,7 +10,6 @@ describe('parser.js', function () { //convert string into JSON var result = bb.parse(xmlfile); - console.log(result.data.review_of_systems); expect(result).toBeDefined(); //console.log(JSON.stringify(result.data.header, null, 4)); From 2c2e6e6e001b2752220065a2c714cc04ab6ec72a Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Wed, 26 Oct 2022 16:40:56 -0500 Subject: [PATCH 20/36] Nutrition clean up and some really simple tests --- lib/parser/ccda/ccd.js | 4 +- lib/parser/ccda/sections/nutrition.js | 140 +- lib/parser/router.js | 2 +- .../multiple-nutrition-observations.xml | 4959 +++++++++++++++++ .../one-nutrition-observation.xml | 4906 ++++++++++++++++ .../test-nutrition-observation.js | 23 + 6 files changed, 9908 insertions(+), 126 deletions(-) create mode 100644 test/parser-ccda/ccd-nutrition-observations/multiple-nutrition-observations.xml create mode 100644 test/parser-ccda/ccd-nutrition-observations/one-nutrition-observation.xml create mode 100644 test/parser-ccda/ccd-nutrition-observations/test-nutrition-observation.js diff --git a/lib/parser/ccda/ccd.js b/lib/parser/ccda/ccd.js index b5906298..80a7a415 100644 --- a/lib/parser/ccda/ccd.js +++ b/lib/parser/ccda/ccd.js @@ -21,6 +21,7 @@ var exportCCD = function (version) { var hospital_discharge_instructions_section = require("./sections/hospital_discharge_instructions").hospital_discharge_instructions_section(version)[0]; var hospital_discharge_medications_section = require("./sections/hospital_discharge_medications").hospital_discharge_medications_section(version)[0]; var functional_status_section = require("./sections/functional_status").functionalStatusSection(version)[0]; + var nutrition_section = require("./sections/nutrition").nutritionSection(version); return component.define("CCD") .fields([ @@ -41,7 +42,8 @@ var exportCCD = function (version) { ["reason_for_referral", "0..1", reason_for_referral_section.xpath(), reason_for_referral_section], ["hospital_discharge_instructions", "0..1", hospital_discharge_instructions_section.xpath(), hospital_discharge_instructions_section], ["hospital_discharge_medications", "0..1", hospital_discharge_medications_section.xpath(), hospital_discharge_medications_section], - ["functional_statuses", "0..1", functional_status_section.xpath(), functional_status_section] + ["functional_statuses", "0..1", functional_status_section.xpath(), functional_status_section], + ["nutrition_observations", "0..1", nutrition_section.xpath(), nutrition_section] ]); }; diff --git a/lib/parser/ccda/sections/nutrition.js b/lib/parser/ccda/sections/nutrition.js index 91c3738c..27be8cb4 100644 --- a/lib/parser/ccda/sections/nutrition.js +++ b/lib/parser/ccda/sections/nutrition.js @@ -1,145 +1,37 @@ -"use strict"; - var shared = require("../shared"); var component = require("@amida-tech/blue-button-xml").component.withNullFlavor(); var cleanup = require("../cleanup"); -// var processor = require("@amida-tech/blue-button-xml").processor; - -/* var bbm = require("@amida-tech/blue-button-meta"); -var _ = require("lodash"); */ - - - - - - - - - -// this needs work or the model needs or both - - -var exportNutritionSection = function (version) { +var exportNutritionSection = function () { var nutritionalStatusObservation; var nutritionSection; var nutritionAssessment; - var authorParticipation; - var representedOrganization; - var assignedAuthor; - var assignedPerson; - // if (version === "") {//default version -- version not used anywhere -- not using the if statement - // if (version === "") {//default version -- version not used anywhere -- not using the if statement - representedOrganization = component.define("representedOrganization") + nutritionAssessment = component.define("nutritionAssessment") + .templateRoot("2.16.840.1.113883.10.20.22.4.138") .fields([ - ["id", "0..*", "h:root", shared.Identifier], - ["name", "0..*", "h:name"], - ["telecom", "0..*", "h:telecom"], - ["addr", "0..*", "h:addr", shared.Address], + ["identifiers", "1..*", "h:id", shared.Identifier], + ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], + ["value", "1..1", "h:value[@xsi:type='CD']/@displayName"], ]); - assignedPerson = component.define("assignedPerson") - .fields([ - ["name", "0..*", "h.name"] - ]); - assignedAuthor = component.define("assignedAuthor") + + nutritionalStatusObservation = component.define("nutritionalStatusObservation") + .templateRoot("2.16.840.1.113883.10.20.22.4.124") .fields([ - ["id", "0..*", "h:root", shared.Identifier], - ["code", "0..1", "h:code"], - ["assignedPerson", "0..1", "h:assignedPerson", assignedPerson], - ["representedOrganization", "0..1", "h:representedOrganization", representedOrganization] + ["identifiers", "1..*", "h:id", shared.Identifier], + ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime], + ["value", "1..1", "h:value[@xsi:type='CD']/@displayName"], + ["assessments", "1..*", "h:entryRelationship/h:observation", nutritionAssessment], ]); - authorParticipation = component.define("authorParticipation") - .templateRoot("2.16.840.1.113883.10.20.22.4.119") - .fields([ - // ["identifiers", "1..*", "h:id", shared.Identifier], - ["templateId", "1..1", "h:templateId[@root='2.16.840.1.113883.10.20.22.4.119']"], - ["time", "1..1", "h:time", shared.EffectiveTime], - ["assignedAuthor", "1..1", "h:assignedAuthor", assignedAuthor], - ["name", "0..*", "h:name", [shared.assignedEntity, shared.IndividualName] ] - ]); - - nutritionAssessment = component.define("nutritionAssessment") - .templateRoot("2.16.840.1.113883.10.20.22.4.138") - .fields([ - // ["identifiers", "1..*", "h:id", shared.Identifier], - ["templateId", "1..1", "h:templateId[@root='2.16.840.1.113883.10.20.22.4.138']"], -/* ["moodCode", "1..1", "h:observation[@moodCode='EVN']"], - ["classCode", "1..1", "h:observation[@classCode='OBS']"], */ - ["code", "1..1", "h:code[@code='75303-8', @codeSystem='2.16.840.1.113883.6.1']"], - ["id", "1..*", "@root"], - // ["codeSystem", "1..1", "h:observation[]"], - ["statusCode", "1..1", "h:statusCode[ @code='completed']"], - ["effectiveTime", "1..1", "h:effectiveTime", shared.EffectiveTime], - ["entryRelationship", "1..1", "h:entryRelationship[@typeCode='SUBJ']"], - ["value", "1..1", "h:value"], - ["assignedAuthor", "1..1", "h:assignedAuthor", authorParticipation] - ]); - nutritionalStatusObservation = component.define("nutritionalStatusObservation") - .templateRoot("2.16.840.1.113883.10.20.22.4.124") - .fields([ - // ["identifiers", "1..*", "h:id", shared.Identifier], - ["templateId", "1..1", "h:templateId[@root='2.16.840.1.113883.10.20.22.4.124']"], - ["id", "1..*", "@root"], - // ["moodCode", "1..1", "h:observation[@moodCode='EVN']"], - // ["classCode", "1..1", "h:observation[@classCode='OBS']"], - // ["codeSystem", "1..1", "h:observation[@codeSystem='2.16.840.1.113883.6.1']"], - ["statusCode", "1..1", "h:statusCode[@code='completed']"], - ["entryRelationship", "1..1", "h:entryRelationship[@typeCode='SUBJ']", nutritionAssessment], - ["code", "1..1", "h:code[@code='75305-3',@codeSystem='2.16.840.1.113883.6.1']"], - ["effectiveTime", "1..1", "h:effectiveTime", shared.EffectiveTime], - ["value", "1..1", "h:value"], - // ["title", "1..1", "h:title"], - // ["nutritionAssessment", "1..1", "h:observation", nutritionAssessment] - ]); nutritionSection = component.define("nutritionSection") .templateRoot("2.16.840.1.113883.10.20.22.2.57") .fields([ - ["templateId", "1..1", "h:id[@root='2.16.840.1.113883.10.20.22.2.57']", shared.Identifier], - ["code", "1..1", "h:code[@code='61144-2', @codeSystem='2.16.840.1.113883.6.1']", shared.TextWithReference], - // , "1..1", "h:codeSystem", shared.ConceptDescriptor], - ["title", "1..1", "h:title"], - ["text", "1..1", "h:paragraph"], - ["entry", "1..1", "h:observation", nutritionalStatusObservation], - // ["observation", "1..1", "h:observation", nutritionalStatusObservation] + ["observations", "0..*", "h:entry/h:observation", nutritionalStatusObservation], ]); - // console.log(authorParticipation, nutritionalAssessment, nutritionalStatusObservation, nutritionSection) - nutritionSection.cleanupStep(cleanup.replaceWithField('nutrition')); + + nutritionSection.cleanupStep(cleanup.replaceWithField('observations')); return nutritionSection; }; exports.nutritionSection = exportNutritionSection; -exports.nutritionEntry = exportNutritionSection; - -/* -{ - TextWithReference: { - }, - NegationIndicator: { - }, - ConceptDescriptor: { - }, - AgeDescriptor: { - }, - SimplifiedCode: { - }, - PhysicalQuantity: { - }, - XsiTypedValue: { - }, - EventOffset: { - }, - EffectiveTime: { - }, - IndividualName: { - }, - Address: { - }, - Organization: { - }, - assignedEntity: { - }, - serviceDeliveryLocation: { - } -} */ \ No newline at end of file diff --git a/lib/parser/router.js b/lib/parser/router.js index 99b29416..13c5d767 100644 --- a/lib/parser/router.js +++ b/lib/parser/router.js @@ -39,7 +39,7 @@ var generateComponents = function (version) { ccda_header: require("./ccda/header").header, ccda_vitals: require("./ccda/sections/vitals").vitalSignsSection(version)[0], ccda_medications: require("./ccda/sections/medications").medicationsSection(version)[0], - ccda_nutrition: require("./ccda/sections/nutrition").nutritionSection(version)[0], + ccda_nutrition: require("./ccda/sections/nutrition").nutritionSection(version), ccda_problems: require("./ccda/sections/problems").problemsSection(version)[0], ccda_immunizations: require("./ccda/sections/immunizations").immunizationsSection(version)[0], ccda_results: require("./ccda/sections/results").resultsSection(version)[0], diff --git a/test/parser-ccda/ccd-nutrition-observations/multiple-nutrition-observations.xml b/test/parser-ccda/ccd-nutrition-observations/multiple-nutrition-observations.xml new file mode 100644 index 00000000..9d7bae31 --- /dev/null +++ b/test/parser-ccda/ccd-nutrition-observations/multiple-nutrition-observations.xml @@ -0,0 +1,4959 @@ + + + + + + + + + + + + + + Transfer Summary + + + + + + + + + + + + 2222 Home Street + Beaverton + OR + 97867 + US + + + + + + + + Eve + + Betterhalf + + + + Eve + + Everywoman + + + + + + + + + + + + + + + 2222 Home Street + Beaverton + OR + 97867 + US + + + + + Boris + Bo + Betterhalf + + + + + + + 4444 Home Street + Beaverton + OR + 97867 + US + + + + + + + + + + + + + + + The DoctorsTogether Physician Group + + + 1007 Health Drive + Portland + OR + 99123 + US + + + + + + + + + + + + + + 1007 Healthcare Drive + Portland + OR + 99123 + US + + + + + Ellen + Enter + + + + + + + + + + 1007 Healthcare Drive + Portland + OR + 99123 + US + + + + + Harold + Hippocrates + D.O. + + + + + + + + + + + Rose + Everyman + + + + + + + + + + Good Health HIE + + + 1009 Healthcare Drive + Portland + OR + 99123 + US + + + + + + + + + + Sara + Specialize + M.D. + + + + The DoctorsApart Physician Group + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Ann Arbor + MI + 97857 + US + + + + + Mrs. + Martha + Jones + + + + + + + + + + + + + Primary Care Provider + + + + + + 1004 Healthcare Drive + Portland + OR + 99123 + US + + + + + Patricia + Patty + Primary + M.D. + + + + + Good Health Hospital + + + 1004 Health Drive + Portland + OR + 99123 + US + + + + + + + + + + 1004 Healthcare Drive + Ann Arbor + MA + 99123 + US + + + + + Rory + Renal + Primary + M.D. + + + + + Good Health Hospital + + + 1036 Health Drive + >Ann Arbor + MA + 99123 + US + + + + + + + + + + + +
+ + + + ALLERGIES AND ADVERSE REACTIONS + + + + + + + + + + + + + + + + + + +
SubstanceReaction
+ Penicillin + + Nausea +
+ Codeine + + Wheezing +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Patricia Primary, Feb 19, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1004 Health Drive + Portland + OR + 99123 + US + + + + + Dr. + Patricia + Primary + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + ASSESSMENT + + + Flank pain. + Pain on deep palpation of lower back. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Check-up, Inpatient Medical WardAmanda Assigned, General PhysicianGood Health ClinicFebruary 12, 2013
+
+ + + + + + + Checkup Examination + + + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FUNCTIONAL STATUS + + + + + + + + + + + + + + + + + + + + + +
Functional CategoryEffective DatesResults of Evaluation
Functional AssessmentMarch 11, 2013Independent Walking
ADL/IADL: BathingMarch 11,2013Independent
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + GENERAL STATUS + + Alert and in good spirits, mild distress. + +
+
+ + +
+ + + + HISTORY OF PAST MEDICAL/SURGICAL ILLNESS + + In 2011, the patient experienced a minor stroke, which caused temporary paralysis on her left + side. She was monitored in hospital for three weeks and recovered. She has been taking warfarin since then + and is expected continue on with close monitoring. + She has had type II diabetes, poorly controlled for many years. Since the diagnosis, her kidney + functions are compromised and she is predisposed to developing peripheral neuropathy. + occlusion. + Two weeks prior to this current hospital admission, she was also diagnosed with + hypercholesterolemia. She is currently taking Lipitor to manage this. + +
+
+ + +
+ + + HISTORY OF PRESENT ILLNESS + + This is a 68-year-old white woman who went to the emergency room with sudden onset of severe + left flank and left lower quadrant abdominal pain associated with gross hematuria. The patient had a CT + stone profile which showed no evidence of renal calculi. She was referred for urologic + evaluation. + When seen in our office, the patient continued to have mild left flank pain and no difficultly + voiding. Urinalysis showed 1+ occult blood. Intravenous pyelogram was done which demonstrated a low-lying + malrotated right kidney. There was no evidence of renal or ureteral calculi or hydronephrosis. Urine + cytology was negative for malignant cells. The patient subsequently had a CT renal scan with contrast. + This showed what appeared to be an infarction of an area of the lower pole of the left kidney. It was + suggested that a renal MRI be done for further delineation of this problem. She had a right kidney which + was malrotated but was otherwise normal. The patient is admitted at this time for complete urologic + evaluation. + +
+
+ + +
+ + + Hospital Course of Care + + This is a 68-year-old white woman who went to the emergency room with sudden onset of severe + left flank and left lower quadrant abdominal pain associated with gross hematuria. The patient had a CT + stone profile which showed no evidence of renal calculi. + +
+
+ + +
+ + + + Hospital Discharge Diagnosis + .Kidney Malrotation. Discharged August 1, 2013 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatusSeries number
+ Influenza, seasonal, IM Nov 1999CompletedN/A
+ Influenza, seasonal, IM Dec 1998CompletedN/A
+ Pneumococcal polysaccharide vaccine, IM Dec 1998CompletedN/A
+ Tetanus and diphtheria toxoids, IM 1997RefusedN/A
Hepatitis BAug 1, 2012Completed3rd
+
+ + + + + + + + + + + + + + + + + + + Influenza, seasonal, IM + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + Possible flu-like symptoms for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + Possible flu-like symptoms for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + Medical Equipment + + Implanted Devices: Cardiac PaceMaker July 3, 2012 + Implanted Devices: Upper GI Prosthesis, January 3, 2013 + Cane, February 2, 2003 + + Biliary Stent, May 5, 2013 + + + + + + + + + Implants + + + + + + + + + + + + + + + + + + + + + + + + Cardiac Pacemaker + + + + + Good Health Durable Medical Equipment + + + + + + + + + + + + + + + + + + + + + + + Upper GI Prosthesis + + + + + Good Health Durable Medical Equipment + + + + + + + + + + + + + + + + + + + + + + + + + Upper GI Prosthesis + + + + + Good Health Durable Medical Equipment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1004 Health Care Drive + Ann Arbor + MI + 02368 + US + + + + + Community Health and Hospitals + + + 1003 Health Care Drive + Ann Arbor + MI + 02368 + US + + + + + + +
+
+ + +
+ + + + MENTAL STATUS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Mental Status FindingsEffective DatesCondition Status
Mental FunctionMarch 11, 2013Impaired
Mental FunctionMarch 11, 2013Agressive Behavior
Mental FunctionMarch 11, 2013Difficulty understanding own emotions
Mental FunctionMarch 11, 2013Difficulty communicating Thoughts
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + NUTRITION SECTION + + Nutritional Status: well nourished + Diet: Low sodium diet, excessive carbohydrate + + + + + + + + Nutritional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nutritional Status + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current MedicationDirectionsStart DateStatusIndicationsMonitored by
Proventil 0.09 MG/ACTUAT inhalant solution2 puffs q6 hours PRN wheezingJan 3, 2013ActiveAsthmaPenny Puffer, MD
Atenolol 25 MG Oral Tablet1 every 12 hours OrallyMar 18, 2013ActiveHypertension +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Puffer + Penny + DR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Insurance Providers + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + 123 Insurance Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Physical Examination + Key Findings: In addition to Assessment finding above. 1. Type II diabetes, uncontrolled. 2. Slow + healing Open wound on left knee. 3. Early signs of peripheral neuropathy. 4. Mild dysphagia. 5. Mild + footdrop. + + + +
+ + + + SKIN, PHYSICAL FINDING + + + Stage 3 Pressure Ulcer anterior aspect of knee
+ Measuring 1"W X 2"L + Wound Characteristic: Offensive wound odor + Three Stage 3 pressure ulcers. + Worst pressure ulcer with necrotic eschar. +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ + + + TREATMENT PLAN + + Hand-off Communication: + Nurse Florence, RN to Nancy Nightingale, RN +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Planned CareStart DatePatient Provider RatingProvider Provider RatingProviderPatient Support/Caregiver
Encounter for Check-upJune 15, 20131st, Normal Priority3rd, Normal PriorityDr. James Case +
Care Goal: Pulse Oximetry 95%June 15, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Treatment: Wound CareJune 15, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Nutrition Recommendation: EducationJune 13, 2013 + + + +
Procedure: ColonoscopyJune 15, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Medication: Heparin 0.25 ml pre-filled syringeJuly 12, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Supply: 0.25 ML Heparin sodium 10000 UNT/ML Prefilled SyringeJune 15, 2013 + + Dr. Henry Seven +
Immunization: Influenza virus vaccine, IMNovember 15, 20131st, Normal Priority3rd, Normal PriorityDr. Henry Seven +
+
+ + + + + + + + + + + + + + + 1006 Health Drive + Ann Arbor + MI + 97867 + US + + + + + Nancy + Nightingale + RN + + + + + + + + + + + + + + + + + + + + 1006 Health Drive + Ann Arbor + MI + 97867 + US + + + + + Dr. + James + Case + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Heparin 0.25 ml Pre-filled Syringe + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Influenza virus vaccine + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Possible flu-like symptoms for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + +
+
+ + +
+ + + + PROBLEMS + + Active Concerns + + Problem #1 + malignant neoplasm of liver (onset July 3, 2013)[authored July 3, 2013] + Prognosis: Presence of a life limiting condition(>50% possibility of death within 2 year + + + Problem #2 + Chest pain (onset Apr 14, 2007) [authored Apr 14, 2007] + Angina (onset Apr 17, 2007) [authored Apr 17, 2007] + + + + Resolved Concerns + + Problem #3 + Pneumonia - Left lower lobe (onset Mar 10, 1998; resolution Mar 16, 1998) [authored Mar 16, + 1998] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pognosis + + + Presence of a life limiting condition(>50% possibility of death within 2 + year + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Procedures + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Good Health Clinic + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Good Health Clinic + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Good Health Clinic + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Good Health Clinic + + + + + +
+
+ + +
+ + + REASON FOR REFERRAL + + Patient referral for consultation for full care. Referral Nurse: Nurse Florence,RN + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Result TypeResult ValueRelevant Reference RangeInterpretationDate
+ Hemoglobin + + 13.2 g/dL + + Normal range for women is 12.0 to 15.5 grams per deciliter + NormalMarch 11, 2013
+ Leukocytes + + 6.7 10*9/L + + Normal white blood cell count range 3.5-10.5 billion cells/L + NormalMarch 11, 2013
+ Platelets + + 123 10*9/L + + Normal white blood cell count range 3.5-10.5 billion cells/L + LowMarch 11, 2013
+ Hematocrit + + 35.3 % + + Normal hematocrit range for female: 34.9-44.5 percent + NormalMarch 11, 2013
+ Erythrocytes + + 4.21 10*12/L + + Normal red blood cell count range 3.90-5.03 trillion cells/L + NormalMarch 11, 2013
+ Urea nitrogen, Serum + PendingPendingPendingMarch 11, 2013
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6.7 billion per liter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + Patient denies recent history of fever or malaise. Positive For weakness and shortness of + breath. One episode of melena. No recent headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
Alcohol Use2 Drinks per WeekMarch 12, 2013
Smoking StatusFormer smokerMay 1, 2005 - Feb 27, 2009
Characteristics of Home EnvironmentUnsatisfactory Living ConditionsMarch 12, 2013
Cultural and Religious ObservationsDoes not accept blood transfusions, or donates, or stores blood for transfusion.March 12, 2013
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Does not accept blood transfusions, or donates, or stores blood for + transfusion. + + + + + + + + + + + + + + +
+
+ + +
+ + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: February 12, 2013August 1, 2013
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/88 + + 128/80 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/test/parser-ccda/ccd-nutrition-observations/one-nutrition-observation.xml b/test/parser-ccda/ccd-nutrition-observations/one-nutrition-observation.xml new file mode 100644 index 00000000..b40b32f7 --- /dev/null +++ b/test/parser-ccda/ccd-nutrition-observations/one-nutrition-observation.xml @@ -0,0 +1,4906 @@ + + + + + + + + + + + + + + Transfer Summary + + + + + + + + + + + + 2222 Home Street + Beaverton + OR + 97867 + US + + + + + + + + Eve + + Betterhalf + + + + Eve + + Everywoman + + + + + + + + + + + + + + + 2222 Home Street + Beaverton + OR + 97867 + US + + + + + Boris + Bo + Betterhalf + + + + + + + 4444 Home Street + Beaverton + OR + 97867 + US + + + + + + + + + + + + + + + The DoctorsTogether Physician Group + + + 1007 Health Drive + Portland + OR + 99123 + US + + + + + + + + + + + + + + 1007 Healthcare Drive + Portland + OR + 99123 + US + + + + + Ellen + Enter + + + + + + + + + + 1007 Healthcare Drive + Portland + OR + 99123 + US + + + + + Harold + Hippocrates + D.O. + + + + + + + + + + + Rose + Everyman + + + + + + + + + + Good Health HIE + + + 1009 Healthcare Drive + Portland + OR + 99123 + US + + + + + + + + + + Sara + Specialize + M.D. + + + + The DoctorsApart Physician Group + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Ann Arbor + MI + 97857 + US + + + + + Mrs. + Martha + Jones + + + + + + + + + + + + + Primary Care Provider + + + + + + 1004 Healthcare Drive + Portland + OR + 99123 + US + + + + + Patricia + Patty + Primary + M.D. + + + + + Good Health Hospital + + + 1004 Health Drive + Portland + OR + 99123 + US + + + + + + + + + + 1004 Healthcare Drive + Ann Arbor + MA + 99123 + US + + + + + Rory + Renal + Primary + M.D. + + + + + Good Health Hospital + + + 1036 Health Drive + >Ann Arbor + MA + 99123 + US + + + + + + + + + + + +
+ + + + ALLERGIES AND ADVERSE REACTIONS + + + + + + + + + + + + + + + + + + +
SubstanceReaction
+ Penicillin + + Nausea +
+ Codeine + + Wheezing +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Patricia Primary, Feb 19, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1004 Health Drive + Portland + OR + 99123 + US + + + + + Dr. + Patricia + Primary + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + ASSESSMENT + + + Flank pain. + Pain on deep palpation of lower back. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Check-up, Inpatient Medical WardAmanda Assigned, General PhysicianGood Health ClinicFebruary 12, 2013
+
+ + + + + + + Checkup Examination + + + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FUNCTIONAL STATUS + + + + + + + + + + + + + + + + + + + + + +
Functional CategoryEffective DatesResults of Evaluation
Functional AssessmentMarch 11, 2013Independent Walking
ADL/IADL: BathingMarch 11,2013Independent
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + GENERAL STATUS + + Alert and in good spirits, mild distress. + +
+
+ + +
+ + + + HISTORY OF PAST MEDICAL/SURGICAL ILLNESS + + In 2011, the patient experienced a minor stroke, which caused temporary paralysis on her left + side. She was monitored in hospital for three weeks and recovered. She has been taking warfarin since then + and is expected continue on with close monitoring. + She has had type II diabetes, poorly controlled for many years. Since the diagnosis, her kidney + functions are compromised and she is predisposed to developing peripheral neuropathy. + occlusion. + Two weeks prior to this current hospital admission, she was also diagnosed with + hypercholesterolemia. She is currently taking Lipitor to manage this. + +
+
+ + +
+ + + HISTORY OF PRESENT ILLNESS + + This is a 68-year-old white woman who went to the emergency room with sudden onset of severe + left flank and left lower quadrant abdominal pain associated with gross hematuria. The patient had a CT + stone profile which showed no evidence of renal calculi. She was referred for urologic + evaluation. + When seen in our office, the patient continued to have mild left flank pain and no difficultly + voiding. Urinalysis showed 1+ occult blood. Intravenous pyelogram was done which demonstrated a low-lying + malrotated right kidney. There was no evidence of renal or ureteral calculi or hydronephrosis. Urine + cytology was negative for malignant cells. The patient subsequently had a CT renal scan with contrast. + This showed what appeared to be an infarction of an area of the lower pole of the left kidney. It was + suggested that a renal MRI be done for further delineation of this problem. She had a right kidney which + was malrotated but was otherwise normal. The patient is admitted at this time for complete urologic + evaluation. + +
+
+ + +
+ + + Hospital Course of Care + + This is a 68-year-old white woman who went to the emergency room with sudden onset of severe + left flank and left lower quadrant abdominal pain associated with gross hematuria. The patient had a CT + stone profile which showed no evidence of renal calculi. + +
+
+ + +
+ + + + Hospital Discharge Diagnosis + .Kidney Malrotation. Discharged August 1, 2013 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatusSeries number
+ Influenza, seasonal, IM Nov 1999CompletedN/A
+ Influenza, seasonal, IM Dec 1998CompletedN/A
+ Pneumococcal polysaccharide vaccine, IM Dec 1998CompletedN/A
+ Tetanus and diphtheria toxoids, IM 1997RefusedN/A
Hepatitis BAug 1, 2012Completed3rd
+
+ + + + + + + + + + + + + + + + + + + Influenza, seasonal, IM + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + Possible flu-like symptoms for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + Possible flu-like symptoms for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 102 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + Medical Equipment + + Implanted Devices: Cardiac PaceMaker July 3, 2012 + Implanted Devices: Upper GI Prosthesis, January 3, 2013 + Cane, February 2, 2003 + + Biliary Stent, May 5, 2013 + + + + + + + + + Implants + + + + + + + + + + + + + + + + + + + + + + + + Cardiac Pacemaker + + + + + Good Health Durable Medical Equipment + + + + + + + + + + + + + + + + + + + + + + + Upper GI Prosthesis + + + + + Good Health Durable Medical Equipment + + + + + + + + + + + + + + + + + + + + + + + + + Upper GI Prosthesis + + + + + Good Health Durable Medical Equipment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1004 Health Care Drive + Ann Arbor + MI + 02368 + US + + + + + Community Health and Hospitals + + + 1003 Health Care Drive + Ann Arbor + MI + 02368 + US + + + + + + +
+
+ + +
+ + + + MENTAL STATUS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Mental Status FindingsEffective DatesCondition Status
Mental FunctionMarch 11, 2013Impaired
Mental FunctionMarch 11, 2013Agressive Behavior
Mental FunctionMarch 11, 2013Difficulty understanding own emotions
Mental FunctionMarch 11, 2013Difficulty communicating Thoughts
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + NUTRITION SECTION + + Nutritional Status: well nourished + Diet: Low sodium diet, excessive carbohydrate + + + + + + + + Nutritional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current MedicationDirectionsStart DateStatusIndicationsMonitored by
Proventil 0.09 MG/ACTUAT inhalant solution2 puffs q6 hours PRN wheezingJan 3, 2013ActiveAsthmaPenny Puffer, MD
Atenolol 25 MG Oral Tablet1 every 12 hours OrallyMar 18, 2013ActiveHypertension +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Puffer + Penny + DR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Insurance Providers + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + 123 Insurance Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Physical Examination + Key Findings: In addition to Assessment finding above. 1. Type II diabetes, uncontrolled. 2. Slow + healing Open wound on left knee. 3. Early signs of peripheral neuropathy. 4. Mild dysphagia. 5. Mild + footdrop. + + + +
+ + + + SKIN, PHYSICAL FINDING + + + Stage 3 Pressure Ulcer anterior aspect of knee
+ Measuring 1"W X 2"L + Wound Characteristic: Offensive wound odor + Three Stage 3 pressure ulcers. + Worst pressure ulcer with necrotic eschar. +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ + + + TREATMENT PLAN + + Hand-off Communication: + Nurse Florence, RN to Nancy Nightingale, RN +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Planned CareStart DatePatient Provider RatingProvider Provider RatingProviderPatient Support/Caregiver
Encounter for Check-upJune 15, 20131st, Normal Priority3rd, Normal PriorityDr. James Case +
Care Goal: Pulse Oximetry 95%June 15, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Treatment: Wound CareJune 15, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Nutrition Recommendation: EducationJune 13, 2013 + + + +
Procedure: ColonoscopyJune 15, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Medication: Heparin 0.25 ml pre-filled syringeJuly 12, 20131st, Normal Priority3rd, Normal Priority + Caregiver: Mother
Supply: 0.25 ML Heparin sodium 10000 UNT/ML Prefilled SyringeJune 15, 2013 + + Dr. Henry Seven +
Immunization: Influenza virus vaccine, IMNovember 15, 20131st, Normal Priority3rd, Normal PriorityDr. Henry Seven +
+
+ + + + + + + + + + + + + + + 1006 Health Drive + Ann Arbor + MI + 97867 + US + + + + + Nancy + Nightingale + RN + + + + + + + + + + + + + + + + + + + + 1006 Health Drive + Ann Arbor + MI + 97867 + US + + + + + Dr. + James + Case + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Heparin 0.25 ml Pre-filled Syringe + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Influenza virus vaccine + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Possible flu-like symptoms for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + +
+
+ + +
+ + + + PROBLEMS + + Active Concerns + + Problem #1 + malignant neoplasm of liver (onset July 3, 2013)[authored July 3, 2013] + Prognosis: Presence of a life limiting condition(>50% possibility of death within 2 year + + + Problem #2 + Chest pain (onset Apr 14, 2007) [authored Apr 14, 2007] + Angina (onset Apr 17, 2007) [authored Apr 17, 2007] + + + + Resolved Concerns + + Problem #3 + Pneumonia - Left lower lobe (onset Mar 10, 1998; resolution Mar 16, 1998) [authored Mar 16, + 1998] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pognosis + + + Presence of a life limiting condition(>50% possibility of death within 2 + year + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Procedures + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Good Health Clinic + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Good Health Clinic + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Good Health Clinic + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Good Health Clinic + + + + + +
+
+ + +
+ + + REASON FOR REFERRAL + + Patient referral for consultation for full care. Referral Nurse: Nurse Florence,RN + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Result TypeResult ValueRelevant Reference RangeInterpretationDate
+ Hemoglobin + + 13.2 g/dL + + Normal range for women is 12.0 to 15.5 grams per deciliter + NormalMarch 11, 2013
+ Leukocytes + + 6.7 10*9/L + + Normal white blood cell count range 3.5-10.5 billion cells/L + NormalMarch 11, 2013
+ Platelets + + 123 10*9/L + + Normal white blood cell count range 3.5-10.5 billion cells/L + LowMarch 11, 2013
+ Hematocrit + + 35.3 % + + Normal hematocrit range for female: 34.9-44.5 percent + NormalMarch 11, 2013
+ Erythrocytes + + 4.21 10*12/L + + Normal red blood cell count range 3.90-5.03 trillion cells/L + NormalMarch 11, 2013
+ Urea nitrogen, Serum + PendingPendingPendingMarch 11, 2013
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6.7 billion per liter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + Patient denies recent history of fever or malaise. Positive For weakness and shortness of + breath. One episode of melena. No recent headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
Alcohol Use2 Drinks per WeekMarch 12, 2013
Smoking StatusFormer smokerMay 1, 2005 - Feb 27, 2009
Characteristics of Home EnvironmentUnsatisfactory Living ConditionsMarch 12, 2013
Cultural and Religious ObservationsDoes not accept blood transfusions, or donates, or stores blood for transfusion.March 12, 2013
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Does not accept blood transfusions, or donates, or stores blood for + transfusion. + + + + + + + + + + + + + + +
+
+ + +
+ + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: February 12, 2013August 1, 2013
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/88 + + 128/80 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/test/parser-ccda/ccd-nutrition-observations/test-nutrition-observation.js b/test/parser-ccda/ccd-nutrition-observations/test-nutrition-observation.js new file mode 100644 index 00000000..a166fbf4 --- /dev/null +++ b/test/parser-ccda/ccd-nutrition-observations/test-nutrition-observation.js @@ -0,0 +1,23 @@ +var fs = require('fs'); + +var bb = require('../../../index.js'); + +describe('nutrition', function () { + it('one observation', function () { + var xmlfile = fs.readFileSync(__dirname + '/one-nutrition-observation.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.nutrition_observations.length).toBe(1); + + var observation = result.data.nutrition_observations[0]; + expect(observation.date_time).toEqual({"point": {"date": "2013-05-12T00:00:00.000Z", "precision": "day"}}); + expect(observation.value).toEqual("well nourished"); + }); + + it('multiple observations', function () { + var xmlfile = fs.readFileSync(__dirname + '/multiple-nutrition-observations.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.nutrition_observations.length).toBe(2); + }); +}); From edb7f5451a5d5bcdb6bfd07a37f1f9965276c2cb Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Wed, 26 Oct 2022 16:48:00 -0500 Subject: [PATCH 21/36] Revert "IMI Comments" This reverts commit c8f7c1c89bcd7a96c8ea174b98a918f06e11c853. --- lib/parser/ccda/sections/medications.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index a93a0dce..558b3d66 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -144,7 +144,7 @@ var exportMedicationsSection = function (version) { ["performer", "0..1", "h:performer", MedicationPerformer], ["supply", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply", medicationSupplyOrder], ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation], - ["immunization", "0..1", "h:product/h:manufacturedMaterial", immunizationMedicationInformation] + ["information", "0..1", "h:product/h:manufacturedMaterial", medicationImmunization] ]); medicationActivity = component.define("medicationActivity") @@ -159,11 +159,6 @@ var exportMedicationsSection = function (version) { ["performer", "0..1", "h:performer", MedicationPerformer], ["drug_vehicle", "0..1", "h:participant[@typeCode='CSM']/h:participantRole/h:playingEntity[@classCode='MMAT']/h:code", shared.ConceptDescriptor], ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition], - /* array, explained: - [0] => name of array elements (appear to match the model objects); - [1] => cardinality (zero or one, exactly 1, or many); - [2] => ns:xml tag[@attributes]; - [3] => processor, built-in or user-defined*/ ["indication", "0..1", "h:entryRelationship[@typeCode='RSON']/h:observation", MedicationIndication], //["instructions", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply/*/*/h:templateId[@root='2.16.840.1.113883.10.20.22.4.20']", MedicationInstructions], ["dispense", "0..1", MedicationDispense.xpath(), MedicationDispense] From 7260e3b1160c0a3e9536ea6dd77ba8ab81349885 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Wed, 26 Oct 2022 16:48:28 -0500 Subject: [PATCH 22/36] Revert "medication addition test" This reverts commit 63bbd097d5dc912fadbb3d481060fb7e6fa88851. --- lib/parser/ccda/sections/medications.js | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index 558b3d66..3032ad21 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -86,12 +86,11 @@ var exportMedicationsSection = function (version) { // *************************************************************************** var medicationInformation; - var immunizationMedicationInformation; var medicationSupplyOrder; var medicationActivity; var medicationsSection; - if (version === "") {//default version + if (version === "") { medicationInformation = component.define("medicationInformation") .templateRoot("2.16.840.1.113883.10.20.22.4.23") .fields([ @@ -101,15 +100,6 @@ var exportMedicationsSection = function (version) { ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"] ]); - immunizationMedicationInformation = component.define("immunizationMedicationInformation") - .templateRoot("2.16.840.1.113883.10.20.22.4.54") - .fields([ - ["identifiers", "0..*", "h:id", shared.Identifier], - // ["product", "1..1", "h:manufacturedMaterial/h:code", shared.ConceptDescriptor], - ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"], - ["material", "1..1", "h:manufacturedMaterial/h:name/text()"] - ]); - medicationSupplyOrder = component.define("medicationSupplyOrder") .fields([ ["identifiers", "0..*", "h:assignedEntity/h:id", shared.Identifier], @@ -143,8 +133,7 @@ var exportMedicationsSection = function (version) { ["identifiers", "0..*", "h:id", shared.Identifier], ["performer", "0..1", "h:performer", MedicationPerformer], ["supply", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply", medicationSupplyOrder], - ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation], - ["information", "0..1", "h:product/h:manufacturedMaterial", medicationImmunization] + ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation] ]); medicationActivity = component.define("medicationActivity") @@ -224,15 +213,6 @@ var exportMedicationsSection = function (version) { ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], ]); - immunizationMedicationInformation = component.define("immunizationMedicationInformation") - .templateRoot("2.16.840.1.113883.10.20.1.54") - .fields([ - ["identifiers", "0..*", "h:id", shared.Identifier], - ["products", "0..1", "h:code", shared.ConceptDescriptor], - ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"], - ["material", "1..1", "h:manufacturedMaterial/h:name/text()"] - ]); - medicationSupplyOrder = component.define("medicationSupplyOrder") .templateRoot("2.16.840.1.113883.10.20.1.34") .fields([ From cbabe4851b539d2907e20851142450a7a2cc0afc Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Wed, 26 Oct 2022 17:18:38 -0500 Subject: [PATCH 23/36] Change Review of Systems from array to object and add a few basic tests --- lib/parser/ccda/ccd.js | 3 +- lib/parser/ccda/sections/review_of_systems.js | 12 +- .../test-review-of-systems.js | 18 + .../ccd-review-of-systems/with.xml | 3319 +++++++++++++++++ .../ccd-review-of-systems/without.xml | 3302 ++++++++++++++++ 5 files changed, 6642 insertions(+), 12 deletions(-) create mode 100644 test/parser-ccda/ccd-review-of-systems/test-review-of-systems.js create mode 100644 test/parser-ccda/ccd-review-of-systems/with.xml create mode 100644 test/parser-ccda/ccd-review-of-systems/without.xml diff --git a/lib/parser/ccda/ccd.js b/lib/parser/ccda/ccd.js index 63e29a24..1cd1e7a8 100644 --- a/lib/parser/ccda/ccd.js +++ b/lib/parser/ccda/ccd.js @@ -44,7 +44,8 @@ var exportCCD = function (version) { ["hospital_discharge_instructions", "0..1", hospital_discharge_instructions_section.xpath(), hospital_discharge_instructions_section], ["hospital_discharge_medications", "0..1", hospital_discharge_medications_section.xpath(), hospital_discharge_medications_section], ["functional_statuses", "0..1", functional_status_section.xpath(), functional_status_section], - ["nutrition_observations", "0..1", nutrition_section.xpath(), nutrition_section] + ["nutrition_observations", "0..1", nutrition_section.xpath(), nutrition_section], + ["review_of_systems", "0..1", review_of_systems_section.xpath(), review_of_systems_section] ]); }; diff --git a/lib/parser/ccda/sections/review_of_systems.js b/lib/parser/ccda/sections/review_of_systems.js index 65db136d..62022a82 100644 --- a/lib/parser/ccda/sections/review_of_systems.js +++ b/lib/parser/ccda/sections/review_of_systems.js @@ -21,17 +21,7 @@ var exportReviewOfSystemsSection= function (version) { ["text", "1..1", "h:text", shared.asString], ]) - var exportReviewOfSystemsSection = component.define("socialHistorySection") - exportReviewOfSystemsSection.templateRoot([ - sectionIDs.ReviewOfSystemsSection - ]); - exportReviewOfSystemsSection.fields([ - ["entry", "0..*", exportReviewOfSystemsSection.xpath(), reviewOfSystemsSection] - ]) - - exportReviewOfSystemsSection.cleanupStep(cleanup.replaceWithField('entry')); - - return [exportReviewOfSystemsSection]; + return [reviewOfSystemsSection]; } exports.reviewOfSystemsSection = exportReviewOfSystemsSection; \ No newline at end of file diff --git a/test/parser-ccda/ccd-review-of-systems/test-review-of-systems.js b/test/parser-ccda/ccd-review-of-systems/test-review-of-systems.js new file mode 100644 index 00000000..04833b9f --- /dev/null +++ b/test/parser-ccda/ccd-review-of-systems/test-review-of-systems.js @@ -0,0 +1,18 @@ +var fs = require('fs'); +var bb = require('../../../index.js'); + +describe('review of systems', function () { + it('without', function () { + var xmlfile = fs.readFileSync(__dirname + '/without.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.review_of_systems).not.toBeDefined(); + }); + + it('with', function () { + var xmlfile = fs.readFileSync(__dirname + '/with.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.review_of_systems).toBeDefined(); + }); +}); diff --git a/test/parser-ccda/ccd-review-of-systems/with.xml b/test/parser-ccda/ccd-review-of-systems/with.xml new file mode 100644 index 00000000..8c5de5ab --- /dev/null +++ b/test/parser-ccda/ccd-review-of-systems/with.xml @@ -0,0 +1,3319 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + + Patient denies recent history of fever or malaise. Positive + For weakness and shortness of breath. One episode of melena. No recent + headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/test/parser-ccda/ccd-review-of-systems/without.xml b/test/parser-ccda/ccd-review-of-systems/without.xml new file mode 100644 index 00000000..a9b59261 --- /dev/null +++ b/test/parser-ccda/ccd-review-of-systems/without.xml @@ -0,0 +1,3302 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
From 7ce6bd3994fe8856a675690381d69d332b6a32f7 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Thu, 27 Oct 2022 09:23:00 -0500 Subject: [PATCH 24/36] Parse indictions inside a Plan of Treatment section, if any --- lib/parser/ccda/ccd.js | 4 +- lib/parser/ccda/sections/plan_of_treatment.js | 23 + .../multiple-indications.xml | 1854 +++++++++++++++++ .../ccd-plan-of-treatment/no-indications.xml | 1799 ++++++++++++++++ .../no-plan-of-treatment.xml | 1781 ++++++++++++++++ .../ccd-plan-of-treatment/one-indication.xml | 1834 ++++++++++++++++ .../ccd-plan-of-treatment/test-indications.js | 34 + .../test-plan-of-treatment.js | 12 + 8 files changed, 7340 insertions(+), 1 deletion(-) create mode 100644 lib/parser/ccda/sections/plan_of_treatment.js create mode 100644 test/parser-ccda/ccd-plan-of-treatment/multiple-indications.xml create mode 100644 test/parser-ccda/ccd-plan-of-treatment/no-indications.xml create mode 100644 test/parser-ccda/ccd-plan-of-treatment/no-plan-of-treatment.xml create mode 100644 test/parser-ccda/ccd-plan-of-treatment/one-indication.xml create mode 100644 test/parser-ccda/ccd-plan-of-treatment/test-indications.js create mode 100644 test/parser-ccda/ccd-plan-of-treatment/test-plan-of-treatment.js diff --git a/lib/parser/ccda/ccd.js b/lib/parser/ccda/ccd.js index 1cd1e7a8..dd8923aa 100644 --- a/lib/parser/ccda/ccd.js +++ b/lib/parser/ccda/ccd.js @@ -23,6 +23,7 @@ var exportCCD = function (version) { var functional_status_section = require("./sections/functional_status").functionalStatusSection(version)[0]; var review_of_systems_section = require("./sections/review_of_systems").reviewOfSystemsSection(version)[0]; var nutrition_section = require("./sections/nutrition").nutritionSection(version); + var plan_of_treatment_section = require("./sections/plan_of_treatment").planOfTreatmentSection(version); return component.define("CCD") .fields([ @@ -45,7 +46,8 @@ var exportCCD = function (version) { ["hospital_discharge_medications", "0..1", hospital_discharge_medications_section.xpath(), hospital_discharge_medications_section], ["functional_statuses", "0..1", functional_status_section.xpath(), functional_status_section], ["nutrition_observations", "0..1", nutrition_section.xpath(), nutrition_section], - ["review_of_systems", "0..1", review_of_systems_section.xpath(), review_of_systems_section] + ["review_of_systems", "0..1", review_of_systems_section.xpath(), review_of_systems_section], + ["plan_of_treatment", "0..1", plan_of_treatment_section.xpath(), plan_of_treatment_section] ]); }; diff --git a/lib/parser/ccda/sections/plan_of_treatment.js b/lib/parser/ccda/sections/plan_of_treatment.js new file mode 100644 index 00000000..6a30fc5d --- /dev/null +++ b/lib/parser/ccda/sections/plan_of_treatment.js @@ -0,0 +1,23 @@ +var shared = require("../shared"); +var component = require("@amida-tech/blue-button-xml").component.withNullFlavor(); + +var exportPlanOfTreatmentSection = function() { + var planOfTreatmentIndication = component.define("planOfTreatmentIndication") + planOfTreatmentIndication.templateRoot(["2.16.840.1.113883.10.20.22.4.19"]) + planOfTreatmentIndication.fields([ + ["identifiers", "0..*", "h:id", shared.Identifier], + ["code", "0..1", "h:code", shared.ConceptDescriptor], + ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], + ["value", "0..1", "h:value", shared.ConceptDescriptor] + ]); + + var planOfTreatmentSection = component.define("planOfTreatmentSection"); + planOfTreatmentSection.templateRoot(["2.16.840.1.113883.10.20.22.2.10"]); + planOfTreatmentSection.fields([ + ["indications", "0..*", planOfTreatmentIndication.xpath(), planOfTreatmentIndication] + ]) + + return planOfTreatmentSection; +}; + +exports.planOfTreatmentSection = exportPlanOfTreatmentSection; diff --git a/test/parser-ccda/ccd-plan-of-treatment/multiple-indications.xml b/test/parser-ccda/ccd-plan-of-treatment/multiple-indications.xml new file mode 100644 index 00000000..325dee08 --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/multiple-indications.xml @@ -0,0 +1,1854 @@ + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + +
+ + + + TREATMENT PLAN + The plan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + 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-plan-of-treatment/no-indications.xml b/test/parser-ccda/ccd-plan-of-treatment/no-indications.xml new file mode 100644 index 00000000..4f6134dd --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/no-indications.xml @@ -0,0 +1,1799 @@ + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + +
+ + + + TREATMENT PLAN + The plan + + + + + + + +
+
+ + + +
+ + + 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-plan-of-treatment/no-plan-of-treatment.xml b/test/parser-ccda/ccd-plan-of-treatment/no-plan-of-treatment.xml new file mode 100644 index 00000000..3fe5c921 --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/no-plan-of-treatment.xml @@ -0,0 +1,1781 @@ + + + + + + + + + + + + + + + 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-plan-of-treatment/one-indication.xml b/test/parser-ccda/ccd-plan-of-treatment/one-indication.xml new file mode 100644 index 00000000..f0a57ab8 --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/one-indication.xml @@ -0,0 +1,1834 @@ + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + +
+ + + + TREATMENT PLAN + The plan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + 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-plan-of-treatment/test-indications.js b/test/parser-ccda/ccd-plan-of-treatment/test-indications.js new file mode 100644 index 00000000..4740e70a --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/test-indications.js @@ -0,0 +1,34 @@ +var fs = require('fs'); + +var bb = require('../../../index.js'); + +describe('plan of treatment', function () { + describe('indications', function () { + it('no indications', function () { + var xmlfile = fs.readFileSync(__dirname + '/no-indications.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.plan_of_treatment).not.toBeDefined(); + }); + + it('one indication', function () { + var xmlfile = fs.readFileSync(__dirname + '/one-indication.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.plan_of_treatment.indications.length).toBe(1); + + var indication = result.data.plan_of_treatment.indications[0]; + expect(indication.identifiers[0]).toEqual({"identifier": "db734647-fc99-424c-a864-7e3cda82e703"}); + expect(indication.code).toEqual({"code": "ASSERTION", "code_system_name": "ActCode"}); + expect(indication.date_time).toEqual({"low": {"date": "2010-05-01T00:00:00.000Z", "precision": "day"}}); + expect(indication.value).toEqual({"code": "32398004", "code_system_name": "SNOMED CT", "name": "Bronchitis"}); + }); + + it('multiple indications', function () { + var xmlfile = fs.readFileSync(__dirname + '/multiple-indications.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.plan_of_treatment.indications.length).toBe(2); + }); + }); +}); diff --git a/test/parser-ccda/ccd-plan-of-treatment/test-plan-of-treatment.js b/test/parser-ccda/ccd-plan-of-treatment/test-plan-of-treatment.js new file mode 100644 index 00000000..2cd60363 --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/test-plan-of-treatment.js @@ -0,0 +1,12 @@ +var fs = require('fs'); + +var bb = require('../../../index.js'); + +describe('plan of treatment', function () { + it('does not exist', function () { + var xmlfile = fs.readFileSync(__dirname + '/no-plan-of-treatment.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.plan_of_treatment).not.toBeDefined(); + }); +}); From 5c58965076477f4b7d9234402e4790060b5acf39 Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Thu, 27 Oct 2022 11:50:51 -0700 Subject: [PATCH 25/36] adding author --- lib/parser/ccda/sections/results.js | 15 +- test/fixtures/parser-ccda/CCD_1.xml | 19 + test/parser-ccda/ccd-author/exsisting.xml | 3329 +++++++++++++++++++ test/parser-ccda/ccd-author/test-author.js | 26 + test/parser-ccda/ccd-author/with.xml | 3338 ++++++++++++++++++++ test/parser-ccda/ccd-author/without.xml | 3302 +++++++++++++++++++ 6 files changed, 10028 insertions(+), 1 deletion(-) create mode 100644 test/parser-ccda/ccd-author/exsisting.xml create mode 100644 test/parser-ccda/ccd-author/test-author.js create mode 100644 test/parser-ccda/ccd-author/with.xml create mode 100644 test/parser-ccda/ccd-author/without.xml diff --git a/lib/parser/ccda/sections/results.js b/lib/parser/ccda/sections/results.js index 5af2efad..4ea0eed8 100644 --- a/lib/parser/ccda/sections/results.js +++ b/lib/parser/ccda/sections/results.js @@ -9,6 +9,18 @@ var exportResultsSection = function (version) { var clinicalStatementsIDs = bbm.CCDA["statements" + version]; var sectionIDs = bbm.CCDA["sections" + version]; + var author = component.define("author") + .fields([ + ["date_time", "0..1", "h:time", shared.EffectiveTime], + ["identifiers", "0..*", "h:assignedAuthor/h:id", shared.Identifier], + ["name", "0..1", + "h:assignedAuthor/h:assignedPerson/h:name", shared.IndividualName + ], + ["organization", "0..1", + "h:assignedAuthor/h:representedOrganization", shared.Organization + ] + ]); + var referenceRangeValue = component.define('referenceRangeValue') .fields([ ["standard_value", "0..1", ".", shared.ConceptDescriptor], @@ -53,7 +65,8 @@ var exportResultsSection = function (version) { .fields([ ["identifiers", "0..*", "h:id", shared.Identifier], ["result_set", "0..1", "h:code", shared.ConceptDescriptor], - ["results", "1..*", ResultObservation.xpath(), ResultObservation] + ["results", "1..*", ResultObservation.xpath(), ResultObservation], + ["author", "0..1", "h:author", author] ]); //ResultsOrganizer.cleanupStep(cleanup.extractAllFields(['panelName'])); diff --git a/test/fixtures/parser-ccda/CCD_1.xml b/test/fixtures/parser-ccda/CCD_1.xml index 8c5de5ab..6b74565b 100644 --- a/test/fixtures/parser-ccda/CCD_1.xml +++ b/test/fixtures/parser-ccda/CCD_1.xml @@ -2918,6 +2918,25 @@ + + + diff --git a/test/parser-ccda/ccd-author/exsisting.xml b/test/parser-ccda/ccd-author/exsisting.xml new file mode 100644 index 00000000..65dcd1f8 --- /dev/null +++ b/test/parser-ccda/ccd-author/exsisting.xml @@ -0,0 +1,3329 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + + Patient denies recent history of fever or malaise. Positive + For weakness and shortness of breath. One episode of melena. No recent + headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/test/parser-ccda/ccd-author/test-author.js b/test/parser-ccda/ccd-author/test-author.js new file mode 100644 index 00000000..c995feee --- /dev/null +++ b/test/parser-ccda/ccd-author/test-author.js @@ -0,0 +1,26 @@ +var fs = require('fs'); +var bb = require('../../../index.js'); + +describe('review of systems', function () { + it('without', function () { + var xmlfile = fs.readFileSync(__dirname + '/without.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + + expect(result.data.results[0].author).not.toBeDefined(); + }); + + it('with', function () { + var xmlfile = fs.readFileSync(__dirname + '/with.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.results[0].author).toBeDefined(); + }); + + it('exsisting', function () { + var xmlfile = fs.readFileSync(__dirname + '/exsisting.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.results[0].author).toBeDefined(); + }); +}); diff --git a/test/parser-ccda/ccd-author/with.xml b/test/parser-ccda/ccd-author/with.xml new file mode 100644 index 00000000..6b74565b --- /dev/null +++ b/test/parser-ccda/ccd-author/with.xml @@ -0,0 +1,3338 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + + Patient denies recent history of fever or malaise. Positive + For weakness and shortness of breath. One episode of melena. No recent + headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/test/parser-ccda/ccd-author/without.xml b/test/parser-ccda/ccd-author/without.xml new file mode 100644 index 00000000..a9b59261 --- /dev/null +++ b/test/parser-ccda/ccd-author/without.xml @@ -0,0 +1,3302 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
From 103a09868e90d5d50c73c48c5cedf890691bfa2d Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Thu, 27 Oct 2022 17:20:59 -0400 Subject: [PATCH 26/36] Reword --- test/parser-ccda/ccd-author/test-author.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parser-ccda/ccd-author/test-author.js b/test/parser-ccda/ccd-author/test-author.js index c995feee..aa62559c 100644 --- a/test/parser-ccda/ccd-author/test-author.js +++ b/test/parser-ccda/ccd-author/test-author.js @@ -1,7 +1,7 @@ var fs = require('fs'); var bb = require('../../../index.js'); -describe('review of systems', function () { +describe('results', function () { it('without', function () { var xmlfile = fs.readFileSync(__dirname + '/without.xml', 'utf-8').toString(); var result = bb.parse(xmlfile); From 2afbf585353ed1f35e56f6ff630aa12d65830edb Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Thu, 27 Oct 2022 14:46:24 -0700 Subject: [PATCH 27/36] cleanup --- test/parser-ccda/ccd-author/test-author.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/parser-ccda/ccd-author/test-author.js b/test/parser-ccda/ccd-author/test-author.js index c995feee..2a6351ab 100644 --- a/test/parser-ccda/ccd-author/test-author.js +++ b/test/parser-ccda/ccd-author/test-author.js @@ -13,7 +13,6 @@ describe('review of systems', function () { it('with', function () { var xmlfile = fs.readFileSync(__dirname + '/with.xml', 'utf-8').toString(); var result = bb.parse(xmlfile); - expect(result.data.results[0].author).toBeDefined(); }); From d516a6cfe0b2dc8de254b63d28ab0c691fa9cd57 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Thu, 27 Oct 2022 16:17:40 -0500 Subject: [PATCH 28/36] Add plan of treatment / nutrition rec --- lib/parser/ccda/sections/plan_of_treatment.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/parser/ccda/sections/plan_of_treatment.js b/lib/parser/ccda/sections/plan_of_treatment.js index 6a30fc5d..8c496025 100644 --- a/lib/parser/ccda/sections/plan_of_treatment.js +++ b/lib/parser/ccda/sections/plan_of_treatment.js @@ -2,6 +2,13 @@ var shared = require("../shared"); var component = require("@amida-tech/blue-button-xml").component.withNullFlavor(); var exportPlanOfTreatmentSection = function() { + var planOfTreatmentNutritionRecommendation = component.define('planOfTreatmentNutritionRecommendation'); + planOfTreatmentNutritionRecommendation.templateRoot(["2.16.840.1.113883.10.20.22.4.130"]); + planOfTreatmentNutritionRecommendation.fields([ + ["code", "1..1", "h:code", shared.ConceptDescriptor], + ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime] + ]); + var planOfTreatmentIndication = component.define("planOfTreatmentIndication") planOfTreatmentIndication.templateRoot(["2.16.840.1.113883.10.20.22.4.19"]) planOfTreatmentIndication.fields([ @@ -14,7 +21,8 @@ var exportPlanOfTreatmentSection = function() { var planOfTreatmentSection = component.define("planOfTreatmentSection"); planOfTreatmentSection.templateRoot(["2.16.840.1.113883.10.20.22.2.10"]); planOfTreatmentSection.fields([ - ["indications", "0..*", planOfTreatmentIndication.xpath(), planOfTreatmentIndication] + ["indications", "0..*", planOfTreatmentIndication.xpath(), planOfTreatmentIndication], + ["nutrition_recommendations", "0..*", planOfTreatmentNutritionRecommendation.xpath(), planOfTreatmentNutritionRecommendation] ]) return planOfTreatmentSection; From 397fa1b7a9c4250beea9c248d5ef1c376a32d778 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Thu, 27 Oct 2022 17:35:11 -0500 Subject: [PATCH 29/36] Adding plan of treatment / nutrition recommendation --- lib/parser/ccda/sections/plan_of_treatment.js | 1 + .../multiple-nutrition-recommendations.xml | 1818 +++++++++++++++++ .../no-nutrition-recommendations.xml | 1792 ++++++++++++++++ .../one-nutrition-recommendation.xml | 1805 ++++++++++++++++ .../test-nutrition-recommendations.js | 36 + 5 files changed, 5452 insertions(+) create mode 100644 test/parser-ccda/ccd-plan-of-treatment/multiple-nutrition-recommendations.xml create mode 100644 test/parser-ccda/ccd-plan-of-treatment/no-nutrition-recommendations.xml create mode 100644 test/parser-ccda/ccd-plan-of-treatment/one-nutrition-recommendation.xml create mode 100644 test/parser-ccda/ccd-plan-of-treatment/test-nutrition-recommendations.js diff --git a/lib/parser/ccda/sections/plan_of_treatment.js b/lib/parser/ccda/sections/plan_of_treatment.js index 8c496025..15dd0eb5 100644 --- a/lib/parser/ccda/sections/plan_of_treatment.js +++ b/lib/parser/ccda/sections/plan_of_treatment.js @@ -5,6 +5,7 @@ var exportPlanOfTreatmentSection = function() { var planOfTreatmentNutritionRecommendation = component.define('planOfTreatmentNutritionRecommendation'); planOfTreatmentNutritionRecommendation.templateRoot(["2.16.840.1.113883.10.20.22.4.130"]); planOfTreatmentNutritionRecommendation.fields([ + ["identifiers", "0..*", "h:id", shared.Identifier], ["code", "1..1", "h:code", shared.ConceptDescriptor], ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime] ]); diff --git a/test/parser-ccda/ccd-plan-of-treatment/multiple-nutrition-recommendations.xml b/test/parser-ccda/ccd-plan-of-treatment/multiple-nutrition-recommendations.xml new file mode 100644 index 00000000..ea6ee677 --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/multiple-nutrition-recommendations.xml @@ -0,0 +1,1818 @@ + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + +
+ + + + TREATMENT PLAN + The plan + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + 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-plan-of-treatment/no-nutrition-recommendations.xml b/test/parser-ccda/ccd-plan-of-treatment/no-nutrition-recommendations.xml new file mode 100644 index 00000000..f96a8944 --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/no-nutrition-recommendations.xml @@ -0,0 +1,1792 @@ + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + +
+ + + + TREATMENT PLAN + The plan +
+
+ + + +
+ + + 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-plan-of-treatment/one-nutrition-recommendation.xml b/test/parser-ccda/ccd-plan-of-treatment/one-nutrition-recommendation.xml new file mode 100644 index 00000000..8b93306b --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/one-nutrition-recommendation.xml @@ -0,0 +1,1805 @@ + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + +
+ + + + TREATMENT PLAN + The plan + + + + + + + + + + +
+
+ + + +
+ + + 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-plan-of-treatment/test-nutrition-recommendations.js b/test/parser-ccda/ccd-plan-of-treatment/test-nutrition-recommendations.js new file mode 100644 index 00000000..690d1522 --- /dev/null +++ b/test/parser-ccda/ccd-plan-of-treatment/test-nutrition-recommendations.js @@ -0,0 +1,36 @@ +var fs = require('fs'); + +var bb = require('../../../index.js'); + +describe('plan of treatment', function () { + describe('nutrition recommendations', function () { + it('no recommendations', function () { + var xmlfile = fs.readFileSync(__dirname + '/no-nutrition-recommendations.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.plan_of_treatment).not.toBeDefined(); + }); + + it('one recommendation', function () { + var xmlfile = fs.readFileSync(__dirname + '/one-nutrition-recommendation.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.plan_of_treatment.nutrition_recommendations.length).toBe(1); + + console.log(result.data.plan_of_treatment); + + var recommendation = result.data.plan_of_treatment.nutrition_recommendations[0]; + expect(recommendation.identifiers[0]).toEqual({"identifier": "db734647-fc99-424c-a864-7e3cda82e703"}); + expect(recommendation.code).toEqual({"code": "ASSERTION", "code_system_name": "ActCode"}); + expect(recommendation.date_time).toEqual({"low": {"date": "2010-05-01T00:00:00.000Z", "precision": "day"}}); + expect(recommendation.value).toEqual({"code": "32398004", "code_system_name": "SNOMED CT", "name": "Bronchitis"}); + }); + + it('multiple recommendations', function () { + var xmlfile = fs.readFileSync(__dirname + '/multiple-nutrition-recommendations.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.plan_of_treatment.nutrition_recommendations.length).toBe(2); + }); + }); +}); From 04b5294d7505adcf9bcefcd908c8264a87fe5ae1 Mon Sep 17 00:00:00 2001 From: Paul Salaets Date: Thu, 27 Oct 2022 18:05:45 -0500 Subject: [PATCH 30/36] Update basic test for nutrition rec --- .../test-nutrition-recommendations.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/parser-ccda/ccd-plan-of-treatment/test-nutrition-recommendations.js b/test/parser-ccda/ccd-plan-of-treatment/test-nutrition-recommendations.js index 690d1522..d95cfad7 100644 --- a/test/parser-ccda/ccd-plan-of-treatment/test-nutrition-recommendations.js +++ b/test/parser-ccda/ccd-plan-of-treatment/test-nutrition-recommendations.js @@ -17,13 +17,18 @@ describe('plan of treatment', function () { expect(result.data.plan_of_treatment.nutrition_recommendations.length).toBe(1); - console.log(result.data.plan_of_treatment); - var recommendation = result.data.plan_of_treatment.nutrition_recommendations[0]; - expect(recommendation.identifiers[0]).toEqual({"identifier": "db734647-fc99-424c-a864-7e3cda82e703"}); - expect(recommendation.code).toEqual({"code": "ASSERTION", "code_system_name": "ActCode"}); - expect(recommendation.date_time).toEqual({"low": {"date": "2010-05-01T00:00:00.000Z", "precision": "day"}}); - expect(recommendation.value).toEqual({"code": "32398004", "code_system_name": "SNOMED CT", "name": "Bronchitis"}); + expect(recommendation.identifiers[0]).toEqual({"identifier": "9a6d1bac-17d3-4195-89a4-1121bc809a5c"}); + expect(recommendation.code).toEqual({ + "code": "61310001", + "code_system_name": "SNOMED CT", + "name": "nutrition education" + }); + expect(recommendation.date_time).toEqual({ + "point": { + "date": "2013-05-12T00:00:00.000Z", "precision": "day" + } + }); }); it('multiple recommendations', function () { From a9d3fdd96be284aa6624608072ecb20a0eb973f7 Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Fri, 28 Oct 2022 14:45:52 -0700 Subject: [PATCH 31/36] initial reaction observation --- lib/parser/ccda/sections/medications.js | 18 ++++++++++++++++ test/fixtures/parser-ccda/CCD_1.xml | 28 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index 3032ad21..3dbd35fe 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -30,6 +30,23 @@ var exportMedicationsSection = function (version) { source: http://wiki.siframework.org/CDA+-+Medications+Section */ + + var MedicationSeverityObservation = component.define("immunizationSeverityObservation") + .fields([ + ["code", "0..1", "h:value", shared.ConceptDescriptor], + ["interpretation", "0..1", "h:interpretationCode", shared.ConceptDescriptor] + ]); + var MedicationReaction = component.define("medicationReaction") + .templateRoot(["2.16.840.1.113883.10.20.22.4.9"]) + .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", MedicationSeverityObservation] + ]) + .cleanupStep(cleanup.promoteFreeTextIfNoReaction); + var MedicationInterval = component.define("MedicationInterval") .fields([ ["phase", "0..1", "./h:phase", shared.EffectiveTime], @@ -144,6 +161,7 @@ var exportMedicationsSection = function (version) { ["sig", "0..1", "h:text", shared.TextWithReference], ["product", "1..1", "h:consumable/h:manufacturedProduct", medicationInformation], ["supply", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply", medicationSupplyOrder], + ["reactions", "0..*", "h:entryRelationship[@typeCode='CAUS']/h:observation", MedicationReaction], ["administration", "0..1", "../h:substanceAdministration", MedicationAdministration], ["performer", "0..1", "h:performer", MedicationPerformer], ["drug_vehicle", "0..1", "h:participant[@typeCode='CSM']/h:participantRole/h:playingEntity[@classCode='MMAT']/h:code", shared.ConceptDescriptor], diff --git a/test/fixtures/parser-ccda/CCD_1.xml b/test/fixtures/parser-ccda/CCD_1.xml index 6b74565b..28526a62 100644 --- a/test/fixtures/parser-ccda/CCD_1.xml +++ b/test/fixtures/parser-ccda/CCD_1.xml @@ -1994,6 +1994,34 @@ codeSystem="2.16.840.1.113883.6.96"/>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + From 15a367fec07aba07141f6ea9fffbcc7d89bfa51a Mon Sep 17 00:00:00 2001 From: Cameron Leslie Date: Fri, 28 Oct 2022 15:01:35 -0700 Subject: [PATCH 32/36] Adding tests. --- .../ccd-medication-reactions/many.xml | 3391 +++++++++++++++++ .../test-reactions.js | 23 + .../ccd-medication-reactions/with.xml | 3366 ++++++++++++++++ .../ccd-medication-reactions/without.xml | 3338 ++++++++++++++++ 4 files changed, 10118 insertions(+) create mode 100644 test/parser-ccda/ccd-medication-reactions/many.xml create mode 100644 test/parser-ccda/ccd-medication-reactions/test-reactions.js create mode 100644 test/parser-ccda/ccd-medication-reactions/with.xml create mode 100644 test/parser-ccda/ccd-medication-reactions/without.xml diff --git a/test/parser-ccda/ccd-medication-reactions/many.xml b/test/parser-ccda/ccd-medication-reactions/many.xml new file mode 100644 index 00000000..6067c73b --- /dev/null +++ b/test/parser-ccda/ccd-medication-reactions/many.xml @@ -0,0 +1,3391 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + + Patient denies recent history of fever or malaise. Positive + For weakness and shortness of breath. One episode of melena. No recent + headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/test/parser-ccda/ccd-medication-reactions/test-reactions.js b/test/parser-ccda/ccd-medication-reactions/test-reactions.js new file mode 100644 index 00000000..abae63c7 --- /dev/null +++ b/test/parser-ccda/ccd-medication-reactions/test-reactions.js @@ -0,0 +1,23 @@ +var fs = require('fs'); +var bb = require('../../../index.js'); + +describe('Medication Reactions', function () { + it('without', function () { + var xmlfile = fs.readFileSync(__dirname + '/without.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + expect(result.data.medications[0].reactions).not.toBeDefined(); + }); + + it('with', function () { + var xmlfile = fs.readFileSync(__dirname + '/with.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + + expect(result.data.medications[0].reactions).toBeDefined(); + }); + + it('many', function () { + var xmlfile = fs.readFileSync(__dirname + '/many.xml', 'utf-8').toString(); + var result = bb.parse(xmlfile); + expect(result.data.medications[0].reactions.length).toBe(2); + }); +}); diff --git a/test/parser-ccda/ccd-medication-reactions/with.xml b/test/parser-ccda/ccd-medication-reactions/with.xml new file mode 100644 index 00000000..28526a62 --- /dev/null +++ b/test/parser-ccda/ccd-medication-reactions/with.xml @@ -0,0 +1,3366 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + + Patient denies recent history of fever or malaise. Positive + For weakness and shortness of breath. One episode of melena. No recent + headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/test/parser-ccda/ccd-medication-reactions/without.xml b/test/parser-ccda/ccd-medication-reactions/without.xml new file mode 100644 index 00000000..6b74565b --- /dev/null +++ b/test/parser-ccda/ccd-medication-reactions/without.xml @@ -0,0 +1,3338 @@ + + + + + + + + + + + + + + + Community Health and Hospitals: Health Summary + + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + + + Isabella + Isa + + Jones + + + + + + + + + + + + + 1357 Amber Drive + Beaverton + OR + 97867 + US + + + + + + Ralph + Jones + + + + + + + Beaverton + OR + 97867 + 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 + + + + + + + + + + + + + + + + + Primary Care Provider + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Dr. + Henry + Seven + + + + + Community Health and Hospitals + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + + + + + + + +
+ + + + + + ADVANCE DIRECTIVES + + + + + + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation status + Do not resuscitate + Dr. Robert Dolin, Feb 13, 2011 + Advance directive +
+
+ + + + + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + US + + + + + Dr. + Dolin + Robert + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + ALLERGIES, ADVERSE REACTIONS, ALERTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceOverall SeverityReactionReaction SeverityStatus
ALLERGENIC EXTRACT, PENICILLIN + Moderate to Severe + + Nausea + + Mild + Inactive
Codeine + Mild + + Wheezing + + Moderate + Active
Aspirin + Mild + + Hives + + Mild to moderate + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + REVIEW OF SYSTEMS + + + Patient denies recent history of fever or malaise. Positive + For weakness and shortness of breath. One episode of melena. No recent + headaches. Positive for osteoarthritis in hips, knees and hands. + + +
+
+ + +
+ + + + ASSESSMENT + + + Recurrent GI bleed of unknown etiology; hypotension perhaps + secondary to this but as likely secondary to polypharmacy. + Acute on chronic anemia secondary to #1. + Azotemia, acute renal failure with volume loss secondary to + #1. + Hyperkalemia secondary to #3 and on ACE and K+ supplement. + Other chronic diagnoses as noted above, currently stable. + + +
+
+ + +
+ + + + + + ENCOUNTERS + + + + + + + + + + + + + + + + + + +
EncounterPerformerLocationDate
+ Checkup Examination Performer NameCommunity Urgent Care Center20090227130000+0500
+
+ + + + + + + Checkup Examination + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Urgent Care Center + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + FAMILY HISTORY + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functional or Cognitive FindingObservationObservation DateCondition Status
Ambulation(Dependent to + Independent)Independently ableMarch 11, 2009Active
Finding of Functional Performance and + ActivityDyspneaFebruary 2007Active
Cognitive Function FindingMemory impairmentApril 2007Active
Cognitive Function Finding(Non-Aggressive + to Aggressive)Aggressive behaviorMarch 11, 2009Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text description of the + calculation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Non Aggressive to Aggressive + + + + + + +
+
+ + +
+ + + + + + IMMUNIZATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza, seasonal, IM Nov 1999Completed
+ Influenza, seasonal, IM Dec 1998Completed
+ Pneumococcal polysaccharide vaccine, + IM Dec 1998Completed
+ Tetanus and diphtheria toxoids, IM 1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + Possible flu-like symptoms + for three days. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Health LS - Immuno Inc. + + + + + + + + 1021 Health Drive + Ann Arbor + MI + 99099 + US + + + + + Amanda + Assigned + + + + + Good Health Clinic + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INTERVENTIONS PROVIDED + + + Therapeutic exercise intervention: knee extension, 3 sets, 10 + repetitions, 10-lb weight. + Therapeutic exercise intervention: arm curl, 3 sets, 10 + repetitions, 15-lb weight + + +
+
+ + +
+ + + + MEDICAL EQUIPMENT + + + + + + + + + + + + + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + + + +
+ + + + + + + + + + + + + Good Health Durable Medical Equipment + + + + + +
+
+ + +
+ + + + + + MEDICATIONS + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
+ Proventil HFA + + 0.09 MG/ACTUAT inhalant solution, 2 puffs QID PRN + wheezing20070103ActivePneumonia (233604007 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + Proventil HFA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + Community Health and Hospitals + + + + + + + + + + + + + Aerosol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + label in spanish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Medication Factory Inc. + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + INSURANCE PROVIDERS + + + + + + + + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typePolicy IDCovered party IDPolicy Holder
Good Health InsuranceExtended healthcare / FamilyContract Number1138345Patient's Mother
+
+ + + + + + + + + + + + + + + + + + + + + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + Good Health Insurance + + + + 123 Insurance + Road + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Frank + A. + Everyman + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + PLAN OF CARE + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
Colonoscopy20120512
+
+ + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + +
+
+ + +
+ + + + + + PROBLEMS + + + + + Pneumonia + Status: Resolved + + + Asthma + Status: Active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + PROCEDURES + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1001 Village Avenue + Portland + OR + 99123 + US + + + + + Community Health and Hospitals + + + 1001 Village + Avenue + Portland + OR + 99123 + US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + + + + + + + + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Community Health and Hospitals + + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + Community Gastroenterology Clinic + + + + + +
+
+ + +
+ + + + + + RESULTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LABORATORY INFORMATION
Chemistries and drug levels
+ HGB (M 13-18 g/dl; F 12-16 + g/dl) + 13.2
+ WBC (4.3-10.8 10+3/ul) + 6.7
+ PLT (135-145 meq/l) + 123 (L)
Liver Functions and Other Laboratory Values
ALT (SGPT)31.0
AST (SGOT)18.0
GGT28.0 Alk
Phos86.0
Total Bili0.1
Albumin3.2
Blood Count
White Count7.7
Platelets187.0
Hematocrit23.7
Hemoglobin8.1
ELECTROCARDIOGRAM (EKG) INFORMATION
EKGSinus rhythm without acute changes
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + SOCIAL HISTORY + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking 1 pack per day20050501 to 20090227130000+0500
+ smoking None20090227130000+0500 - today
+ Alcohol consumption None20050501 -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 pack per day + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + + + + VITAL SIGNS + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
From e6297c0ea3500f4fb6fbbbb56f7296a72c6d2370 Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Fri, 4 Nov 2022 11:35:27 -0700 Subject: [PATCH 33/36] partial --- lib/parser/ccda/sections/medications.js | 123 +++++++++++++++--------- 1 file changed, 78 insertions(+), 45 deletions(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index 3dbd35fe..382281eb 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -102,19 +102,37 @@ var exportMedicationsSection = function (version) { // * ccda-r1.1 (LATEST VERSION) * // *************************************************************************** + var immunizationMedicationInformation; var medicationInformation; var medicationSupplyOrder; var medicationActivity; var medicationsSection; + var manufacturedMaterial; if (version === "") { + + manufacturedMaterial = component.define("manufacturedMaterial") + .fields([ + ["code", "1..1", "h:manufacturedMaterial/h:code "], + ["translation", "0..*", "h:manufacturedMaterial/h:translation"], + ["lotNumberText", "0..*", "h:manufacturedMaterial/h:lotNumberText"], + ["manufacturerOrganization", "0..1", "h:manufacturerOrganization"], + ]); + + immunizationMedicationInformation = component.define("immunizationMedicationInformation") + .templateRoot("2.16.840.1.113883.10.20.22.4.54") + .fields([ + ["id", "0..*", "h:id"], + ["manufacturedMaterial", "1..1", "h:manufacturedMaterial", manufacturedMaterial], + ]); medicationInformation = component.define("medicationInformation") .templateRoot("2.16.840.1.113883.10.20.22.4.23") .fields([ ["identifiers", "0..*", "h:id", shared.Identifier], ["unencoded_name", "0..1", "h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], ["product", "1..1", "h:manufacturedMaterial/h:code", shared.ConceptDescriptor], - ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"] + ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"], + ["manufacturedMaterial", "1..1", "h:manufacturedMaterial", immunizationMedicationInformation] ]); medicationSupplyOrder = component.define("medicationSupplyOrder") @@ -168,7 +186,8 @@ var exportMedicationsSection = function (version) { ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition], ["indication", "0..1", "h:entryRelationship[@typeCode='RSON']/h:observation", MedicationIndication], //["instructions", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply/*/*/h:templateId[@root='2.16.840.1.113883.10.20.22.4.20']", MedicationInstructions], - ["dispense", "0..1", MedicationDispense.xpath(), MedicationDispense] + ["dispense", "0..1", MedicationDispense.xpath(), MedicationDispense], + ["manufacturedMaterial", "1..1", "h:manufacturedMaterial", manufacturedMaterial] ]) //.cleanupStep(Cleanup.extractAllFields(["medicationName"])) .cleanupStep(function () { @@ -223,55 +242,69 @@ var exportMedicationsSection = function (version) { // * ccda-r1.0 (OLD VERSION) * // *************************************************************************** } else { - - medicationInformation = component.define("medicationInformation") - .templateRoot("2.16.840.1.113883.10.20.1.53") + manufacturedMaterial = component.define("manufacturedMaterial") .fields([ - ["unencoded_name", "0..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], - ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], + ["code", "1..1", "h:manufacturedMaterial/h:code "], + ["translation", "0..*", "h:manufacturedMaterial/h:translation"], + ["lotNumberText", "0..*", "h:manufacturedMaterial/h:lotNumberText"], + ["manufacturerOrganization", "0..1", "h:manufacturerOrganization"], ]); - medicationSupplyOrder = component.define("medicationSupplyOrder") - .templateRoot("2.16.840.1.113883.10.20.1.34") + immunizationMedicationInformation = component.define("immunizationMedicationInformation") + .templateRoot("2.16.840.1.113883.10.20.22.4.54") .fields([ - ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], - ["repeatNumber", "0..1", "h:repeatNumber/@value"], - ["quantity", "0..1", "h:quantity/@value"], - ["author", "0..1", "h:author", author] + ["id", "0..*", "h:id"], + ["manufacturedMaterial", "1..1", "h:manufacturedMaterial", manufacturedMaterial], ]); + medicationInformation = component.define("medicationInformation") + .templateRoot("2.16.840.1.113883.10.20.1.53") + .fields([ + ["unencoded_name", "0..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], + ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", immunizationMedicationInformation], + // ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], + ]); + + medicationSupplyOrder = component.define("medicationSupplyOrder") + .templateRoot("2.16.840.1.113883.10.20.1.34") + .fields([ + ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], + ["repeatNumber", "0..1", "h:repeatNumber/@value"], + ["quantity", "0..1", "h:quantity/@value"], + ["author", "0..1", "h:author", author] + ]); + + medicationActivity = component.define("Medications") + .templateRoot(["2.16.840.1.113883.10.20.1.34", "2.16.840.1.113883.10.20.1.24"]) + .fields([ + ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], + ["identifiers", "0..*", "h:id", shared.Identifier], + ["status", "1..1", "h:statusCode/@code"], + ["sig", "0..1", "h:text", shared.TextWithReference], + ["product", "1..1", "(h:product | h:consumable)", medicationInformation], + ["supply", "0..1", "../h:supply", medicationSupplyOrder], + ["administration", "0..1", "../h:substanceAdministration", MedicationAdministration], + ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition] + ]) + .cleanupStep(function () { + + //Cleanup Status. + + if (_.get(this, "js.status") === "EVN") { + this.js.status = "Completed"; + } + if (_.get(this, "js.status") === "INT") { + this.js.status = "Prescribed"; + } + }); - medicationActivity = component.define("Medications") - .templateRoot(["2.16.840.1.113883.10.20.1.34", "2.16.840.1.113883.10.20.1.24"]) - .fields([ - ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], - ["identifiers", "0..*", "h:id", shared.Identifier], - ["status", "1..1", "h:statusCode/@code"], - ["sig", "0..1", "h:text", shared.TextWithReference], - ["product", "1..1", "(h:product | h:consumable)", medicationInformation], - ["supply", "0..1", "../h:supply", medicationSupplyOrder], - ["administration", "0..1", "../h:substanceAdministration", MedicationAdministration], - ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition] - ]) - .cleanupStep(function () { - - //Cleanup Status. - - if (_.get(this, "js.status") === "EVN") { - this.js.status = "Completed"; - } - if (_.get(this, "js.status") === "INT") { - this.js.status = "Prescribed"; - } - }); - - medicationsSection = component.define("medicationsSection"); - medicationsSection.templateRoot("2.16.840.1.113883.10.20.1.8"); - medicationsSection.fields([ - ["Medications", "0..*", medicationActivity.xpath(), medicationActivity] - ]); - medicationsSection.cleanupStep(cleanup.replaceWithField('medications')); - return [medicationsSection, medicationActivity]; - } + medicationsSection = component.define("medicationsSection"); + medicationsSection.templateRoot("2.16.840.1.113883.10.20.1.8"); + medicationsSection.fields([ + ["Medications", "0..*", medicationActivity.xpath(), medicationActivity] + ]); + medicationsSection.cleanupStep(cleanup.replaceWithField('medications')); + return [medicationsSection, medicationActivity]; + } }; exports.medicationsSection = exportMedicationsSection; From 951892d9ec9db46d98e6ec406344d3c7f8036dcc Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Mon, 7 Nov 2022 07:29:12 -0700 Subject: [PATCH 34/36] fix medication section with immunizations --- lib/parser/ccda/sections/medications.js | 105 ++++++++++++------------ 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index 382281eb..d4b1027d 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -131,8 +131,7 @@ var exportMedicationsSection = function (version) { ["identifiers", "0..*", "h:id", shared.Identifier], ["unencoded_name", "0..1", "h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], ["product", "1..1", "h:manufacturedMaterial/h:code", shared.ConceptDescriptor], - ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"], - ["manufacturedMaterial", "1..1", "h:manufacturedMaterial", immunizationMedicationInformation] + ["manufacturer", "0..1", "h:manufacturerOrganization/h:name/text()"] ]); medicationSupplyOrder = component.define("medicationSupplyOrder") @@ -186,8 +185,7 @@ var exportMedicationsSection = function (version) { ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition], ["indication", "0..1", "h:entryRelationship[@typeCode='RSON']/h:observation", MedicationIndication], //["instructions", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply/*/*/h:templateId[@root='2.16.840.1.113883.10.20.22.4.20']", MedicationInstructions], - ["dispense", "0..1", MedicationDispense.xpath(), MedicationDispense], - ["manufacturedMaterial", "1..1", "h:manufacturedMaterial", manufacturedMaterial] + ["dispense", "0..1", MedicationDispense.xpath(), MedicationDispense] ]) //.cleanupStep(Cleanup.extractAllFields(["medicationName"])) .cleanupStep(function () { @@ -242,69 +240,70 @@ var exportMedicationsSection = function (version) { // * ccda-r1.0 (OLD VERSION) * // *************************************************************************** } else { + manufacturedMaterial = component.define("manufacturedMaterial") .fields([ ["code", "1..1", "h:manufacturedMaterial/h:code "], ["translation", "0..*", "h:manufacturedMaterial/h:translation"], ["lotNumberText", "0..*", "h:manufacturedMaterial/h:lotNumberText"], - ["manufacturerOrganization", "0..1", "h:manufacturerOrganization"], + ["lotNumberText", "0..1", "h:lotNumberText"], ]); - immunizationMedicationInformation = component.define("immunizationMedicationInformation") + immunizationMedicationInformation = component.define("immunizationMedicationInformation") .templateRoot("2.16.840.1.113883.10.20.22.4.54") .fields([ ["id", "0..*", "h:id"], ["manufacturedMaterial", "1..1", "h:manufacturedMaterial", manufacturedMaterial], + ["manufacturerOrganization", "1..1", "h:manufacturerOrganization"], + ]); + medicationInformation = component.define("medicationInformation") + .templateRoot("2.16.840.1.113883.10.20.1.53") + .fields([ + ["unencoded_name", "0..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], + ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], ]); - medicationInformation = component.define("medicationInformation") - .templateRoot("2.16.840.1.113883.10.20.1.53") - .fields([ - ["unencoded_name", "0..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code/h:originalText", shared.TextWithReference], - ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", immunizationMedicationInformation], - // ["product", "1..1", "h:manufacturedProduct/h:manufacturedMaterial/h:code", shared.ConceptDescriptor], - ]); - - medicationSupplyOrder = component.define("medicationSupplyOrder") - .templateRoot("2.16.840.1.113883.10.20.1.34") - .fields([ - ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], - ["repeatNumber", "0..1", "h:repeatNumber/@value"], - ["quantity", "0..1", "h:quantity/@value"], - ["author", "0..1", "h:author", author] - ]); - - medicationActivity = component.define("Medications") - .templateRoot(["2.16.840.1.113883.10.20.1.34", "2.16.840.1.113883.10.20.1.24"]) - .fields([ - ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], - ["identifiers", "0..*", "h:id", shared.Identifier], - ["status", "1..1", "h:statusCode/@code"], - ["sig", "0..1", "h:text", shared.TextWithReference], - ["product", "1..1", "(h:product | h:consumable)", medicationInformation], - ["supply", "0..1", "../h:supply", medicationSupplyOrder], - ["administration", "0..1", "../h:substanceAdministration", MedicationAdministration], - ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition] - ]) - .cleanupStep(function () { - - //Cleanup Status. - - if (_.get(this, "js.status") === "EVN") { - this.js.status = "Completed"; - } - if (_.get(this, "js.status") === "INT") { - this.js.status = "Prescribed"; - } - }); - medicationsSection = component.define("medicationsSection"); - medicationsSection.templateRoot("2.16.840.1.113883.10.20.1.8"); - medicationsSection.fields([ - ["Medications", "0..*", medicationActivity.xpath(), medicationActivity] + medicationSupplyOrder = component.define("medicationSupplyOrder") + .templateRoot("2.16.840.1.113883.10.20.1.34") + .fields([ + ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], + ["repeatNumber", "0..1", "h:repeatNumber/@value"], + ["quantity", "0..1", "h:quantity/@value"], + ["author", "0..1", "h:author", author] ]); - medicationsSection.cleanupStep(cleanup.replaceWithField('medications')); - return [medicationsSection, medicationActivity]; - } + + medicationActivity = component.define("Medications") + .templateRoot(["2.16.840.1.113883.10.20.1.34", "2.16.840.1.113883.10.20.1.24"]) + .fields([ + ["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime], + ["identifiers", "0..*", "h:id", shared.Identifier], + ["status", "1..1", "h:statusCode/@code"], + ["sig", "0..1", "h:text", shared.TextWithReference], + ["product", "1..1", "(h:product | h:consumable)", medicationInformation], + ["supply", "0..1", "../h:supply", medicationSupplyOrder], + ["administration", "0..1", "../h:substanceAdministration", MedicationAdministration], + ["precondition", "1..1", "h:precondition/h:criterion", MedicationPrecondition] + ]) + .cleanupStep(function () { + + //Cleanup Status. + + if (_.get(this, "js.status") === "EVN") { + this.js.status = "Completed"; + } + if (_.get(this, "js.status") === "INT") { + this.js.status = "Prescribed"; + } + }); + + medicationsSection = component.define("medicationsSection"); + medicationsSection.templateRoot("2.16.840.1.113883.10.20.1.8"); + medicationsSection.fields([ + ["Medications", "0..*", medicationActivity.xpath(), medicationActivity] + ]); + medicationsSection.cleanupStep(cleanup.replaceWithField('medications')); + return [medicationsSection, medicationActivity]; + } }; exports.medicationsSection = exportMedicationsSection; From 33636cefc076a1530a0d90318d431773c9cc61a7 Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Mon, 7 Nov 2022 08:00:33 -0700 Subject: [PATCH 35/36] add supporting files --- run.js | 2 +- test/fixtures/parser-ccda/CCD_1.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/run.js b/run.js index 99953756..f63087ce 100644 --- a/run.js +++ b/run.js @@ -2,7 +2,7 @@ var fs = require('fs'); var path = require('path'); var bb = require('./'); -var file = path.join(__dirname, 'test/fixtures/parser-ccda/Transfer_Summary.xml'); +var file = path.join(__dirname, 'test/fixtures/parser-ccda/CCD_1.xml'); var xml = fs.readFileSync(file, {encoding: 'utf-8'}); var result = bb.parse(xml); diff --git a/test/fixtures/parser-ccda/CCD_1.xml b/test/fixtures/parser-ccda/CCD_1.xml index 28526a62..6c1c3323 100644 --- a/test/fixtures/parser-ccda/CCD_1.xml +++ b/test/fixtures/parser-ccda/CCD_1.xml @@ -837,13 +837,13 @@
- REVIEW OF SYSTEMS - Patient denies recent history of fever or malaise. Positive + Patient denies recent history of fever or malaise. Positive For weakness and shortness of breath. One episode of melena. No recent headaches. Positive for osteoarthritis in hips, knees and hands. From 49fee7185f21a53b17abc7d5a6a5b3694643c19b Mon Sep 17 00:00:00 2001 From: Richard Whitney Date: Mon, 7 Nov 2022 08:26:33 -0700 Subject: [PATCH 36/36] fix medication section with immunizations --- lib/parser/ccda/sections/medications.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/parser/ccda/sections/medications.js b/lib/parser/ccda/sections/medications.js index d4b1027d..ded90d7b 100644 --- a/lib/parser/ccda/sections/medications.js +++ b/lib/parser/ccda/sections/medications.js @@ -167,7 +167,8 @@ var exportMedicationsSection = function (version) { ["identifiers", "0..*", "h:id", shared.Identifier], ["performer", "0..1", "h:performer", MedicationPerformer], ["supply", "0..1", "h:entryRelationship[@typeCode='REFR']/h:supply", medicationSupplyOrder], - ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation] + ["product", "0..1", "h:product/h:manufacturedProduct", medicationInformation], + ["product", "0..1", "h:product/h:manufacturedProduct", immunizationMedicationInformation] ]); medicationActivity = component.define("medicationActivity")