// the find
jcomellas/hl7parser
HL7 parser with segment code generators in C
A C library for parsing HL7 v2.x messages, designed for memory-constrained environments like embedded medical hardware. It offers both a SAX-style callback parser and a DOM-style parser, with typed segment accessors generated from an XML schema via a Python script. Aimed at C developers doing healthcare integration work where malloc is expensive or forbidden.
Zero-allocation design is taken seriously — the parser works in-place on the message buffer, which is exactly right for RTOS or bare-metal medical device firmware. The SAX/DOM split is a good design choice: callback mode for streaming/low-memory, tree mode when you need random access. Code generation from hl7segdef.xml means segment definitions stay in one place and accessors are consistent. Having a dedicated lexer layer separate from the parser is architecturally sound for a protocol with HL7's encoding rules.
Dead since December 2013 — over a decade of zero commits, which matters because HL7 v2.x has continued publishing errata and new segment definitions. Requires qmake (Qt4) as a build dependency for a pure C library with no Qt usage, which is an odd and annoying choice that will break on modern systems without extra effort. No CMake or Meson support means integrating this into any modern project is friction. Coverage is partial — the TODO file presumably contains the gaps, and with only 20-odd segments in the tree, you'll hit a missing segment quickly in real healthcare data.