Skip to content

Commit

Permalink
Merge pull request #231 from amida-tech/v1.4.1
Browse files Browse the repository at this point in the history
V1.4.1
  • Loading branch information
Afsin Ustundag committed Mar 11, 2015
2 parents 4b4bc9e + 6f64cb2 commit 1d53abb
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 139 deletions.
5 changes: 4 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# blue-button.js Release Notes

# v.1.4.0 - TBD
# v.1.4.1 - March 11, 2015
- c32 parser now uses allergy problem act statusCode as the allergy status

# v.1.4.0 - February 27, 2015
- Removed blue-button-generate methods from API (breaking change, applications should use blue-button-generate directly)
- Supported sections of US Realm CCDA documents are now parsed even when they are not CCD.
- Medications with medication activity that has negationInd attribute true are now ignored.
Expand Down
87 changes: 44 additions & 43 deletions dist/blue-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,10 @@ var exportAllergiesSection = function (version) {
problemAct.fields([
["identifiers", "0..*", "h:id", shared.Identifier],
["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime],
["problemStatus", "1..1", "h:statusCode/@code"],
["observation", "1..1", allergyObservation.xpath(), allergyObservation] // Ignore observation cardinality (in spec can be more than 1)
]);
//problemAct.cleanupStep(cleanup.extractAllFields(['observation']));
problemAct.cleanupStep(cleanup.allergiesProblemStatusToHITSP);

var allergiesSection = component.define('allergiesSection');
allergiesSection.templateRoot(['2.16.840.1.113883.3.88.11.83.102']);
Expand Down Expand Up @@ -1095,47 +1096,6 @@ var includeCleanup = require("../common/cleanup");

var cleanup = module.exports = Object.create(includeCleanup);

cleanup.allergiesProblemStatusToHITSP = (function () {
var dict = {};
dict.active = {
"name": "Active",
"code": "55561003",
"code_system_name": "SNOMED CT"
};
dict.suspended = dict.aborted = {
"name": "Inactive",
"code": "73425007",
"code_system_name": "SNOMED CT"
};
dict.completed = {
"name": "Resolved",
"code": "413322009",
"code_system_name": "SNOMED CT"
};

return function () {
var status = this.js && this.js.problemStatus;
if (status) {
var value = dict[status];
if (value) {
var observation = this.js.observation;
if (!observation) {
this.js.observation = {
status: value
};
} else if (!observation.js) {
observation.js = {
status: value
};
} else if (!observation.js.status) {
observation.js.status = value;
}
}
delete this.js.problemStatus;
}
};
})();

cleanup.promoteAllergenNameIfNoAllergen = function () {
if (this.js && (!this.js.allergen)) {
var name = this.js.allergenName && this.js.allergenName.js;
Expand Down Expand Up @@ -3242,6 +3202,47 @@ cleanup.augmentSimplifiedCodeOID = function (oid) {
return f;
};

cleanup.allergiesProblemStatusToHITSP = (function () {
var dict = {};
dict.active = {
"name": "Active",
"code": "55561003",
"code_system_name": "SNOMED CT"
};
dict.suspended = dict.aborted = {
"name": "Inactive",
"code": "73425007",
"code_system_name": "SNOMED CT"
};
dict.completed = {
"name": "Resolved",
"code": "413322009",
"code_system_name": "SNOMED CT"
};

return function () {
var status = this.js && this.js.problemStatus;
if (status) {
var value = dict[status];
if (value) {
var observation = this.js.observation;
if (!observation) {
this.js.observation = {
status: value
};
} else if (!observation.js) {
observation.js = {
status: value
};
} else if (!observation.js.status) {
observation.js.status = value;
}
}
delete this.js.problemStatus;
}
};
})();

},{"blue-button-meta":44,"blue-button-xml":"blue-button-xml"}],41:[function(require,module,exports){
"use strict";

Expand Down Expand Up @@ -20914,7 +20915,7 @@ function hasOwnProperty(obj, prop) {
},{}],91:[function(require,module,exports){
module.exports={
"name": "blue-button",
"version": "1.4.0",
"version": "1.4.1",
"description": "Blue Button (CCDA, C32, CMS) to JSON Parser.",
"main": "./index.js",
"directories": {
Expand Down
87 changes: 44 additions & 43 deletions dist/mocha_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,10 @@ var exportAllergiesSection = function (version) {
problemAct.fields([
["identifiers", "0..*", "h:id", shared.Identifier],
["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime],
["problemStatus", "1..1", "h:statusCode/@code"],
["observation", "1..1", allergyObservation.xpath(), allergyObservation] // Ignore observation cardinality (in spec can be more than 1)
]);
//problemAct.cleanupStep(cleanup.extractAllFields(['observation']));
problemAct.cleanupStep(cleanup.allergiesProblemStatusToHITSP);

var allergiesSection = component.define('allergiesSection');
allergiesSection.templateRoot(['2.16.840.1.113883.3.88.11.83.102']);
Expand Down Expand Up @@ -1118,47 +1119,6 @@ var includeCleanup = require("../common/cleanup");

var cleanup = module.exports = Object.create(includeCleanup);

cleanup.allergiesProblemStatusToHITSP = (function () {
var dict = {};
dict.active = {
"name": "Active",
"code": "55561003",
"code_system_name": "SNOMED CT"
};
dict.suspended = dict.aborted = {
"name": "Inactive",
"code": "73425007",
"code_system_name": "SNOMED CT"
};
dict.completed = {
"name": "Resolved",
"code": "413322009",
"code_system_name": "SNOMED CT"
};

return function () {
var status = this.js && this.js.problemStatus;
if (status) {
var value = dict[status];
if (value) {
var observation = this.js.observation;
if (!observation) {
this.js.observation = {
status: value
};
} else if (!observation.js) {
observation.js = {
status: value
};
} else if (!observation.js.status) {
observation.js.status = value;
}
}
delete this.js.problemStatus;
}
};
})();

cleanup.promoteAllergenNameIfNoAllergen = function () {
if (this.js && (!this.js.allergen)) {
var name = this.js.allergenName && this.js.allergenName.js;
Expand Down Expand Up @@ -3265,6 +3225,47 @@ cleanup.augmentSimplifiedCodeOID = function (oid) {
return f;
};

cleanup.allergiesProblemStatusToHITSP = (function () {
var dict = {};
dict.active = {
"name": "Active",
"code": "55561003",
"code_system_name": "SNOMED CT"
};
dict.suspended = dict.aborted = {
"name": "Inactive",
"code": "73425007",
"code_system_name": "SNOMED CT"
};
dict.completed = {
"name": "Resolved",
"code": "413322009",
"code_system_name": "SNOMED CT"
};

return function () {
var status = this.js && this.js.problemStatus;
if (status) {
var value = dict[status];
if (value) {
var observation = this.js.observation;
if (!observation) {
this.js.observation = {
status: value
};
} else if (!observation.js) {
observation.js = {
status: value
};
} else if (!observation.js.status) {
observation.js.status = value;
}
}
delete this.js.problemStatus;
}
};
})();

},{"blue-button-meta":45,"blue-button-xml":"blue-button-xml"}],42:[function(require,module,exports){
"use strict";

Expand Down Expand Up @@ -26831,7 +26832,7 @@ function hasOwnProperty(obj, prop) {
},{}],127:[function(require,module,exports){
module.exports={
"name": "blue-button",
"version": "1.4.0",
"version": "1.4.1",
"description": "Blue Button (CCDA, C32, CMS) to JSON Parser.",
"main": "./index.js",
"directories": {
Expand Down
3 changes: 2 additions & 1 deletion lib/parser/c32/sections/allergies.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ var exportAllergiesSection = function (version) {
problemAct.fields([
["identifiers", "0..*", "h:id", shared.Identifier],
["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime],
["problemStatus", "1..1", "h:statusCode/@code"],
["observation", "1..1", allergyObservation.xpath(), allergyObservation] // Ignore observation cardinality (in spec can be more than 1)
]);
//problemAct.cleanupStep(cleanup.extractAllFields(['observation']));
problemAct.cleanupStep(cleanup.allergiesProblemStatusToHITSP);

var allergiesSection = component.define('allergiesSection');
allergiesSection.templateRoot(['2.16.840.1.113883.3.88.11.83.102']);
Expand Down
41 changes: 0 additions & 41 deletions lib/parser/ccda/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,6 @@ var includeCleanup = require("../common/cleanup");

var cleanup = module.exports = Object.create(includeCleanup);

cleanup.allergiesProblemStatusToHITSP = (function () {
var dict = {};
dict.active = {
"name": "Active",
"code": "55561003",
"code_system_name": "SNOMED CT"
};
dict.suspended = dict.aborted = {
"name": "Inactive",
"code": "73425007",
"code_system_name": "SNOMED CT"
};
dict.completed = {
"name": "Resolved",
"code": "413322009",
"code_system_name": "SNOMED CT"
};

return function () {
var status = this.js && this.js.problemStatus;
if (status) {
var value = dict[status];
if (value) {
var observation = this.js.observation;
if (!observation) {
this.js.observation = {
status: value
};
} else if (!observation.js) {
observation.js = {
status: value
};
} else if (!observation.js.status) {
observation.js.status = value;
}
}
delete this.js.problemStatus;
}
};
})();

cleanup.promoteAllergenNameIfNoAllergen = function () {
if (this.js && (!this.js.allergen)) {
var name = this.js.allergenName && this.js.allergenName.js;
Expand Down
41 changes: 41 additions & 0 deletions lib/parser/common/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,44 @@ cleanup.augmentSimplifiedCodeOID = function (oid) {
};
return f;
};

cleanup.allergiesProblemStatusToHITSP = (function () {
var dict = {};
dict.active = {
"name": "Active",
"code": "55561003",
"code_system_name": "SNOMED CT"
};
dict.suspended = dict.aborted = {
"name": "Inactive",
"code": "73425007",
"code_system_name": "SNOMED CT"
};
dict.completed = {
"name": "Resolved",
"code": "413322009",
"code_system_name": "SNOMED CT"
};

return function () {
var status = this.js && this.js.problemStatus;
if (status) {
var value = dict[status];
if (value) {
var observation = this.js.observation;
if (!observation) {
this.js.observation = {
status: value
};
} else if (!observation.js) {
observation.js = {
status: value
};
} else if (!observation.js.status) {
observation.js.status = value;
}
}
delete this.js.problemStatus;
}
};
})();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blue-button",
"version": "1.4.0",
"version": "1.4.1",
"description": "Blue Button (CCDA, C32, CMS) to JSON Parser.",
"main": "./index.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/generated/CCD_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1960,7 +1960,7 @@
]
},
"meta": {
"version": "1.4.0",
"version": "1.4.1",
"identifiers": [
{
"identifier": "2.16.840.1.113883.19.5.99999.1",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/generated/SampleCCDDocument.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
]
},
"meta": {
"version": "1.4.0",
"version": "1.4.1",
"identifiers": [
{
"identifier": "db734647-fc99-424c-a864-7e3cda82e703"
Expand Down
Loading

0 comments on commit 1d53abb

Please sign in to comment.