Skip to content

Commit

Permalink
normalized display name mods moved to xmlmods json
Browse files Browse the repository at this point in the history
  • Loading branch information
Afsin Ustundag committed Nov 26, 2014
1 parent 44bf12a commit f8c68f2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 23 deletions.
23 changes: 0 additions & 23 deletions test/util/xml2jsutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@ exports.findSection = function (sections, templateIds) {
return null;
};

var normalizedDisplayNames = {
"History of immunizations": 'Immunizations',
"History of encounters": 'Encounters',
"Patient Objection": "Patient objection",
"HISTORY OF PROCEDURES": "History of Procedures",
"HISTORY OF IMMUNIZATIONS": "Immunizations",
"HISTORY OF MEDICATION USE": "History of medication use",
"Payer": "Payers",
"Treatment plan": "Plan of Care",
"RESULTS": "Relevant diagnostic tests and/or laboratory data",
"history of prior surgery [For Hx of Tx, use H prefix]": "history of prior surgery [For Hx of Tx, use H prefix]",
"TREATMENT PLAN": "Plan of Care",
"PAYMENT SOURCES": "Payment sources",
"VITAL SIGNS": "Vital Signs",
"Problem list": "Problem List",
"PROBLEM LIST": "Problem List"
};

exports.processIntroducedCodeAttrs = function processIntroducedCodeAttrs(original, generated) {
Object.keys(generated).forEach(function (key) {
if ((key === '$') && original[key]) {
Expand All @@ -52,11 +34,6 @@ exports.processIntroducedCodeAttrs = function processIntroducedCodeAttrs(origina
delete generatedAttrs[attr];
}
});
if (originalAttrs.displayName && (originalAttrs.displayName !== generatedAttrs.displayName)) {
if (normalizedDisplayNames[originalAttrs.displayName]) {
originalAttrs.displayName = normalizedDisplayNames[originalAttrs.displayName];
}
}
} else if (original[key] && (typeof original[key] === 'object') && (typeof generated[key] === 'object')) {
processIntroducedCodeAttrs(original[key], generated[key]);
}
Expand Down
22 changes: 22 additions & 0 deletions test/xmlmods/ccd1Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ var normalizedCodeSystemNames = {
"Race & Ethnicity - CDC": "Race and Ethnicity - CDC"
};

var normalizedDisplayNames = {
"HISTORY OF MEDICATION USE": "History of medication use",
"History of immunizations": "Immunizations",
"Patient Objection": "Patient objection",
"HISTORY OF PROCEDURES": "History of Procedures",
"History of encounters": "Encounters",
"Payer": "Payers",
"Treatment plan": "Plan of Care",
"PROBLEM LIST": "Problem List",
"VITAL SIGNS": "Vital Signs",
"RESULTS": "Relevant diagnostic tests and/or laboratory data"
};

module.exports = [{
xpath: "//h:title",
action: "replaceText",
Expand Down Expand Up @@ -62,4 +75,13 @@ module.exports = [{
map: normalizedCodeSystemNames
},
comment: 'blue-button parser normalization'
}, {
xpath: "//*[@codeSystem][@displayName][@code]",
action: "normalize",
params: {
attr: "displayName",
srcAttr: "code",
map: normalizedDisplayNames
},
comment: 'blue-button parser normalization'
}];
22 changes: 22 additions & 0 deletions test/xmlmods/viteraParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ var normalizedCodeSystemNames = {
"MaritalStatus": "HL7 Marital Status"
};

var normalizedDisplayNames = {
"HISTORY OF MEDICATION USE": "History of medication use",
"HISTORY OF IMMUNIZATIONS": "Immunizations",
"HISTORY OF PROCEDURES": "History of Procedures",
"history of prior surgery [For Hx of Tx, use H prefix]": "history of prior surgery [For Hx of Tx, use H prefix]",
"History of encounters": "Encounters",
"PAYMENT SOURCES": "Payment sources",
"TREATMENT PLAN": "Plan of Care",
"Problem list": "Problem List",
"VITAL SIGNS": "Vital Signs",
"RESULTS": "Relevant diagnostic tests and/or laboratory data"
};

module.exports = [{
xpath: "//h:recordTarget/h:patientRole/h:patient/h:raceCode",
action: "removeNode",
Expand Down Expand Up @@ -359,4 +372,13 @@ module.exports = [{
map: normalizedCodeSystemNames
},
comment: 'blue-button parser normalization'
}, {
xpath: "//*[@codeSystem][@displayName][@code]",
action: "normalize",
params: {
attr: "displayName",
srcAttr: "code",
map: normalizedDisplayNames
},
comment: 'blue-button parser normalization'
}];

0 comments on commit f8c68f2

Please sign in to comment.