A lightweight Python package to intuitively handle HL7 v2 messages


A lightweight Python package to intuitively handle HL7 v2 messages



HL7 v2 is used worldwide to solve interoperability problems among clinical systems. It is still the reference version of the IHE (Integrating Healthcare Enterprise) consortium. The increasing diffusion of the HL7 v2 standard has spurred the development of several software libraries aimed at simplifying raw messages management. The diffusion of the Python programming language has been increasing over the years, particularly in the scientific domain. The reasons for this popularity may be attributable to the language being relatively easy to learn and offering high programmer productivity.


HL7apy is a lightweight Python package to intuitively handle HL7 v2 messages according to HL7 specifications. The library offers means to create, parse, navigate and validate messages. The main features includes:

  • message parsing;
  • message creation;
  • message validation following the HL7 xsd specifications;
  • access to elements by name, long name or position;
  • support to all simple and complex data types;
  • encoding chars customization;
  • message encoding in ER7 format and compliant with MLLP protocol.

Currently supported HL7 versions are: 2.2, 2.3, 2.3.1, 2.4, 2.5, 2.5.1, 2.6, 2.7, 2.8, 2.8.1, 2.8.2

Innovative features

  • use of Python.

Potential users

Researchers and developers

Impact sectors

Health - ICT

Other resources

  1. https://github.com/crs4/hl7apy
  2. V. Meloni, A. Sulis, D. Ghironi, F. Cabras, M. Del Rio, S. L. Monni, M. Gaggero, F. Frexia, G. Zanetti, HL7apy: a Python library to parse, create and handle HL7 v2.x messages. EJBI - European Journal for Biomedical Informatics EuroMISE s.r.o. pages en31-en40 vol. 11 num. 2 - january 2015. issn: 1801 - 5603.

Questo sito utilizza cookie tecnici e assimilati. Possono essere presenti anche cookie profilazione di terze parti. Se vuoi saperne di piĆ¹ o negare il consenso a tutti o ad alcuni cookie leggi l'informativa completa. Proseguendo nella navigazione (anche con il semplice scrolling) acconsenti all'uso dei cookie. This site uses technical and anonymized analytics cookies only. There may also be profiling third-party cookies. Please read the cookie information page to learn more about how we use cookies or blocking them. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.