Giter Club home page Giter Club logo

nodengine-hl7's Introduction

nodengine-hl7

Build Status Coverage Status

A hl7 parser

Installation

$ npm install --save nodengine-hl7

or install globally for the CLI tool

$ npm install -g nodengine-hl7
$ ne-hl7 --help
ne-hl7 - a streaming parser for hl7 messages

    usage: ne-hl7 [options]

    options:

      -h, --help                  show help and usage
      -l, --loglevel <level>      set log level
      -f, --file <file>           parse file
      -s, --segments              only show segment types
      -c, --count                 print message count
      -j, --json                  output in json
      -v, --version               show version

Unit Tests

To run tests:

$ npm test

NOTE: All hl7 test fixtures are samples taken from various places on the internet

API

Parser

Constructor


Message

Constructor

Params
Name Type(s) Description
segments Array, Segment A single Segment or an array of Segments

Message.hasSegments()

Does this message have any segments?


Message.addSegment()

Adds the given segment to the message

Params
Name Type(s) Description
segment Segment The Segment to add to the message

Message.getHeader()

Gets the header Segment of the Message


Message.delimiters()

Gets the delimiters for the given message. These are taken from the MSH


Segment

Constructor


Segment.parse()

Parses data as a hl7 segment

Params
Name Type(s) Description
data Buffer, String The segment

utils.segmentIsHeader()

Is the given segment a header segment?

Params
Name Type(s) Description
segment Segment A Segment object

utils.segmentTypeIsHeader()

Is the given segment type a header segment?

Params
Name Type(s) Description
type String The segment type

License

MIT (See LICENSE for more info)

nodengine-hl7's People

Contributors

360disrupt avatar awinder avatar dave92082 avatar evanlucas avatar gnickm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodengine-hl7's Issues

Option to Allow Undefined Segments

Undefined segments cause the application to stop currently.

e.g.

else {
      /**
       * TODO Remove this and add a default segment parser
       * This is mainly in place so we can see what default
       * segments we are missing
       */
      var e = new Error('Invalid segment type: '+s)
      e.code = 'EINVSEGTYPE'
      e.raw = data
      if process.env.IGNORE_HL7_MISSING_SEGMENTS == true  
        console.error e
      else
        throw e
    }

Licensing

I don't see the project running under a special license here on Github, but I've seen that the segments are under copyright. On NPM it is under GNU license, with the restriciton to modify the code:
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. So I guess I can use this in a commercial project? Than I would also contribute to the project in JS.

Maybe a good idea to add that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.