From 68cc0b00e418e637b81550a14c381cc9d875e373 Mon Sep 17 00:00:00 2001 From: Afsin Ustundag Date: Wed, 25 Mar 2015 20:26:42 -0400 Subject: [PATCH] confidentiality code --- bower.json | 2 +- dist/blue-button.js | 18 +++++++++++++++++- dist/mocha_tests.js | 18 +++++++++++++++++- lib/parser.js | 4 ++++ lib/parser/c32/ccd.js | 1 + lib/parser/ccda/ccd.js | 1 + lib/parser/cda/ccd.js | 1 + package.json | 2 +- test/fixtures/generated/CCD_1.json | 3 ++- test/fixtures/generated/SampleCCDDocument.json | 3 ++- .../VA_CCD_Sample_File_Version_12_5_1.json | 3 ++- 11 files changed, 49 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 4ec0203d..107cd4e9 100644 --- a/bower.json +++ b/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": [ diff --git a/dist/blue-button.js b/dist/blue-button.js index 31ea204f..e4aee886 100644 --- a/dist/blue-button.js +++ b/dist/blue-button.js @@ -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; } @@ -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], @@ -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], @@ -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], @@ -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#", @@ -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": { diff --git a/dist/mocha_tests.js b/dist/mocha_tests.js index 96ba64b8..53b1b4ed 100644 --- a/dist/mocha_tests.js +++ b/dist/mocha_tests.js @@ -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; } @@ -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], @@ -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], @@ -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], @@ -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#", @@ -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": { diff --git a/lib/parser.js b/lib/parser.js index 6bb12741..a9b99d91 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -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; } diff --git a/lib/parser/c32/ccd.js b/lib/parser/c32/ccd.js index 87c80ade..916f70af 100644 --- a/lib/parser/c32/ccd.js +++ b/lib/parser/c32/ccd.js @@ -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], diff --git a/lib/parser/ccda/ccd.js b/lib/parser/ccda/ccd.js index d2c71755..a8ffcde4 100644 --- a/lib/parser/ccda/ccd.js +++ b/lib/parser/ccda/ccd.js @@ -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], diff --git a/lib/parser/cda/ccd.js b/lib/parser/cda/ccd.js index cbdddac1..b75625dd 100644 --- a/lib/parser/cda/ccd.js +++ b/lib/parser/cda/ccd.js @@ -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], diff --git a/package.json b/package.json index a16cce4b..7d368f68 100644 --- a/package.json +++ b/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": { diff --git a/test/fixtures/generated/CCD_1.json b/test/fixtures/generated/CCD_1.json index 078acf02..4ffb89e4 100644 --- a/test/fixtures/generated/CCD_1.json +++ b/test/fixtures/generated/CCD_1.json @@ -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", diff --git a/test/fixtures/generated/SampleCCDDocument.json b/test/fixtures/generated/SampleCCDDocument.json index 6de55be7..25eb015c 100644 --- a/test/fixtures/generated/SampleCCDDocument.json +++ b/test/fixtures/generated/SampleCCDDocument.json @@ -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", diff --git a/test/fixtures/generated/VA_CCD_Sample_File_Version_12_5_1.json b/test/fixtures/generated/VA_CCD_Sample_File_Version_12_5_1.json index f522a98a..31b03800 100644 --- a/test/fixtures/generated/VA_CCD_Sample_File_Version_12_5_1.json +++ b/test/fixtures/generated/VA_CCD_Sample_File_Version_12_5_1.json @@ -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",