Skip to content

Commit

Permalink
confidentiality code
Browse files Browse the repository at this point in the history
  • Loading branch information
Afsin Ustundag committed Mar 26, 2015
1 parent bf0204a commit 68cc0b0
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "blue-button",
"version": "1.5.0-beta.1",
"version": "1.5.0-beta.2",
"main": "dist/blue-button.js",
"license": "Apache-2.0",
"ignore": [
Expand Down
18 changes: 17 additions & 1 deletion dist/blue-button.js
Expand Up @@ -21,6 +21,10 @@ function sections(data) {
data.meta.identifiers = data.data.doc_identifiers;
delete data.data.doc_identifiers;
}
if (data.data.confidentiality) {
data.meta.confidentiality = data.data.confidentiality;
delete data.data.confidentiality;
}
data.meta.sections = Object.keys(data.data);
return data;
}
Expand Down Expand Up @@ -139,6 +143,7 @@ var exportC32 = function (version) {
return component.define("C32")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["allergies", "0..1", allergiesSection.xpath(), allergiesSection],
["encounters", "0..1", encountersSection.xpath(), encountersSection],
Expand Down Expand Up @@ -1053,6 +1058,7 @@ var exportCCD = function (version) {
return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["vitals", "0..1", vitalSignsSection.xpath(), vitalSignsSection],
["results", "0..1", resultsSection.xpath(), resultsSection],
Expand Down Expand Up @@ -2260,6 +2266,7 @@ var exportCCD = function (version) {
return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["providers", "0..*", "//h:documentationOf/h:serviceEvent/h:performer", providersSection],
["problems", "0..1", problemsSection.xpath(), problemsSection],
Expand Down Expand Up @@ -6633,6 +6640,15 @@ module.exports = OIDs = {
name: "HL7 Marital Status",
uri: "http://hl7.org/codes/MaritalStatus#"
},
"2.16.840.1.113883.5.25": {
name: "Confidentiality Code",
table: {
"N": "Normal",
"R": "Restricted",
"V": "Very Restricted",
"U": "Unrestricted"
}
},
"2.16.840.1.113883.5.83": {
name: "HL7 Result Interpretation",
uri: "http://hl7.org/codes/ResultInterpretation#",
Expand Down Expand Up @@ -20878,7 +20894,7 @@ function hasOwnProperty(obj, prop) {
},{}],91:[function(require,module,exports){
module.exports={
"name": "blue-button",
"version": "1.5.0-beta.1",
"version": "1.5.0-beta.2",
"description": "Blue Button (CCDA, C32, CMS) to JSON Parser.",
"main": "./index.js",
"directories": {
Expand Down
18 changes: 17 additions & 1 deletion dist/mocha_tests.js
Expand Up @@ -44,6 +44,10 @@ function sections(data) {
data.meta.identifiers = data.data.doc_identifiers;
delete data.data.doc_identifiers;
}
if (data.data.confidentiality) {
data.meta.confidentiality = data.data.confidentiality;
delete data.data.confidentiality;
}
data.meta.sections = Object.keys(data.data);
return data;
}
Expand Down Expand Up @@ -162,6 +166,7 @@ var exportC32 = function (version) {
return component.define("C32")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["allergies", "0..1", allergiesSection.xpath(), allergiesSection],
["encounters", "0..1", encountersSection.xpath(), encountersSection],
Expand Down Expand Up @@ -1076,6 +1081,7 @@ var exportCCD = function (version) {
return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["vitals", "0..1", vitalSignsSection.xpath(), vitalSignsSection],
["results", "0..1", resultsSection.xpath(), resultsSection],
Expand Down Expand Up @@ -2283,6 +2289,7 @@ var exportCCD = function (version) {
return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["providers", "0..*", "//h:documentationOf/h:serviceEvent/h:performer", providersSection],
["problems", "0..1", problemsSection.xpath(), problemsSection],
Expand Down Expand Up @@ -6656,6 +6663,15 @@ module.exports = OIDs = {
name: "HL7 Marital Status",
uri: "http://hl7.org/codes/MaritalStatus#"
},
"2.16.840.1.113883.5.25": {
name: "Confidentiality Code",
table: {
"N": "Normal",
"R": "Restricted",
"V": "Very Restricted",
"U": "Unrestricted"
}
},
"2.16.840.1.113883.5.83": {
name: "HL7 Result Interpretation",
uri: "http://hl7.org/codes/ResultInterpretation#",
Expand Down Expand Up @@ -26795,7 +26811,7 @@ function hasOwnProperty(obj, prop) {
},{}],127:[function(require,module,exports){
module.exports={
"name": "blue-button",
"version": "1.5.0-beta.1",
"version": "1.5.0-beta.2",
"description": "Blue Button (CCDA, C32, CMS) to JSON Parser.",
"main": "./index.js",
"directories": {
Expand Down
4 changes: 4 additions & 0 deletions lib/parser.js
Expand Up @@ -20,6 +20,10 @@ function sections(data) {
data.meta.identifiers = data.data.doc_identifiers;
delete data.data.doc_identifiers;
}
if (data.data.confidentiality) {
data.meta.confidentiality = data.data.confidentiality;
delete data.data.confidentiality;
}
data.meta.sections = Object.keys(data.data);
return data;
}
Expand Down
1 change: 1 addition & 0 deletions lib/parser/c32/ccd.js
Expand Up @@ -16,6 +16,7 @@ var exportC32 = function (version) {
return component.define("C32")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["allergies", "0..1", allergiesSection.xpath(), allergiesSection],
["encounters", "0..1", encountersSection.xpath(), encountersSection],
Expand Down
1 change: 1 addition & 0 deletions lib/parser/ccda/ccd.js
Expand Up @@ -20,6 +20,7 @@ var exportCCD = function (version) {
return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["vitals", "0..1", vitalSignsSection.xpath(), vitalSignsSection],
["results", "0..1", resultsSection.xpath(), resultsSection],
Expand Down
1 change: 1 addition & 0 deletions lib/parser/cda/ccd.js
Expand Up @@ -16,6 +16,7 @@ var exportCCD = function (version) {
return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["confidentiality", '0..1', "h:confidentialityCode", shared.SimplifiedCodeOID("2.16.840.1.113883.5.25")],
["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
["providers", "0..*", "//h:documentationOf/h:serviceEvent/h:performer", providersSection],
["problems", "0..1", problemsSection.xpath(), problemsSection],
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "blue-button",
"version": "1.5.0-beta.1",
"version": "1.5.0-beta.2",
"description": "Blue Button (CCDA, C32, CMS) to JSON Parser.",
"main": "./index.js",
"directories": {
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/generated/CCD_1.json
Expand Up @@ -1961,13 +1961,14 @@
]
},
"meta": {
"version": "1.5.0-beta.1",
"version": "1.5.0-beta.2",
"identifiers": [
{
"identifier": "2.16.840.1.113883.19.5.99999.1",
"extension": "TT988"
}
],
"confidentiality": "Normal",
"sections": [
"demographics",
"vitals",
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/generated/SampleCCDDocument.json
Expand Up @@ -519,12 +519,13 @@
]
},
"meta": {
"version": "1.5.0-beta.1",
"version": "1.5.0-beta.2",
"identifiers": [
{
"identifier": "db734647-fc99-424c-a864-7e3cda82e703"
}
],
"confidentiality": "Normal",
"sections": [
"demographics",
"providers",
Expand Down
Expand Up @@ -1098,13 +1098,14 @@
]
},
"meta": {
"version": "1.5.0-beta.1",
"version": "1.5.0-beta.2",
"identifiers": [
{
"identifier": "2.16.840.1.113883.4.349",
"extension": "2.25.153967320391171260195869192743051876940"
}
],
"confidentiality": "Normal",
"sections": [
"demographics",
"allergies",
Expand Down

0 comments on commit 68cc0b0

Please sign in to comment.