HAPI Conformance Classes System

User Manual

 

HAPI Home    Table of Contents

 

 

 


Introduction

 

“In order to reduce cost and improve the quality of heath care, computer-based information systems are being used more and more in health care.  However, there is no comprehensive information system that can completely cover all the needs of hospitals and other areas of the health care system.  Therefore, it will be necessary to employ information systems from various suppliers.  These systems must be functionally coupled with each other for cooperative data processing:  communication must be possible.”

 

 --Kai U. Heitmann, Bernd Blobel and Joachim Dudeck

HL7:  Communication Standard in Medicine

Health Level 7

 

Health Level 7 (HL7) is an organization that develops standards in the health care field, particularly electronic messaging standards.  Accredited by the American National Standards Institute (ANSI), HL7 is coordinating an international project aimed at facilitating electronic data exchange within and among hospitals.  The goal is to design standards that will allow different clinical information systems to communicate with each other.  With these standards, the communication could occur within a single hospital or between hospitals, whether they are in the same city or on opposite sides of the globe.

 

For example, an electronic thermometer could take a patient’s temperature.  Using the HL7 standards, that information could be sent from the thermometer to a computer anywhere in the world, and that computer would understand.  Without HL7, the computers and devices may not be able to communicate.

 

For more information on HL7, visit www.hl7.org. 

 

Health Level 7 Application Programming Interface

 

There are several commercial and open-source programming libraries that implement the HL7 standards. 

 

HAPI (HL7 application programming interface) at http://hl7api.sourceforge.net is an open-source HL7 library for Java.   Its major features include the following:

 

·        Message parsing and encoding functionality for both standard HL7 encodings (ER7 and XML).

·        A library of 2.x message classes.  

·        Various message transport and handling functions.

·        Various forms of message validation, including enforcement of HL7 data type rules, and checking messages against conformance profiles (see below). 

Conformance

 

The HL7 standard defines hundreds of message formats, each of which is used to communicate information about a few specific types of events that occur in healthcare (for example, patient admission to hospital or a lab result recorded by a technician).  HL7 defines the structure of each message (including segments, fields, data types, maximum lengths) and the meaning of each part of the structure.  Message structures, and parts thereof, are re-used in many different situations in slightly different ways.  This means that the specifications for these are necessarily “loose” (many fields are optional, and field lengths are often longer than required) to accommodate a variety of uses.  Unfortunately this optionality leaves much room for interpretation when implementing an HL7 interface between two systems, making this process difficult, costly, and error-prone. 

 

HL7 introduced a conformance framework in HL7 2.5.  This framework presents a method for users of the standard to write a more detailed, less loose message specification, called a conformance profile.  A profile must be based on one of the standard HL7 message specifications, but it is much more specific, in that it tightly constrains the optionality of fields, length of data, constant values, and number of repetitions of segments in messages.  Profiles are written in XML.  This feature enables the comparison of multiple profiles (for example, to find a common profile that satisfies two systems) and the automatic validation of a message against a profile (as opposed to the manual checking against paper specifications that was common in the past).    HAPI provides a tool for message validation against profiles.   

 

This manual describes an advanced HAPI tool that compiles a profile into Java code.  A programmer can write an HL7 application against the resulting code, and use it to create HL7 messages.  The generated code ensures that the message conforms to the original profile, through compile-time type-checking and runtime Java exceptions.  

 

Message Profiles

 

In HL7, a message profile is a refinement of a standard HL7 message structure.  It is an XML document that defines additional constraints beyond the standard.  Such additional constraints are often needed to communicate with a specific clinical information system or product line.  The message profile does not contain any clinical data; if it did, it would be called a message and not a message profile.

 

HL7 message profiles have a hierarchical format.  At the top of the hierarchy is information about message structure.  A message can have one or more segments or segment groups.  Each segment can have one or more fields.  Each field can have one or more components.  Each component may or may not have sub-components.

 

 

 


HAPI Home    Table of Contents