Skip to content

rethinkhealth/hl7v2

Repository files navigation

HL7v2 client

NPM Version NPM License NPM Downloads

@rethinkhealth/HL7v2 is a library for parsing, validating, and mapping HL7v2 messages. It is built on top of the HL7v2 standard.

Features

  • Typescript-compatible.
  • Built on top of the HL7v2 standard.
  • Supports all HL7v2 versions >= 2.5.1.
  • Provides robust schema validation using Json Schema.
  • Provides a simple API for parsing, validating, and mapping HL7v2 messages.

What is HL7v2

HL7V2 is a standard for exchanging health information between systems. It is a text-based format that is human readable and machine parsable. HL7v2 is a standard that is used by many healthcare systems and is the standard for exchanging health information between systems.

For more detailed information about how to use @rethinkhealth/hl7v2, please refer to our documentation.

We also provide a playground where you can try out @rethinkhealth/hl7v2 and see it in action. Visit our playground to start experimenting.

Getting Started

To get started, install the package using npm, yarn, or pnpm:

npm install @rethinkhealth/hl7v2

Usage

Parsing

To parse an HL7v2 message, use the toJson function:

import { Message } from '@rethinkhealth/hl7v2';

const message = new Message('MSH|^~\&|...');

console.log(message.toJson());

Validation

To validate an HL7v2 message, use the validate function:

import { Message } from '@rethinkhealth/hl7v2';

const message = new Message('MSH|^~\&|...');

console.log(message.validate());

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

Code of Conduct

To ensure a welcoming and positive environment, we have a Code of Conduct that all contributors and participants are expected to adhere to.

COPYRIGHT AND LICENSE

Copyright 2023 Rethink Health, SUARL. All rights reserved. This program is licensed to you under the terms of the MIT License. This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for details.

HL7 Trademark

HL7® 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.