Java library
HAPI HL7v2
An open-source, object-oriented HL7 2.x parser for Java; its site says JDK 11 or later is required. The natural choice when your service runs on the JVM. @cosyte/hl7 is for Node.js and TypeScript.
HL7 v2
@cosyte/hl7 reads the HL7 v2 messages real systems send, hands you the fields by name, and reports every deviation it tolerated as a warning with a stable code. MIT-licensed, with zero runtime dependencies.
npm install @cosyte/hl7Need it integrated? Talk to us.
The standard
@cosyte/hl7
It is for the developer who has to consume HL7 v2 traffic without becoming an HL7 expert first. msg.patient?.mrn and msg.meta.timestamp are the whole learning curve, and the positional tree is one accessor away when you need it.
import { parseHL7 } from "@cosyte/hl7";
// A synthetic ADT^A01 admit. HL7 v2 ends every segment with a carriage return.
const raw =
"MSH|^~\\&|EPIC|MAIN|LIS|REF|20260419101500||ADT^A01^ADT_A01|MSG00001|P|2.5\r" +
"EVN|A01|20260419101500\r" +
"PID|1||MRN12345^^^HOSP^MR||Doe^John^Q||19800115|M|||123 Main St^^Boston^MA^02101||^PRN^PH^^^617^5551212\r" +
"PV1|1|I|ICU^101^A^HOSP|||||ATTEND^Smith^Jane^^^^MD|||||||||||VISIT001\r";
const msg = parseHL7(raw);
console.log("Patient record number:", msg.patient?.mrn);
console.log("Full name:", msg.patient?.fullName);
console.log("Date of birth:", msg.patient?.dateOfBirth?.raw);
console.log("Precision:", msg.patient?.dateOfBirth?.precision);
console.log("Message type:", msg.meta.type);
console.log("Sent at:", msg.meta.timestamp?.raw);
console.log("Ward:", msg.visit?.location?.pointOfCare);From the @cosyte/hl7 README on GitHub, verbatim. Every value in it is synthetic.
Limits
Its README names what is out of scope. The short version:
Alternatives
Each description comes from the project’s own page or npm listing, linked below. Where we name a difference, you can check it there.
Java library
An open-source, object-oriented HL7 2.x parser for Java; its site says JDK 11 or later is required. The natural choice when your service runs on the JVM. @cosyte/hl7 is for Node.js and TypeScript.
Node.js library
An MIT-licensed Node.js client that sends HL7 messages to a server and can parse them; node-hl7-server is its receiving side. Transport and parsing come together there. We keep them apart, in @cosyte/mllp and @cosyte/hl7.
JavaScript library
An Apache-2.0 module for transforming, manipulating and creating HL7 messages, usable on its own or inside an engine such as Mirth. Its latest npm release dates from May 2022, and it ships no type declarations.
TypeScript SDK class
Medplum's TypeScript SDK includes an Hl7Message class that represents one message as a collection of segments.
Integration engine
NextGen Healthcare's integration engine. From version 4.6 it moved to a single closed-source, proprietary license, and the source code for new releases is no longer public. An engine is a server you configure; a library is code inside your own service.
Integration engine
Rhapsody describes Rhapsody Integration as its API-centric healthcare integration product, working across FHIR, HL7 and APIs.
Works with
It is free and MIT-licensed. If it saves you a day, a star on GitHub helps other engineers find it.
Need it integrated? Talk to us, or see what our integration services cover.