HL7Forge

License: MIT

A private, in-browser HL7 v2 message viewer. Paste a message, open a file, or drop one in, and HL7Forge breaks it down into segments, fields, repetitions, components, and sub-components. Every value is labelled with its field name and data type, coded values are decoded (F → Female, AE → Application Error), and timestamps are shown in a readable form.

It’s built for the people who read HL7 all day: interface analysts, integration engineers, and support staff tracing a bad ADT or a missing lab result. It’s also built for the data inside those messages. HL7Forge runs entirely in your browser tab, with no server, no build step, and no dependencies. A strict Content-Security-Policy blocks every network request, so patient data never leaves your computer.

Try it in your browser →, or download the repository and open src/index.html.

Highlights

Privacy: messages never leave this computer

All parsing happens in your browser tab. HL7Forge has no server, no backend, no analytics, and no third-party resources (no CDNs, no web fonts). The browser enforces this:

Saved messages are session-only

Save (Ctrl+S) keeps the current message in a “Saved this session” list so you can switch between messages. The list exists only in the tab’s memory:

sessionStorage was deliberately not used: Chromium browsers write it to disk unencrypted and restore it when a closed tab is reopened.

Limits outside the app’s control

Running

No build step and no dependencies. Open src/index.html directly in Chrome, Edge, or Firefox (double-click it, or drag it into a browser window).

If you host it on an internal web server, also send the same Content-Security-Policy as an HTTP response header, with frame-ancestors 'none' added (a <meta> policy can’t set it, and it stops other sites from framing the page). Also send X-Content-Type-Options: nosniff and Referrer-Policy: no-referrer.

Features

Project layout

src/index.html               Page shell and Content-Security-Policy
src/css/styles.css           Styles (system fonts only)
src/js/hl7-parser.js         Parser: pure functions, no I/O
src/js/hl7-definitions.js    Segment/field/data type names and code tables (v2.5.1)
src/js/samples.js            Fictional sample messages
src/js/theme-init.js         Applies the saved theme before first paint
src/js/app.js                UI rendering and interaction
tests/parser.test.js         Parser tests
LICENSE                      MIT License

Tests

node --test tests/parser.test.js

The parser can also be used from Node:

const { parse, getValue, locate, tokenize } = require('./src/js/hl7-parser.js');
const msg = parse(text).messages[0];
getValue(msg, 'PID-5.1');     // family name
getValue(msg, 'PID-3(2).1');  // 2nd repetition of PID-3, component 1
getValue(msg, 'OBX[3]-5');    // 3rd OBX segment, field 5
locate(text, 120).path;       // e.g. 'PID-5.2' — what is at character offset 120
tokenize(text);               // lossless syntax-highlighting tokens

License

HL7Forge is released under the MIT License. Copyright © 2026 Nathan Bommersbach.

HL7® is a registered trademark of Health Level Seven International. HL7Forge is an independent project and is not affiliated with or endorsed by HL7 International.