https://github.com/evanlucas/nodengine-hl7
HL7 parser for nodengine
https://github.com/evanlucas/nodengine-hl7
hl7 hl7-parser
Last synced: 6 months ago
JSON representation
HL7 parser for nodengine
- Host: GitHub
- URL: https://github.com/evanlucas/nodengine-hl7
- Owner: evanlucas
- License: mit
- Created: 2014-02-06T00:42:14.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T18:32:44.000Z (over 8 years ago)
- Last Synced: 2025-04-28T14:12:03.029Z (6 months ago)
- Topics: hl7, hl7-parser
- Language: JavaScript
- Homepage: https://evanlucas.github.io/nodengine-hl7/
- Size: 448 KB
- Stars: 24
- Watchers: 7
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nodengine-hl7
[](https://travis-ci.org/evanlucas/nodengine-hl7)
[](https://coveralls.io/github/evanlucas/nodengine-hl7?branch=master)A hl7 parser
## Installation
```sh
$ npm install --save nodengine-hl7
```or install globally for the CLI tool
```bash
$ npm install -g nodengine-hl7
$ ne-hl7 --help
ne-hl7 - a streaming parser for hl7 messagesusage: ne-hl7 [options]
options:
-h, --help show help and usage
-l, --loglevel set log level
-f, --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:
```bash
$ 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)