hl72json
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Parse HL7 message to JSON and stringify JSON to HL7 message


NOTE

  • This is module does not follow any standart for HL7 messages
  • Messages are considered to be valid as long as they can be parsed

  • No dependencies
  • Support for Typescript
  • Easy interface
  • Support for custom messages
  • Works on any Javascript runtime that supports ES5

Examples

import hl7 from "hl7-json";
const message = "MSH|^~\\&|LAB^LAB1|MYFAC|LAB|..."
const parsedMessage = hl7.parse(message);
hl7.stringify(parsedMessage) === message //true

Reading

parsedMessage[0][1][1] // LAB1

Setting

parsedMessage[0][1][1] =  {
    "0": "Let's",
    "1": "Try",
    "2": "Something",
    "3": "Cool",
    "4": "",
    "7": "BOOOM"
}
hl7.stringify(parsedMessage) //MSH|^~\&|LAB^Let's&Try&Something&Cool&&BOOOM|MYFAC|LAB...

Alt text Check example.json for a detailed example

Readme

Keywords

Package Sidebar

Install

npm i hl72json

Weekly Downloads

36

Version

1.0.0

License

MIT

Unpacked Size

251 kB

Total Files

12

Last publish

Collaborators

  • ditjonthaqi