Rhapsody site logo

HL7 resources

HL7 Batch File Protocol

Optimize resource productivity with the most trusted and flexible HL7 and API integration tools in the market

HL7 batch files allow one or more messages to be sent in a single file, using specialized segments in a structure that mirrors HL7 defined message types. These segments include the batch header segment (BHS), batch trailer segment (BTS), file header segment (FHS) and file trailer segment (FTS). HL7 batching is useful for systems that are not connected via real-time transmission protocols (such as those systems that do not transmit via TCP/IP connections).

The HL7 Standard specifies the following format for batch files:

[FHS] (file header)
{ [BHS] (batch header)
{ [MSH (HL7 messages)
] }
[BTS] (batch trailer)
[FTS] (file trailer)

HL7 batch files usually consist of only one type of message (i.e. ADTORMORU, etc.), but there are no rules in the standard restricting the batch to only one message type. The batch file’s headers and trailers are important because they include a field that supplies a count of messages expected within the batch. Therefore conformance checking can be done with an HL7 batch file, whereas it cannot be done in the same way with a batch file only containing HL7 messages and no other information.

Batch files using HL7 batch protocol are not widely implemented because of the challenges associated with using files for HL7 communications. Using HL7 batch files may present sequencing problems and/or file access issues that must be remedied by solutions such as file locking, a staging directory, or reader delay.

It is very common to have multiple messages put into a single file without utilizing HL7 batch protocol (i.e. without batch headers and trailers) or instead utilizing some other custom format. Working with non-HL7 formatted batch files requires some specialized processing to read and parse the messages, and may present some additional interfacing challenges.

How are HL7 batch files acknowledged?

The general process for HL7 acknowledgements (ACKs) of batch files is to acknowledge the entire batch at once, and only process errors on an exception basis. However the individual messages can be acknowledged in a manner chosen and appropriate for the application. These options include:

  • Acknowledging all messages in the response batch.
  • Generating a batch control report that is manually delivered to the sending system’s personnel.
  • Acknowledging only those messages that contain errors by using an automated acknowledgement batch; this involves use of an empty ACK batch (an HL7 batch file without any HL7 ACK messages).

More information about batch file protocol and batch acknowledgements can be found in Chapter 2 of the HL7 standard.

Register for an upcoming HL7: First Steps training class.

You might also like

HL7 resources

HL7 Data Types

HL7 data types define the kind of data included in a field used in the HL7 message structure. Examples include a string, text, timestamp, address, or coded element.

Read more >

HL7 resources

RIM-Reference Information Model

The HL7 Reference Information Model (RIM) represents a static model of healthcare workflows as viewed by the HL7 standards development group.

Read more >

HL7 resources

Minimum Layer Protocol – MLP

MLP is how an application should wrap an HL7 message to ensure HL7 compliant applications know where a message starts and stops, and where the next message begins.

Read more >