HL7 Batcher

Centers for Disease Control and Prevention
National Center for Chronic Disease Prevention and Health Promotion
Division of Cancer Prevention and Control
National Program of Cancer Registries
Registry Plus Software for Cancer Registries


This console application combines multiple HL7 message files into one file by creating batch by Laboratory name.

How it works?

This application rearranges message by creating individual HL7 files by Laboratory name. Then it adds necessary header and footer segments.

Header Segment for batch

FHS (File Header Segment) BHS (Batch Header Segment)

Takes necessary information form first occurrence of MSG segment to construct FHS and BHS

Footer Segment for batch

BTS (Batch Trailer) FTS (File Trailer)

Construct BTS by counting messages in created batch files. FTS is hard coded as we assume it gets always only one lab’s message in a batch

How to run application?

  1. Unzip provided program files into C:\ drive to get the following structure
    1. Delete existing sample Messages from C:\HL7\Messages
    2. Place your all uncombined files into C:\HL7\Messages
    3. All combined output file will be located in C:\HL7\Batch folder
    4. All processed message will be moved into C: \HL7\Archive folder
  2. Press key combination Windows Start Key + R to open Command Prompt
  3. You will see “Run” dialog box. Type “CMD” in “Open” combo box area

    9BB23B8

    + R

  4. You will see “Run” dialog box. Type “CMD” in “Open” combo box area
  5. Click OK. It will open Command Line interface
  6. Issue shown command in command line window as shown below
  7. You will start noticing progress
  8. Press any key to end application
  9. Now if you check C:\HL7\Messages, it will be empty
  10. You will find all processed batches in C:\HL7\Batch
  11. You will notice each file has name that refer to sending Laboratory name
  12. Make sure you move combined output files from C:\HL7\Batch to somewhere else to avoid confusion for next round use of this application.