This is the home page for the HAPI project. HAPI (HL7 application programming interface; pronounced "happy") is an open-source, object-oriented HL7 2.x parser for Java. HL7 ( http://hl7.org ) is a messaging specification for healthcare information systems. This project is not affiliated with the HL7 organization; we are just writing some software that conforms to their specification. The project was initiated by University Health Network (a large multi-site teaching hospital in Toronto, Canada).

HL7 v2 Java API

A full featured Java API you can use to add HL7 capabilities to your applications.
  • Use HAPI: Check out HAPI by example or the JavaDocs to learn how to use HAPI in your application.
  • Get Help: Subscribe or browse our mailing list to ask questions and find answers.
  • Help improve HAPI: Report an issue, submit an idea, or get started developing new features here .


HAPI has now introduced an API for developing applications based on the emerging HL7 FHIR specification. See the HAPI FHIR site to learn more.

HAPI TestPanel

A rich testing application which can be used to edit HL7 messages, transmit them, validate them, and more. TestPanel Screenshot

HAPI HL7v2 2.3 Released - Jun 23, 2017

A new version of HAPI HL7v2 has been released! This new version includes a number of bugfixes, as well as new message structures for the following versions of HL7: v2.7, v2.8, and v2.8.1.

In addition, we have changed the TestPanel distribution so that it is now distributed as a simple executable JAR with some scripts to start it.

I want to thank everyone who has been waiting for this release for their patience. I have stated on the mailing list quite a few times over the last few years that a new release was imminent, and it never materialized. The basic explanation for this is that building a new release has become quite a laborious process that requires quite a lot of hand-holding.

A bit of insight into the HAPI HL7v2 build process: The basic trouble is that building the structures is only possible on a Windows XP system because of the way it works. Essentially the build requires an ODBC driver for an Access MDB file (this is how the HL7 databases are distributed) and this driver was discontinued after Windows XP. Unfortunately the Javac compiler is unwilling to compile the large number of files that make up a structure JAR on Windows XP, so the process now involves building structures on XP, then copying them into a build on Linux and compiling. This whole thing really needs refactoring, but this would be a huge project and isn't something we have capacity to take on at this point.

As an additional note, we have now migrated the project from Sourceforge over to GitHub: https://github.com/hapifhir/hapi-hl7v2. The new project website can be found at: https://hapifhir.github.io/hapi-hl7v2. As a side note, we are now going to refer to this project as "HAPI HL7v2" and the FHIR version of HAPI as "HAPI FHIR". Hopefully this will remove some confusion, as these are completely separate libraries with separate release cycles.

Thanks to everyone who contributed to this release. As always, check the the Changelog for details about what's new.

- James Agnew

HAPI 2.2 Released - March 4, 2014

A new release of HAPI (Core library, HL7 over HTTP, and Structures) has been uploaded to Sourceforge and the central Maven repo.

This new release is packed with new features. Read about them in the Changelog. There are also a number of upgrades to the base API.

- James Agnew