Light HL7 Library


Please visit the new online forums if you have questions or issues with the Light HL7 Library. I personally check the boards at least once a day. Click here: Enter the support forums


Please see the latest javadoc here or view below for some sample code.


The Light HL7 Library let’s you simply parse, modify and create HL7-like messages in Java. Recent improvements have added much better facilities to create empty messages for you to populate with data as you see fit. Modifying existing messages is more robust now, with the ability to insert new segments, and improved reliability when updating fields and rebuilding the record object.

Currently there is work in progress to deal with address messages containing complex nested segment groups, such as result messages with multiple ORUs and multiple OBXs per ORU. Right now there is no way to easily tell if a given segment is a child of a particular other segment or not.

C# (.NET) Version

Mad genius (or is it mad-man?) Ron Sweeney let me know that he’s using the Light HL7 Library with .NET using a util called IKVM. Check out his post here, and thanks Ron, sorry it takes me so bloody long to update this site.

Some Sample Code

The best sample code of how to use the library is in the JUnit test class in the source code. It is presented here as well for your convenience: TestHl7Util.html or the latest version is always in SVN here.


Light HL7 Library is available under the terms of the LGPL. It is possible that the license is going to move to an APL 2.0 style license in the near future to accommodate the inclusion of some useful Apache XML/XSLT code.


Old sample code…

Temporarily removed because some wordpress or mysql update broke the sample. You can look here in the meantime.

One Comment

  1. […] Mike, who works at Cleveland Clinic, has released the Light HL7 Library for Java. Here’s how he describes it: The Light HL7 Library let’s you simply parse, modify and create HL7-like messages in Java. This is the same parsing library used by the HL7 Browser and HL7 Comm, and internally at CCF, so it has literally parsed millions and millions of records. Cat:  […]