Skip to content

Commit

Permalink
correct Result Observation templateId and some code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Afsin Ustundag committed Dec 3, 2014
1 parent 5408eab commit 9c2c0d7
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 241 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "blue-button",
"version": "1.3.0-beta.15",
"version": "1.3.0-beta.16",
"main": "dist/blue-button.js",
"license": "Apache-2.0",
"ignore": [
Expand Down
170 changes: 63 additions & 107 deletions dist/blue-button.js

Large diffs are not rendered by default.

170 changes: 63 additions & 107 deletions dist/mocha_tests.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions lib/parser/c32/sections/results.js
Expand Up @@ -18,7 +18,7 @@ var exportResultsSection = function (version) {
]);

var ResultObservation = component.define("ResultObservation")
.templateRoot("2.16.840.1.113883.3.88.11.83.15")
.templateRoot("2.16.840.1.113883.3.88.11.83.15.1")
.fields([
["identifiers", "0..*", "h:id", shared.Identifier],
["result", "1..1", "h:code", shared.ConceptDescriptor],
Expand All @@ -44,7 +44,6 @@ var exportResultsSection = function (version) {
["result_set", "0..1", "h:code", shared.ConceptDescriptor],
["results", "1..*", ResultObservation.xpath(), ResultObservation]
]);
//ResultsOrganizer.cleanupStep(cleanup.extractAllFields(['panelName']));

var resultsSection = component.define("resultsSection");
resultsSection.templateRoot(['2.16.840.1.113883.3.88.11.83.122']); // .1 for "entries required"
Expand Down
2 changes: 1 addition & 1 deletion lib/parser/c32/shared.js
Expand Up @@ -13,7 +13,7 @@ var Identifier = shared.Identifier = component.define("Identifier")
.fields([
["identifier", "1..1", "@root"],
["extension", "0..1", "@extension"],
]).cleanupStep(cleanup.clearNulls);
]);

var TextWithReference = shared.TextWithReference = component.define("TextWithReference");
TextWithReference.fields([
Expand Down
19 changes: 1 addition & 18 deletions lib/parser/ccda/demographics.js
Expand Up @@ -59,21 +59,4 @@ module.exports.patient = component.define("Patient")
["religion", "0..1", "h:patient/h:religiousAffiliationCode/@code", shared.SimpleCode("2.16.840.1.113883.5.1076")],
["birthplace", "0..1", "h:patient/h:birthplace/h:place/h:addr", shared.Address],
["guardians", "0..*", "h:patient/h:guardian", Guardian]
]).cleanupStep(function () {
if (this.js && this.js.phone) {
this.js.phone = this.js.phone.filter(function (e) {
return e;
});
if (this.js.phone.length === 0) {
delete this.js.phone;
}
}
if (this.js && this.js.email) {
this.js.email = this.js.email.filter(function (e) {
return e;
});
if (this.js.email.length === 0) {
delete this.js.email;
}
}
});
]);
2 changes: 1 addition & 1 deletion lib/parser/common/shared.js
Expand Up @@ -24,7 +24,7 @@ email.fields([
email.cleanupStep(function () {
if (this.js && this.js.address) {
this.js.address = this.js.address.substring(7);

//NOTE: type for email should be empty (per PragueExpat)
if (this.js.type) {
this.js.type = '';
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "blue-button",
"version": "1.3.0-beta.15",
"version": "1.3.0-beta.16",
"description": "Blue Button (CCDA) to JSON Parser.",
"main": "./index.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/generated/CCD_1.json
Expand Up @@ -1960,7 +1960,7 @@
]
},
"meta": {
"version": "1.3.0-beta.15",
"version": "1.3.0-beta.16",
"identifiers": [
{
"identifier": "2.16.840.1.113883.19.5.99999.1",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/generated/SampleCCDDocument.json
Expand Up @@ -519,7 +519,7 @@
]
},
"meta": {
"version": "1.3.0-beta.15",
"version": "1.3.0-beta.16",
"identifiers": [
{
"identifier": "db734647-fc99-424c-a864-7e3cda82e703"
Expand Down
Expand Up @@ -1048,7 +1048,7 @@
]
},
"meta": {
"version": "1.3.0-beta.15",
"version": "1.3.0-beta.16",
"identifiers": [
{
"identifier": "2.16.840.1.113883.4.349",
Expand Down

0 comments on commit 9c2c0d7

Please sign in to comment.