diff --git a/ccda-explorer/explorer.js b/ccda-explorer/explorer.js index 0e5972e9..2ee4af3b 100644 --- a/ccda-explorer/explorer.js +++ b/ccda-explorer/explorer.js @@ -15,7 +15,8 @@ function getExtension(filename) { var DEFAULT_NS = { "h": "urn:hl7-org:v3", - "xsi": "http://www.w3.org/2001/XMLSchema-instance" + "xsi": "http://www.w3.org/2001/XMLSchema-instance", + "sdtc": "urn:hl7-org:sdtc" }; var root_path="./dump/"; @@ -28,7 +29,7 @@ function parse(vendor, vendor_id, file_id, filename) { // readfile var data = fs.readFileSync(filename).toString(); - var xmlDoc = libxmljs.parseXmlString(data); + var xmlDoc = libxmljs.parseXmlString(data); var item; for (item in meta.templates) { var templates = xmlDoc.get('/h:ClinicalDocument/h:templateId[@root="' + meta.templates[item]["templateId"] + '"]', DEFAULT_NS); @@ -118,7 +119,7 @@ function explore(path){ //var d = bb.parseXml(r, {component:"ccda_results"}); //errors: 119 //var d = bb.parseXml(r); //errors: 346 - + //console.log(d); @@ -234,4 +235,4 @@ function process() console.log(meta.templates); -} \ No newline at end of file +} diff --git a/lib/parser/ccda/demographics.js b/lib/parser/ccda/demographics.js index a7e5b3e9..d7a447ad 100644 --- a/lib/parser/ccda/demographics.js +++ b/lib/parser/ccda/demographics.js @@ -32,6 +32,7 @@ exports.patient = component.define("Patient") ["phone", "0..*", shared.phone.xpath(), shared.phone], ["email", "0..*", shared.email.xpath(), shared.email], ["race", "0..1", "h:patient/h:raceCode", shared.ConceptDescriptor], + ["detailed_race", "0..1", "h:patient/sdtc:raceCode", shared.ConceptDescriptor], ["ethnicity", "0..1", "h:patient/h:ethnicGroupCode", shared.ConceptDescriptor], ["languages", "0..*", "h:patient/h:languageCommunication", LanguageCommunication], ["religion", "0..1", "h:patient/h:religiousAffiliationCode", shared.ConceptDescriptor], diff --git a/lib/parser/ccda/sections/encounters.js b/lib/parser/ccda/sections/encounters.js index 5c6aed3f..32b1bead 100644 --- a/lib/parser/ccda/sections/encounters.js +++ b/lib/parser/ccda/sections/encounters.js @@ -10,7 +10,7 @@ var exportEncountersSection = function (version) { var clinicalStatementsIDs = bbm.CCDA["statements" + version]; var finding = component.define("finding"); - finding.templateRoot([clinicalStatementsIDs.Indication]); + finding.templateRoot([clinicalStatementsIDs.Indication, clinicalStatementsIDs.ProblemObservation]); finding.fields([ ["identifiers", "1..*", "h:id", shared.Identifier], ["value", "1..1", "h:value", shared.ConceptDescriptor],