{"_id":"@redoxengine/redox-hl7-v2","_rev":"57-b25670827bb3ef8fe5ad1b04b1591233","name":"@redoxengine/redox-hl7-v2","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@redoxengine/redox-hl7-v2","version":"1.0.0","keywords":["hl7","version","2","parser","generator","parse","generate"],"author":{"name":"Redox, Inc"},"license":"MIT","_id":"@redoxengine/redox-hl7-v2@1.0.0","maintainers":[{"name":"benwaugh","email":"ben@redoxengine.com"},{"name":"blake-redox","email":"blake@redoxengine.com"},{"name":"brandon-hedrick","email":"bhedrick.purdue@gmail.com"},{"name":"brandonredox","email":"b@redoxengine.com"},{"name":"chennen","email":"cthennen@gmail.com"},{"name":"clark.downum","email":"clark.downum@gmail.com"},{"name":"digimuzik","email":"benjamin@redoxengine.com"},{"name":"dindurthy","email":"dharma@redoxengine.com"},{"name":"doodles526","email":"josh.deare@clever.com"},{"name":"dperszyk","email":"dani.perszyk@gmail.com"},{"name":"foursigma","email":"sivabalan.manivannan@gmail.com"},{"name":"jasonmendes","email":"jason@honua.co"},{"name":"lookitscook","email":"matt@lookitscook.com"},{"name":"luketurner","email":"github@luketurner.org"},{"name":"nwhatt","email":"nick@redoxengine.com"},{"name":"rashauna","email":"rashauna@redoxengine.com"},{"name":"tcredox","email":"tc@redoxengine.com"},{"name":"tengbretson","email":"tanner@engbretson.us"},{"name":"tpolsinelli","email":"tim.polsinelli@redoxengine.com"}],"homepage":"https://github.com/RedoxEngine/redox-hl7-v2","bugs":{"url":"https://github.com/RedoxEngine/redox-hl7-v2/issues"},"dist":{"shasum":"b814af0ee992e570e3ab0a1078a2a11c258025b8","tarball":"https://registry.npmjs.org/@redoxengine/redox-hl7-v2/-/redox-hl7-v2-1.0.0.tgz","fileCount":3109,"integrity":"sha512-zTWO4sxFxf5Gq6NO3paY1el4pZN6NiQE6B0QR4gb7oQY0DfqsFXBdTuCQyOBltmVW6CXcXjAA++3JebuUYdXCA==","signatures":[{"sig":"MEUCIG1osqp3eB2gbCedhPRiGZ14DCqJzCDjObusvWurE+WPAiEAtRhbNJXwMCCCqOxwiGU5ZgKxa63XSygnzScMETRTHN8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1027522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjYwLCRA9TVsSAnZWagAACkMQAKQrg0rdq04Rep6pMuov\n82eR8Qiaqy7mlRifwacB69X4/b7DQw/t4c6vCg6YH21wfoSOpcJOo9vb74Q2\ng36WsB/SWxCWwPa4Clw6mdVUT/6ey8eZ+oEAWnsRwLnF0FMI5YGJdV+pQJZC\nDmFEk80rp56YoF5JhN/5yJXbw/4wzkeuNO6RIMEG0g383XDVkr2ZxzgCbDYr\ndKHjGGx5Axo2pDAYejp4H1mrDESVJB11PsWipBQvoOw6SzHdR0zo9UWkEV+k\n6eYyLKUGuN/xSmo7Z6CAW29tiiFZOKEj1rPxg6D54kTxZMYGaQpmCQ96p+XY\nsZz7jkrfnOZGnDpbJoJtbsHjRnmXSKBjwP/WZVrYvYY2D1w7RsiAMqWEYLiA\n9NZWni7Xkw2qUZHWN/qVSxgergqM3ptW49ykryooC4aefzgfy7AIjcyFnZzD\nIUkJ8LJvsOepQOSreOOIdaNcm4yUnRe9fH43GvwXIzBmUXNtq5NGvuo+I7GC\nrsgWosdkggJGJEozP6lDQ4ItMa2diDse99uYhRaZpJp+nrmhMb8BplT3JJYU\nf2O1ucCU3iAWfRwmQVHVJFCZmrp8mCAIskNL4lzuHhuRfc9OTx1v3woR3Axs\nrpNeLCnvyS540YVN67KTdeL/cvmuTs3ZpPZ1E36sibjhJ1jrUXl4PrHKvrVD\npfee\r\n=odnC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"80a300e90f65a586331fe2d828f56f6ded9aa3ee","scripts":{"test":"node_modules/istanbul/lib/cli.js cover _mocha -- test/unit/ -R spec && mocha test/integration -R spec"},"_npmUser":{"name":"nwhatt","email":"nick@redoxengine.com"},"deprecated":"moved to @redox-opensource/redox-hl7-v2","repository":{"url":"git+https://github.com/RedoxEngine/redox-hl7-v2.git","type":"git"},"_npmVersion":"5.6.0","description":"A parser for hl7 version 2 messages. Creates json from v2 messages, and creates v2 messages from json.","directories":{"test":"./node_modules/mocha/bin/mocha"},"_nodeVersion":"8.9.4","dependencies":{"async":"^1.2.1","lodash":"^4.17.5"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^3.0.0","mocha":"^2.2.5","sinon":"^1.15.3","istanbul":"^0.3.15","codecov.io":"^0.1.4","sinon-chai":"^2.8.0"},"_npmOperationalInternal":{"tmp":"tmp/redox-hl7-v2_1.0.0_1536003081424_0.5429603185678606","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@redoxengine/redox-hl7-v2","version":"1.0.1","keywords":["hl7","version","2","parser","generator","parse","generate"],"author":{"name":"Redox, Inc"},"license":"MIT","_id":"@redoxengine/redox-hl7-v2@1.0.1","maintainers":[{"name":"benwaugh","email":"ben@redoxengine.com"},{"name":"blake-redox","email":"blake@redoxengine.com"},{"name":"brandon-hedrick","email":"bhedrick.purdue@gmail.com"},{"name":"brandonredox","email":"b@redoxengine.com"},{"name":"chennen","email":"cthennen@gmail.com"},{"name":"clark.downum","email":"clark.downum@gmail.com"},{"name":"digimuzik","email":"benjamin@redoxengine.com"},{"name":"dindurthy","email":"dharma@redoxengine.com"},{"name":"doodles526","email":"josh.deare@clever.com"},{"name":"dperszyk","email":"dani.perszyk@gmail.com"},{"name":"foursigma","email":"sivabalan.manivannan@gmail.com"},{"name":"jasonmendes","email":"jason@honua.co"},{"name":"lookitscook","email":"matt@lookitscook.com"},{"name":"luketurner","email":"github@luketurner.org"},{"name":"nwhatt","email":"nick@redoxengine.com"},{"name":"rashauna","email":"rashauna@redoxengine.com"},{"name":"tcredox","email":"tc@redoxengine.com"},{"name":"tengbretson","email":"tanner@engbretson.us"},{"name":"tpolsinelli","email":"tim.polsinelli@redoxengine.com"}],"homepage":"https://github.com/RedoxEngine/redox-hl7-v2","bugs":{"url":"https://github.com/RedoxEngine/redox-hl7-v2/issues"},"dist":{"shasum":"172ce0edc41fd449b1b649f8dce47dab58cfb0a0","tarball":"https://registry.npmjs.org/@redoxengine/redox-hl7-v2/-/redox-hl7-v2-1.0.1.tgz","fileCount":3109,"integrity":"sha512-o6bgOpoK0J+NL6DF5Db8+2MIXgqPdHU6pBpWLjxiKuoCpq+dTFzaf3SJ0a/IExeGvzFaLNOnd8c5QAL7OdsQ5w==","signatures":[{"sig":"MEUCIQCjE7FQrt2+AV6B993oMJ78eNlGQAX13heZeEF+dwJgoQIgJQ9vg2862CH7OsXgBF0hId0XdvmoeVk7oCNnq1BwZE4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1027614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjZNmCRA9TVsSAnZWagAAflYP/AyA7KMEFY08GTQVZPQN\ndhZMVcI3r1BxITP09xQnrDYbSx/F8uhfydlJQtay8qlFCDv9GTFu9CjfFUAF\nSJBhXM8MBk8Tz7BvDJtgg8Lvx5wlehrixbgHFIyAHhGWCNuBT5sMqeclU4ZJ\nn+u5j3+f1lsHIl6UDPQyl3sgBtGPRGsHMFAtFt/S6br/X6F3KgHJAjpgvwLf\nphJvhrM4igg1snMLDT1eZbq/kwxjmgzax4T6WxAU4EwQbbQSBj6DRZkClPS6\nS1hKIjLLPUEentJrJ+0xSj1u1zsY7moh04rIeL4u3IZ9ChfSFNulXukwqGzm\nQhWfyDfYN4pMuwMVjAmWAP1U42Xr1RYbrjE/nifdCSf5LbXl305mL/Wk0PVv\nmollQbS3i478iFr5I51i1VrpBQ0iYk4uQoBHTG/CMT6ogSZ9QihpxCmH16DJ\nKwIqxbyiRnIfrADlE1j01IL6qEiHyD1TX5QUQ9tWrMywOxcfC93G/CqgrCwb\n4APnxSRjsLQz1e0dfMSlSN2GxgixRnN7kONdJoe+W2I9s1aVoq5Y/syME5JV\nJTGWa8yiRds7lQG0DO/kyiqE7bvOQlU6Ub1fooeF43f0MpichzUGTPvKip2y\n+cK8KFBl+BgHFD2KjSU1e/d3aTWeHhi+6GrFzDjv5M2z/oRTG1YTpWeDv5VE\nGkad\r\n=EC3Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"b4ec7cc51d111a7e56a60ee7bd4865352e3d0c33","scripts":{"test":"node_modules/istanbul/lib/cli.js cover _mocha -- test/unit/ -R spec && mocha test/integration -R spec"},"_npmUser":{"name":"nwhatt","email":"nick@redoxengine.com"},"deprecated":"moved to @redox-opensource/redox-hl7-v2","repository":{"url":"git+https://github.com/RedoxEngine/redox-hl7-v2.git","type":"git"},"_npmVersion":"5.6.0","description":"A parser for hl7 version 2 messages. Creates json from v2 messages, and creates v2 messages from json.","directories":{"test":"./node_modules/mocha/bin/mocha"},"_nodeVersion":"8.9.4","dependencies":{"async":"^1.2.1","lodash":"^4.17.5"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^3.0.0","mocha":"^2.2.5","sinon":"^1.15.3","istanbul":"^0.3.15","codecov.io":"^0.1.4","sinon-chai":"^2.8.0"},"_npmOperationalInternal":{"tmp":"tmp/redox-hl7-v2_1.0.1_1536004966274_0.25817041842429767","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-09-03T19:31:21.424Z","modified":"2026-09-30T14:44:23.366Z","1.0.0":"2018-09-03T19:31:22.568Z","1.0.1":"2018-09-03T20:02:46.531Z"},"bugs":{"url":"https://github.com/RedoxEngine/redox-hl7-v2/issues"},"author":{"name":"Redox, Inc"},"license":"MIT","homepage":"https://github.com/RedoxEngine/redox-hl7-v2","keywords":["hl7","version","2","parser","generator","parse","generate"],"repository":{"url":"git+https://github.com/RedoxEngine/redox-hl7-v2.git","type":"git"},"description":"A parser for hl7 version 2 messages. Creates json from v2 messages, and creates v2 messages from json.","maintainers":[{"email":"rashauna@redoxengine.com","name":"rashauna"},{"email":"nick@redoxengine.com","name":"nwhatt"},{"email":"blake@redoxengine.com","name":"blake-redox"},{"email":"dani.perszyk@gmail.com","name":"dperszyk"},{"email":"brett.carr@redoxengine.com","name":"brett.carr"},{"email":"bcwiniger@gmail.com","name":"bcwiniger"},{"email":"kat@redoxengine.com","name":"katjwinter"},{"email":"greg@redoxengine.com","name":"gregarndt_redox"},{"email":"kvogt0208@gmail.com","name":"kylevogt"},{"email":"networking@redoxengine.com","name":"redox_networking"},{"email":"mmcleod@redoxengine.com","name":"mmcleodredox"},{"email":"jteske@redoxengine.com","name":"jteske-redox"},{"email":"lt@redoxengine.com","name":"luketurner-redox"}],"readme":"# node-hl7-v2\nThis is [Redox's](https://www.redoxengine.com/?utm_source=github&utm_medium=githublink&utm_campaign=open%20source) battle-tested in-house HL7v2 parser/generator. \n\n# HL7 Version 2 (HL7v2) \n[HL7’s Version 2.x (V2) Messaging Standard](http://www.hl7.org/implement/standards/product_brief.cfm?product_id=185) \nis the most ubiquitous healthcare data exchange standard. This module converts HL7v2 messages to and from a JSON representation.\n\n# Usage \nThe parser/generator can be used to convert a wide range of HL7v2 messages from the delimited HL7v2 format to a schema-fied JSON version. \nWhen messages don't match the schema, the module supports a custom schema. See Custom Schemas below for more information. \n\n## Parser\n```\nconst rawData = `MSH|^~\\&|||...`;\nconst hl7v2 = require('node-hl7-v2');\nconst parser = new hl7v2.Parser();\nconst jsonData = parser.parse(rawData);\n```\n\n## Generator\n```\nconst ackJSON = {\n  \"MSH\": {\n    \"0\": \"MSH\",\n    \"1\": \"|\",\n    \"2\": \"^~\\\\&\",\n    \"3\": {\n      \"1\": \"CHERDABEE\"\n    },\n    \"5\": {\n      \"1\": \"REDOX\"\n    },\n    \"6\": {\n      \"1\": \"RDX\"\n    },\n    \"7\": {\n      \"1\": \"20150915004731\"\n    },\n    \"9\": {\n      \"1\": \"ACK\",\n      \"2\": \"S12\"\n    },\n    \"10\": \"20150915004731\",\n    \"11\": {\n      \"1\": \"T\"\n    },\n    \"12\": {\n      \"1\": \"2.3\"\n    }\n  },\n  \"MSA\": {\n    \"0\": \"MSA\",\n    \"1\": \"AA\",\n    \"2\": \"1\"\n  }\n};\n\nconst hl7v2 = require('node-hl7-v2');\nconst generator = new HL7v2.Generator();\nconst data = generator.write(ackJSON);\n//`MSH|^~\\\\&|CHERDABEE||REDOX|RDX|20150915004731||ACK^S12|20150915004731|T|2.3|||||||||\\rMSA|AA|1||||\\r`\n```\n\n# Understanding the HL7v2 schema\nOur approach to parsing/generating HL7 is schema-driven. The Schema is based on the HL7v2 specification. \nThe best way to understand it is through the schema folder: \n```\nschema/\n  index.js - entry point to access the schema\n  dataTypes/ - contains definitions for each \"Data Type\" in HL7v2 (See chapter 2A)\n  fields/ - contains a definition for each field. Each file is named <Segment>.<Field Number>\n  messages/ - contains the actual structure for each message definition, this file also contains \"Groups\"\n  segments/ - contains definitions of which fields are in a segment\n  structure/ - contains a map from HL7 message/event type to structure definition. \n``` \n## Basics\nThere are many events defined in HL7, but some share the same structure. For example ADT^A01 and ADT^A04 both have the same ADT^A01 structure. \n\nOnce the structure is identified the code looks at the corresponding schema in `schema/messages`. Each message definition is object where the properties are \"Segment Groups\". The Group with the same name as the message type is the root. So in `ORU_R01.json`, the `ORU_R01` property has exactly 1 required `MSH` segment, unlimited `SFT` segments, and a `PATIENT_RESULT` group. \n```\n{\n  ...\n  \"ORU_R01\": {\n    \"elements\": [\n      {\n        \"minOccurs\": \"1\",\n        \"maxOccurs\": \"1\",\n        \"segment\": \"MSH\"\n      },\n      {\n        \"minOccurs\": \"0\",\n        \"maxOccurs\": \"unbounded\",\n        \"segment\": \"SFT\"\n      },\n      {\n        \"minOccurs\": \"1\",\n        \"maxOccurs\": \"unbounded\",\n        \"group\": \"PATIENT_RESULT\"\n      },\n      {\n        \"minOccurs\": \"0\",\n        \"maxOccurs\": \"1\",\n        \"segment\": \"DSC\"\n      }\n    ]\n  }\n}\n```\n## Overriding the schema\nExisting HL7v2 implementations don't often respect rules about segment groups and segment order, so custom schemas can be used at will. Pass a JSON object to the constructor of either the parser or the generator to use a custom Schema. It will get merged with the existing schema. \n\nExamples of custom schemas can be found here: \n* [Adding a Z-segment](./custom_schema_examples/AddZSegment.md)\n\n\n\n# HL7 Trademark and IP Statement\nHL7® and HEALTH LEVEL SEVEN® are trademarks owned by Health Level Seven International. HL7® and HEALTH LEVEL SEVEN® are registered with the United States Patent and Trademark Office.\n","readmeFilename":"README.md"}