# L7

> An HL7 query language and message manipulator.

Latest version **0.2.3** (published 2018-10-01) · 0 weekly downloads

## Install

```sh
npm install L7
pnpm add L7
yarn add L7
bun add L7
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2018-10-01 |
| First published | 2012-05-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 54.9 KB |
| Known vulnerabilities | 0 (+5 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 40 |
| Maintainers | abbyad, alxndrsn, garethbowen, hgalemayehu, scdf, twd, vimemo |
| Keywords | hl7, query, server |

## Links

- npm: https://www.npmjs.com/package/L7
- Repository: https://github.com/medic/L7
- Homepage: https://github.com/medic/L7#readme
- Issues: https://github.com/medic/L7/issues
- npm.io page: https://npm.io/package/L7

## Dependencies (4)

- [pegjs](https://npm.io/package/pegjs.md) ~0.7.0
- [moment](https://npm.io/package/moment.md) ~2.22.2
- [underscore](https://npm.io/package/underscore.md) ~1.4.4
- [underscore.string](https://npm.io/package/underscore.string.md) ~2.3.1

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2018-10-01
- 0.2.2 — 2013-07-23
- 0.2.1 — 2013-07-18
- 0.1.5 — 2013-05-17
- 0.1.4 — 2013-05-17
- 0.1.3 — 2013-05-17
- 0.1.2 — 2013-05-17
- 0.1.1 — 2013-05-17
- 0.0.10 — 2013-05-13
- 0.0.9 — 2012-08-23
- 0.0.8 — 2012-08-22
- 0.0.7 — 2012-08-16
- 0.0.6 — 2012-08-16
- 0.0.5 — 2012-08-16
- 0.0.4 — 2012-05-31
- … 2 more at https://npm.io/package/L7/versions

## README

L7 [![Build Status](https://travis-ci.org/medic/L7.svg?branch=master)](https://travis-ci.org/medic/L7)
======

A simple HL7 query language and message manipulator.

Usage
----

Given HL7:

    MSH|^~\&|REG|XYZ||XYZ|20050912110538||SIU^S12|4676115|P|2.3
    PID|||353966||SMITH^JOHN^^^^||19820707|F||C|108 MAIN STREET ^^ANYTOWN^TX^77777^^|HARV|(512)555-0170|||||00362103|123-45-6789||||||||||||
    SCH|1||||||NEW||||20050912110230^20050912110430||||||||||||||||||^^^^^^||3|
    PV1||O|SEROT|3|||1284^JOHNSON^MIKE^S.^^MD~|||SEROT||||1|||1284^JOHNSON^MIKE^S.^^ MD|SERIES|787672|B|||||||||N||||||||||||A|||20050912110230|||||| PV2|||HAND BRACE NEEDS REPAIRED|||||||||||20050912||||||||||A||20050725|||||O||||||
    NK1|0001|HULK^INCREDIBLE|M|123 FAKE ST^^OUTLAND^^00000|123456789||
    NK1|0002|HULK^DEBATEABLE|M|122 FAKE ST^^OUTLAND^^00000|123456789||

And the javascript:

    parser = require('L7')

    message = parser.parse(hl7)
    version = message.query('MSH|12') // 2.3
    kinAddresses = message.query('NK1[4]') // ['123 FAKE ST^^OUTLAND^^00000', '122 FAKE ST^^OUTLAND^^00000']
    kinStreets = message.query('NK1|4[0]') // ['123 FAKE ST', '122 FAKE ST']

    name = message.translate({
      familyName: 'PID|5^0',
      firstName: 'PID|5^1'
    }) // { "familyName": "McTest", "firstName": "Test" }

    message.toString() // returns original message
    message.replace('PID|5', 'McFake', 'Firstname'); // replaces the values in the message with the supplied ones
    message.replace('PID|11^0', '123 Fake Street'); // can replace just one element

    message.remove('PV1'); // removes the PV1 segment if it exists
    message.remove('IN1', 'IN2'); // removes the IN1 and IN2 segments if they exists
    message.remove('Z*'); // remove all "Z" segements

Installation
------------

    $ npm install L7

Caveat
------

This package is in its infancy, use with caution.

---
_Source: https://npm.io/package/L7 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
