Skip to content

Commit

Permalink
Merge pull request #233 from amida-tech/metadata-add
Browse files Browse the repository at this point in the history
Metadata add
  • Loading branch information
au2 committed Mar 26, 2015
2 parents bf0204a + 3a1e95f commit 8e90dea
Show file tree
Hide file tree
Showing 21 changed files with 165 additions and 180 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
111 changes: 54 additions & 57 deletions dist/blue-button.js
Expand Up @@ -2,6 +2,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ
"use strict";

var parseCMS = require("blue-button-cms");
var _ = require('underscore');

var componentRouter = require("./parser/router").componentRouter;
var xmlParser = require("blue-button-xml").xmlUtil;
Expand All @@ -17,9 +18,9 @@ function sections(data) {
data.meta = {};
}

if (data.data.doc_identifiers) {
data.meta.identifiers = data.data.doc_identifiers;
delete data.data.doc_identifiers;
if (data.data.meta) {
_.extend(data.meta, data.data.meta);
delete data.data.meta;
}
data.meta.sections = Object.keys(data.data);
return data;
Expand Down Expand Up @@ -120,7 +121,7 @@ module.exports = {
parseText: parseText
};

},{"../package.json":91,"./parser/router":42,"./sense.js":43,"blue-button-cms":"blue-button-cms","blue-button-xml":"blue-button-xml","util":89}],2:[function(require,module,exports){
},{"../package.json":91,"./parser/router":42,"./sense.js":43,"blue-button-cms":"blue-button-cms","blue-button-xml":"blue-button-xml","underscore":90,"util":89}],2:[function(require,module,exports){
"use strict";

var component = require("blue-button-xml").component;
Expand All @@ -138,7 +139,7 @@ var exportC32 = function (version) {
var encountersSection = require("./sections/encounters").encountersSection(version)[0];
return component.define("C32")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["meta", "0..1", ".", shared.metaData],
["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 @@ -205,8 +206,8 @@ exports.patient = component.define("Patient")
["addresses", "0..*", "h:addr", shared.Address],
["phone", "0..*", shared.phone.xpath(), shared.phone],
["email", "0..*", shared.email.xpath(), shared.email],
["race", "0..1", "h:patient/h:raceCode", shared.SimplifiedCodeOID("2.16.840.1.113883.6.238")],
["ethnicity", "0..1", "h:patient/h:ethnicGroupCode", shared.SimplifiedCodeOID("2.16.840.1.113883.6.238")],
["race", "0..1", "h:patient/h:raceCode", shared.simplifiedCodeOID("2.16.840.1.113883.6.238")],
["ethnicity", "0..1", "h:patient/h:ethnicGroupCode", shared.simplifiedCodeOID("2.16.840.1.113883.6.238")],
["languages", "0..*", "h:patient/h:languageCommunication", LanguageCommunication],
["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],
Expand Down Expand Up @@ -708,7 +709,7 @@ var exportProceduresSection = function (version) {
["procedure", "1..1", "h:code", shared.ConceptDescriptor],
["identifiers", "0..*", "h:id", shared.Identifier],
//Not C32 Supported.
//["status", "1..1", "h:statusCode", shared.SimplifiedCodeOID('2.16.840.1.113883.11.20.9.22')],
//["status", "1..1", "h:statusCode", shared.simplifiedCodeOID('2.16.840.1.113883.11.20.9.22')],
["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime],
["body_sites", "0..*", "h:targetSiteCode", shared.ConceptDescriptor],

Expand Down Expand Up @@ -890,12 +891,6 @@ var commonShared = require('../common/shared');

var shared = module.exports = Object.create(commonShared);

var Identifier = shared.Identifier = component.define("Identifier")
.fields([
["identifier", "1..1", "@root"],
["extension", "0..1", "@extension"],
]);

var TextWithReference = shared.TextWithReference = component.define("TextWithReference");
TextWithReference.fields([
["text", "0..*", "text()"],
Expand Down Expand Up @@ -949,12 +944,6 @@ AgeDescriptor.fields([
var SimplifiedCode = shared.SimplifiedCode = ConceptDescriptor.define("SimpifiedCode")
.cleanupStep(cleanup.augmentSimplifiedCode);

var SimplifiedCodeOID = shared.SimplifiedCodeOID = function (oid) {
var r = ConceptDescriptor.define("SC " + oid);
r.cleanupStep(cleanup.augmentSimplifiedCodeOID(oid));
return r;
};

var PhysicalQuantity = shared.PhysicalQuantity = component.define("PhysicalQuantity")
.fields([
["value", "1..1", "@value", processor.asFloat],
Expand Down Expand Up @@ -1003,7 +992,7 @@ var Address = shared.Address = component.define("Address")

var Organization = shared.Organization = component.define("Organization")
.fields([
["identifiers", "0..*", "h:id", Identifier],
["identifiers", "0..*", "h:id", shared.Identifier],
["name", "0..*", "h:name/text()"],
["address", "0..*", "h:addr", Address],
["email", "0..*", shared.email.xpath(), shared.email],
Expand All @@ -1012,7 +1001,7 @@ var Organization = shared.Organization = component.define("Organization")

var assignedEntity = shared.assignedEntity = component.define("assignedEntity")
.fields([
["identifiers", "0..*", "h:id", Identifier],
["identifiers", "0..*", "h:id", shared.Identifier],
["name", "0..*", "h:assignedPerson/h:name", IndividualName],
["address", "0..*", "h:addr", Address],
["email", "0..*", shared.email.xpath(), shared.email],
Expand Down Expand Up @@ -1052,7 +1041,7 @@ var exportCCD = function (version) {

return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["meta", "0..1", ".", shared.metaData],
["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 @@ -1135,8 +1124,8 @@ exports.patient = component.define("Patient")
["addresses", "0..*", "h:addr", shared.Address],
["phone", "0..*", shared.phone.xpath(), shared.phone],
["email", "0..*", shared.email.xpath(), shared.email],
["race", "0..1", "h:patient/h:raceCode", shared.SimplifiedCodeOID("2.16.840.1.113883.6.238")],
["ethnicity", "0..1", "h:patient/h:ethnicGroupCode", shared.SimplifiedCodeOID("2.16.840.1.113883.6.238")],
["race", "0..1", "h:patient/h:raceCode", shared.simplifiedCodeOID("2.16.840.1.113883.6.238")],
["ethnicity", "0..1", "h:patient/h:ethnicGroupCode", shared.simplifiedCodeOID("2.16.840.1.113883.6.238")],
["languages", "0..*", "h:patient/h:languageCommunication", LanguageCommunication],
["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],
Expand Down Expand Up @@ -1878,7 +1867,7 @@ var exportProceduresSection = function (version) {
entry.fields([
["procedure", "1..1", "h:code", shared.ConceptDescriptor],
["identifiers", "0..*", "h:id", shared.Identifier],
["status", "1..1", "h:statusCode", shared.SimplifiedCodeOID('2.16.840.1.113883.11.20.9.22')],
["status", "1..1", "h:statusCode", shared.simplifiedCodeOID('2.16.840.1.113883.11.20.9.22')],
["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime],
["body_sites", "0..*", "h:targetSiteCode", shared.ConceptDescriptor],
["specimen", "0..1", "h:specimen", ProcedureSpecimen],
Expand Down Expand Up @@ -2106,12 +2095,6 @@ var commonShared = require('../common/shared');

var shared = module.exports = Object.create(commonShared);

var Identifier = shared.Identifier = component.define("Identifier")
.fields([
["identifier", "1..1", "@root"],
["extension", "0..1", "@extension"],
]);

var TextWithReference = shared.TextWithReference = component.define("TextWithReference");
TextWithReference.fields([
["text", "0..*", "text()"],
Expand Down Expand Up @@ -2160,12 +2143,6 @@ AgeDescriptor.fields([
var SimplifiedCode = shared.SimplifiedCode = ConceptDescriptor.define("SimpifiedCode")
.cleanupStep(cleanup.augmentSimplifiedCode);

var SimplifiedCodeOID = shared.SimplifiedCodeOID = function (oid) {
var r = ConceptDescriptor.define("SC " + oid);
r.cleanupStep(cleanup.augmentSimplifiedCodeOID(oid));
return r;
};

var PhysicalQuantity = shared.PhysicalQuantity = component.define("PhysicalQuantity")
.fields([
["value", "1..1", "@value", processor.asFloat],
Expand Down Expand Up @@ -2214,7 +2191,7 @@ var Address = shared.Address = component.define("Address")

var Organization = shared.Organization = component.define("Organization")
.fields([
["identifiers", "0..*", "h:id", Identifier],
["identifiers", "0..*", "h:id", shared.Identifier],
["name", "0..*", "h:name/text()"],
["address", "0..*", "h:addr", Address],
["email", "0..*", shared.email.xpath(), shared.email],
Expand All @@ -2223,7 +2200,7 @@ var Organization = shared.Organization = component.define("Organization")

var assignedEntity = shared.assignedEntity = component.define("assignedEntity")
.fields([
["identifiers", "0..*", "h:id", Identifier],
["identifiers", "0..*", "h:id", shared.Identifier],
["name", "0..*", "h:assignedPerson/h:name", IndividualName],
["address", "0..*", "h:addr", Address],
["email", "0..*", shared.email.xpath(), shared.email],
Expand Down Expand Up @@ -2259,7 +2236,7 @@ var exportCCD = function (version) {

return component.define("CCD")
.fields([
["doc_identifiers", "0..*", "h:id", shared.Identifier],
["meta", "0..1", ".", shared.metaData],
["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 @@ -2689,7 +2666,7 @@ var exportProceduresSection = function (version) {
entry.fields([
["procedure", "1..1", "h:code", shared.ConceptDescriptor],
["identifiers", "0..*", "h:id", shared.Identifier],
["status", "1..1", "h:statusCode", shared.SimplifiedCodeOID('2.16.840.1.113883.11.20.9.22')],
["status", "1..1", "h:statusCode", shared.simplifiedCodeOID('2.16.840.1.113883.11.20.9.22')],
["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime],
["body_sites", "0..*", "h:targetSiteCode", shared.ConceptDescriptor],

Expand Down Expand Up @@ -2826,12 +2803,6 @@ var commonShared = require('../common/shared');

var shared = module.exports = Object.create(commonShared);

var Identifier = shared.Identifier = component.define("Identifier")
.fields([
["identifier", "1..1", "@root"],
["extension", "0..1", "@extension"],
]);

var TextWithReference = shared.TextWithReference = component.define("TextWithReference");
TextWithReference.fields([
["text", "0..*", "text()"],
Expand Down Expand Up @@ -2885,12 +2856,6 @@ AgeDescriptor.fields([
var SimplifiedCode = shared.SimplifiedCode = ConceptDescriptor.define("SimpifiedCode")
.cleanupStep(cleanup.augmentSimplifiedCode);

var SimplifiedCodeOID = shared.SimplifiedCodeOID = function (oid) {
var r = ConceptDescriptor.define("SC " + oid);
r.cleanupStep(cleanup.augmentSimplifiedCodeOID(oid));
return r;
};

var PhysicalQuantity = shared.PhysicalQuantity = component.define("PhysicalQuantity")
.fields([
["value", "1..1", "@value", processor.asFloat],
Expand Down Expand Up @@ -2939,7 +2904,7 @@ var Address = shared.Address = component.define("Address")

var Organization = shared.Organization = component.define("Organization")
.fields([
["identifiers", "0..*", "h:id", Identifier],
["identifiers", "0..*", "h:id", shared.Identifier],
["name", "0..*", "h:name/text()"],
["address", "0..*", "h:addr", Address],
["email", "0..*", shared.email.xpath(), shared.email],
Expand All @@ -2948,7 +2913,7 @@ var Organization = shared.Organization = component.define("Organization")

var assignedEntity = shared.assignedEntity = component.define("assignedEntity")
.fields([
["identifiers", "0..*", "h:id", Identifier],
["identifiers", "0..*", "h:id", shared.Identifier],
["name", "0..*", "h:assignedPerson/h:name", IndividualName],
["address", "0..*", "h:addr", Address],
["email", "0..*", shared.email.xpath(), shared.email],
Expand Down Expand Up @@ -3214,6 +3179,12 @@ var cleanup = require('./cleanup');

var shared = module.exports = {};

var Identifier = shared.Identifier = component.define("Identifier")
.fields([
["identifier", "1..1", "@root"],
["extension", "0..1", "@extension"],
]);

var simpleCode = shared.SimpleCode = function (oid) {
var r = component.define("SimpleCode." + oid);
r.fields([]);
Expand Down Expand Up @@ -3252,6 +3223,23 @@ phone.cleanupStep(function () {
});
phone.setXPath("h:telecom[@value and @value!='' and not(starts-with(@value, 'mailto:'))]");

var simplifiedCodeOID = shared.simplifiedCodeOID = function (oid) {
var r = component.define("SC " + oid);
r.fields([
["name", "0..1", "@displayName"],
["code", "1..1", "@code"],
]);
r.cleanupStep(cleanup.augmentSimplifiedCodeOID(oid));
return r;
};

shared.metaData = component.define("metaData")
.fields([
["identifiers", "0..*", "h:id", Identifier],
["confidentiality", '0..1', "h:confidentialityCode", simplifiedCodeOID("2.16.840.1.113883.5.25")],
["set_id", "0..1", "h:setId", Identifier]
]);

},{"./cleanup":40,"blue-button-xml":"blue-button-xml"}],42:[function(require,module,exports){
//CCDA to JSON parser.

Expand Down Expand Up @@ -6633,6 +6621,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 +20875,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

0 comments on commit 8e90dea

Please sign in to comment.