{"_id":"@amida-tech/blue-button-generate","_rev":"2-7a8f8df1109242c184b563bbad1cf628","name":"@amida-tech/blue-button-generate","description":"Blue Button CCDA Generator.","dist-tags":{"latest":"1.5.10"},"versions":{"1.5.8":{"name":"@amida-tech/blue-button-generate","version":"1.5.8","keywords":["bluebutton","ccda"],"author":{"name":"Dmitry Kachaev","email":"dmitry@amida-tech.com"},"license":"Apache-2.0","_id":"@amida-tech/blue-button-generate@1.5.8","maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"contributors":[{"name":"Matthew McCall","email":"matt@amida-tech.com"},{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},{"name":"Matt Martz","email":"matt.martz@amida-tech.com"}],"homepage":"https://github.com/amida-tech/blue-button-generate","bugs":{"url":"https://github.com/amida-tech/blue-button-generate/issues"},"dist":{"shasum":"0a0fdee2b6e4dd6d2fe5b073dc0da178eb844381","tarball":"https://registry.npmjs.org/@amida-tech/blue-button-generate/-/blue-button-generate-1.5.8.tgz","fileCount":145,"integrity":"sha512-XM84dftsac700tOGHvqRScQy/NNqCvLWj2aKyKEwxxvWU3cYJV3aVZ6BZ4EOmJWcgNeny5vJubQu3WejxdLgnQ==","signatures":[{"sig":"MEYCIQCABcWjVT7h2NWcAwIYs0ey4tljFDE3oMB58qc2sexdSAIhAOEJ3eW1zQb/zd/XSma8sGIVIZru5OtH3YL9fiAis98C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5645565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1tYXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrr0A//a9HAfTMP2GDqLMi5VXekrTYB1F5JAg2suIKPhfxk9qkWpCYX\r\nk1yoeZegPHBnA9az2pZyUpepwbJ0Vo3E/mkn1lDegJ3U1nnDuSNVbys9lNr3\r\nGDKaMvG0BDairy82YRbakbf9lox6uMgnOiPQIDiJqeM15pfreFOuAp1V0bxR\r\nY93ibhGDeM8c4UkHaveGCDGSN82a/SgwBaRkPvVBNZOUzowePkyVL2M4fCUc\r\n8ncARwqY5C6j3HQO/8Y81oAM3ggBJ4z7MkYZvvpt/rl8aTeJszFI0w3Lc344\r\ndlHV4qeyTgN/MWEX6g+GoZKS4LPKeI7FGnjH8EZUF9ggYFNG0YO5dKBwBIHD\r\nT/kVaP/Yf2nrdeOCEgPuokYbfx85OroTr1GQ4bT0UB4n7hG1s/d+YueS58eE\r\nWtPScVuKwlA0VgV4uMNuwfUw72VfFWqJ3rp9znfqXgD/40/gkJ8tRGlE7CD1\r\nXrjie7DqjnzQ4R2Gs0+d5cnF1/H++sZ5wGT3G09GUe3cIOuNIiTrqh9cxbka\r\nl6LKMB5oN1tJbgaBc0CBvPWeJMIsWvhD0LOkg7sdTVqZW1GYuSwfwgQef6xv\r\ncg+qg5ub/ty9ARHrhN53Y1KPDm9GrIJhuCkCbY3sSblP+3OBHmX07ZqacXwd\r\njtvFsx5/GHgySkbi4tn26OElXu/qOkNKZa0=\r\n=oJv/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","browser":{"./lib/xmlutil.js":"./browser/lib/xmlutil.js"},"engines":{"node":">= 14.19.3"},"gitHead":"fdca6cfc6c203587a7df1720ac65f8b943807dda","scripts":{"test":"grunt"},"_npmUser":{"name":"manhydra","email":"marc.sylvestre@manhydra.com"},"repository":{"url":"git+https://github.com/amida-tech/blue-button-generate.git","type":"git"},"_npmVersion":"8.12.1","description":"Blue Button CCDA Generator.","directories":{"doc":"doc","lib":"lib"},"_nodeVersion":"16.14.2","dependencies":{"uuid":"^8.3.2","moment":"^2.29.4","libxmljs":"^0.19.10","@amida-tech/blue-button-meta":"^1.7.3","@amida-tech/blue-button-util":"^1.6.2"},"_hasShrinkwrap":false,"devDependencies":{"brfs":"^2.0.2","jest":"^27.5.1","grunt":"^1.5.3","xml2js":"^0.4.23","grunt-run":"^0.8.1","grunt-coveralls":"^2.0.0","grunt-jsbeautifier":"^0.2.13","grunt-contrib-watch":"^1.1.0","grunt-contrib-jshint":"^3.2.0","grunt-express-server":"^0.5.4","grunt-contrib-connect":"^3.0.0","@amida-tech/blue-button":"^1.10.7"},"_npmOperationalInternal":{"tmp":"tmp/blue-button-generate_1.5.8_1658246679263_0.26200974371905383","host":"s3://npm-registry-packages"}},"1.5.9":{"name":"@amida-tech/blue-button-generate","version":"1.5.9","keywords":["bluebutton","ccda"],"author":{"name":"Dmitry Kachaev","email":"dmitry@amida-tech.com"},"license":"Apache-2.0","_id":"@amida-tech/blue-button-generate@1.5.9","maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"contributors":[{"name":"Matthew McCall","email":"matt@amida-tech.com"},{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},{"name":"Matt Martz","email":"matt.martz@amida-tech.com"}],"homepage":"https://github.com/amida-tech/blue-button-generate","bugs":{"url":"https://github.com/amida-tech/blue-button-generate/issues"},"dist":{"shasum":"b7d1ef1d24fd560d6b8de976f980b3392103704d","tarball":"https://registry.npmjs.org/@amida-tech/blue-button-generate/-/blue-button-generate-1.5.9.tgz","fileCount":145,"integrity":"sha512-emyLdhzuRbbLVU62ps2HKjOOuncO45C/e0zgPdObNI2Rtae8AIr+n4G03w7zE5UYno2QNzQjjTrWci5ybBme5A==","signatures":[{"sig":"MEUCIH44KQm/qmXWkMPq2Ll9vavIIVmmo6itRyEAhe3rzruLAiEAn6bS8L4Hb1xL1U7fwhBU67zGpAqPQKpcJ15TtaHxWQM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5645565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6ZBKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6qQ//ehQ8gYlzSkN4Qw8VjAsLguoodcvqP8XEyO4IN8kSai0z+cE6\r\nUQDAIoL1Xa5Pk99drQZ/VpEO8Uug43M69XMq5jkOT0EpzUQ63LRepi5oa7ZP\r\n6eIOzxVdmFAsH2Ij/QTrfFO3QUkimKL9gSZyzQQRQ13X5GtF09ULUsN9RSeI\r\nr+Sx/Wb548TnujFhra9wCd7RHVDNdzGyL4HZ0wZ/BJFrn659xoVhS5yt/61e\r\nXONdHjdyhBTPHhPOyeUzoLWixrcNVxQLMH8Wm0BfMrzOm7beZW6baLkUxCxz\r\nX5bN70kkMsXCpbNHZObP6+vX3FCo8osMlZyd0NGAbWWZjHGL22AE46Z7aGZa\r\nLhWk3GCPL5vRSzteuYfPnwNF55aGxFyEoMxG7gRsKFKg8m3RWAEJG3LQmlql\r\nlIbFImfFJg/WUA8Nk6cMP7ILlaGmKOJxwMohBC7JqbgOeAerWYt6ScPG6iqS\r\ncMeizFXoVWrFkFcpOmfHXtrfkRRWYJbd1X/qj8Yyq2yc86pisdQnF7oRyo9H\r\nAnN0HeXPdbeM9dHkqdhXvo1aIbpY22hHT5iDaYis+cnhFmOV7W34TO9WjYL9\r\nAbRFprUBKiAXxrXMFRbIAQEvBRCAp69HofuFKsHIaucInkF3FPMnDQyzgLQP\r\nMFkh4wP5rF/774IgdQAbplmy7Ks8utYplYo=\r\n=/1Gh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","browser":{"./lib/xmlutil.js":"./browser/lib/xmlutil.js"},"engines":{"node":">= 14.19.3"},"gitHead":"3c38898993deebefe62b9d1c677b07ef774e718f","scripts":{"test":"grunt"},"_npmUser":{"name":"manhydra","email":"marc.sylvestre@manhydra.com"},"repository":{"url":"git+https://github.com/amida-tech/blue-button-generate.git","type":"git"},"_npmVersion":"8.12.1","description":"Blue Button CCDA Generator.","directories":{"doc":"doc","lib":"lib"},"_nodeVersion":"16.14.2","dependencies":{"uuid":"^8.3.2","moment":"^2.29.4","libxmljs":"^0.19.10","@amida-tech/blue-button-meta":"^1.7.3","@amida-tech/blue-button-util":"^1.6.3"},"_hasShrinkwrap":false,"devDependencies":{"brfs":"^2.0.2","jest":"^27.5.1","grunt":"^1.5.3","xml2js":"^0.4.23","grunt-run":"^0.8.1","grunt-coveralls":"^2.0.0","grunt-jsbeautifier":"^0.2.13","grunt-contrib-watch":"^1.1.0","grunt-contrib-jshint":"^3.2.0","grunt-express-server":"^0.5.4","grunt-contrib-connect":"^3.0.0","@amida-tech/blue-button":"^1.10.8"},"_npmOperationalInternal":{"tmp":"tmp/blue-button-generate_1.5.9_1659473994310_0.8082236422112177","host":"s3://npm-registry-packages"}},"1.5.10":{"name":"@amida-tech/blue-button-generate","version":"1.5.10","description":"Blue Button CCDA Generator.","main":"./index.js","browser":{"./lib/xmlutil.js":"./browser/lib/xmlutil.js"},"directories":{"doc":"doc","lib":"lib"},"scripts":{"test":"grunt test","coverage":"grunt coverage"},"author":{"name":"Dmitry Kachaev","email":"dmitry@amida-tech.com"},"contributors":[{"name":"Matthew McCall","email":"matt@amida-tech.com"},{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},{"name":"Matt Martz","email":"matt.martz@amida-tech.com"}],"license":"Apache-2.0","engines":{"node":">= 14.19.3"},"dependencies":{"@amida-tech/blue-button-meta":"^1.7.5","@amida-tech/blue-button-util":"^1.6.5","libxmljs":"^1.0.11","lodash":"^4.17.21","moment":"^2.30.1","uuid":"^10.0.0"},"devDependencies":{"@amida-tech/blue-button":"^1.10.11","brfs":"^2.0.2","grunt":"^1.6.1","grunt-contrib-connect":"^4.0.0","grunt-contrib-jshint":"^3.2.0","grunt-contrib-watch":"^1.1.0","grunt-coveralls":"^2.0.0","grunt-express-server":"^0.5.4","grunt-jsbeautifier":"^0.2.13","grunt-run":"^0.8.1","jest":"^29.7.0","xml2js":"^0.6.2"},"repository":{"type":"git","url":"git+https://github.com/amida-tech/blue-button-generate.git"},"keywords":["bluebutton","ccda"],"bugs":{"url":"https://github.com/amida-tech/blue-button-generate/issues"},"homepage":"https://github.com/amida-tech/blue-button-generate","_id":"@amida-tech/blue-button-generate@1.5.10","gitHead":"0afe5ef0a73ea9fd5e0937f4af460dc6e9bc0258","_nodeVersion":"18.20.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-xsWBiy1PHRY9YfGzHT9GYGltsPGeWj4bLoTrUK6lIxgNrsJXv1ANQsfqjlo9gbZPN/RGJgiLfZQCDmy7ZRsaJQ==","shasum":"7f54988e3ca704d1559c4f442ab1f594a49d39d6","tarball":"https://registry.npmjs.org/@amida-tech/blue-button-generate/-/blue-button-generate-1.5.10.tgz","fileCount":147,"unpackedSize":5681608,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEFjTHCu/9gocfZC+6Mk+stvF4EwhxCaLbchjWJ8baqTAiEA/UV26QEb22pp+3z3BUMuLLXCzSGs1HPiHrEm+4BUH0E="}]},"_npmUser":{"name":"manhydra","email":"marc.sylvestre@manhydra.com"},"maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/blue-button-generate_1.5.10_1718376358812_0.13927786432656108"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-19T16:04:39.205Z","modified":"2024-06-14T14:45:59.227Z","1.5.8":"2022-07-19T16:04:39.507Z","1.5.9":"2022-08-02T20:59:54.556Z","1.5.10":"2024-06-14T14:45:59.051Z"},"maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"author":{"name":"Dmitry Kachaev","email":"dmitry@amida-tech.com"},"repository":{"type":"git","url":"git+https://github.com/amida-tech/blue-button-generate.git"},"keywords":["bluebutton","ccda"],"license":"Apache-2.0","homepage":"https://github.com/amida-tech/blue-button-generate","bugs":{"url":"https://github.com/amida-tech/blue-button-generate/issues"},"readme":"Blue Button Generate\n====================\n\nBlue Button CCDA Generator\n\n[![NPM](https://nodei.co/npm/@amida-tech/blue-button-generate.png)](https://nodei.co/npm/@amida-tech/blue-button-generate/)\n\nblue-button-generate is a module to generate CCDA files from JSON data.  Currently it only supports [blue-button](https://github.com/amida-tech/blue-button) JSON data model.\n\n## Usage\n\n``` javascript\nvar fs = require('fs');\nvar bb = require('@amida-tech/blue-button');\nvar bbg = require('@amida-tech/blue-button-generate');\n\nvar xmlString = fs.readFileSync('test/fixtures/files/ccda_xml/CCD_1.xml', 'utf-8');\nvar record = bb.parseString(xmlString);\n\n// ...\n// changes to record\n// ...\n\n// get back xml as text\nvar updatedXmlString = bbg.generateCCD(record);\n\n```\n\n## Implementation\n\nblue-button-generate uses javascript template objects for implementation.  Each template in CCDA is represented with an object. As an example Reaction Observation object is shown\n``` javascript\nvar reactionObservation = exports.reactionObservation = {\n    key: \"observation\",\n    attributes: {\n        \"classCode\": \"OBS\",\n        \"moodCode\": \"EVN\"\n    },\n    content: [\n        fieldLevel.templateId(\"2.16.840.1.113883.10.20.22.4.9\"),\n        fieldLevel.id,\n        fieldLevel.nullFlavor(\"code\"),\n        fieldLevel.text(leafLevel.sameReference(\"reaction\")),\n        fieldLevel.statusCodeCompleted,\n        fieldLevel.effectiveTime, {\n            key: \"value\",\n            attributes: [\n                leafLevel.typeCD,\n                leafLevel.code\n            ],\n            dataKey: 'reaction',\n            existsWhen: condition.codeOrDisplayname,\n            required: true\n        }, {\n            key: \"entryRelationship\",\n            attributes: {\n                \"typeCode\": \"SUBJ\",\n                \"inversionInd\": \"true\"\n            },\n            content: severityObservation,\n            existsWhen: condition.keyExists('severity')\n        }\n    ]\n};\n```\n\nThis template is internally used with a call\n```  javascript\njs2xml.update(xmlDoc, input, context, reactionObservation);\n```\nwhere `xmlDoc` is the parent xml document (Allergy Intolerance Observation) and `input` is the immediate parent of [bluebutton.js](https://github.com/blue-button/bluebutton.js) object that describes Reaction Observation.  `context` is internally used for indices in text references.\n\n### Motivation\n\nThis approach is an alternative to direct programming or text based templates such as in [bluebutton.js](https://github.com/blue-button/bluebutton.js) and is motivated by the following\n* Each template directly follows the actual specification.  One can easily match each node in the template to the actual statements in the specification.\n* Individual templates can be tested independently without any additional flags or programming.\n* Required elements are specified in the template and get `nullFlavor` automatically when no data exists.\n* No coding required to add new templates.\n* It is also a step in the right direction for the possible future directions\n * Factoring out data model dependencies so that blue-button](https://github.com/amida-tech/blue-button) data model changes or other data models can be accomodated more easily\n * Automatic generation of templates from [blue-button](https://github.com/amida-tech/blue-button) like CCDA parsers.\n\n### Template Structure\n\nThe following are the properties of the templates\n* `key`: This is the name for the xml element.\n* `attributes`: This describes the attributes of the element.  `attributes` can be an object of with `key` and `value` pairs for each attribute or it can be an array of such objects.  Each attribute object or can be a function with `input` argument that returns attributes.\n* `text`: This is a function with `input` attribute that returns text value of the element.\n* `content`: This is an array of other templates that describe the children of the element.  For a single child an object can be used.\n* `dataKey`: This is the property of `input` that serves as the data for the template.\n* `required`: This identifies if template is required or not.  If template is required and there is not value in the `input` a `nullFlavor` node is created.\n* `dataTransform`: This is a function to transform the input.\n* `existWhen`: This is a boolean function with `input` argument to describe it the elements should exists or not.\n","readmeFilename":"README.md","contributors":[{"name":"Matthew McCall","email":"matt@amida-tech.com"},{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},{"name":"Matt Martz","email":"matt.martz@amida-tech.com"}]}