Node.js library
node-hl7-server
An MIT-licensed TypeScript HL7 listener for Node.js that accepts, parses and acknowledges HL7 v2 messages over MLLP, with node-hl7-client for sending.
MLLP
@cosyte/mllp is an MLLP client and server for Node.js: framing, acknowledgement correlation and reconnects, with zero runtime dependencies and one guarantee it will not trade away. A positive acknowledgement never goes out before your commit succeeds.
npm install @cosyte/mllpNeed it integrated? Talk to us.
The standard
@cosyte/mllp
The protocol stops at the frame. Everything that decides whether an interface survives a bad night is left to the integrator, so every integration ends up writing its own acknowledgement correlator and reconnect loop. This is that code, written once and tested.
import { createStarterClient, createStarterServer } from "@cosyte/mllp";
const committed: Buffer[] = [];
// Port 0: the OS picks a free port. The host defaults to loopback, 127.0.0.1.
const server = await createStarterServer({
port: 0,
onMessage: async (payload) => {
committed.push(payload); // your durable commit: a throw here answers AE, never AA
},
});
const client = await createStarterClient({ host: "127.0.0.1", port: server.getStats().port ?? 0 });
const ack = await client.send(
Buffer.from(
"MSH|^~\\&|SENDING_APP|SENDING_FAC|RECEIVING_APP|RECEIVING_FAC|20260101120000||ADT^A01|CTRL0001|P|2.5.1\r",
),
);
// Log the shape of the acknowledgement, never its field values.
const msa = ack
.toString("utf8")
.split("\r")
.find((segment) => segment.startsWith("MSA|"))
?.split("|");
console.log("acknowledgement code:", msa?.[1]);
console.log("MSA-2 echoes the control id sent:", msa?.[2] === "CTRL0001");
console.log("messages committed:", committed.length);
await client.close();
await server.close();From the @cosyte/mllp README on GitHub, verbatim. Every value in it is synthetic.
Limits
Its README names what is not built:
Alternatives
Each description comes from the project’s own documentation or npm listing, linked below.
Node.js library
An MIT-licensed TypeScript HL7 listener for Node.js that accepts, parses and acknowledges HL7 v2 messages over MLLP, with node-hl7-client for sending.
Java library
HAPI's Java implementation of the Minimal Lower Layer Protocol from Appendix C of the HL7 Implementation Guide.
Integration engine
NextGen Healthcare's integration engine, and one of the two engines @cosyte/mllp is checked against. From version 4.6 it ships under a single closed-source, proprietary license.
Platform agent
An application that runs inside your firewall and connects to devices over HL7/MLLP, ASTM and DICOM, as part of the Medplum platform.
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.