HL7 Diff


I created HL7 diff because there isn’t a really good way to look at two files containing HL7 information and see how similar they are. The UNIX diff utility is particularly worthless because of the changing time stamps.

Thanks to Jack Jones for creating a modified version that runs without Tk and produces useful output on the command line. Text::Diff is still required, but it’s nice when you don’t have a graphical display you can push from the server. Get his version from the “Download Console Program” link below, and thanks again, Jack.

HL7 Diff will compare two files containing HL7 data. Records that are the same will be ignored, including differences in MSH-7, MSH-10 and OBR-22. The records are broken up into segments and the segments and fields are diffed individually. That way only the exact fields and segments where there are differences are highlighted. The types of differences (added, removed, different) are color coded as well. In what I think is a particularly cool bit of hackery, the output of the program can also be saved as HTML, so you can easily mail it (securely!) to a co-worker and show them.


If you want the source download, click on the download program link. Save it as a .pl and make it executable. You’ll need Perl, Perl/Tk and Algorithm::Diff installed to use it.

The Windows executable may or may not work for you. It was made with ActiveState’s cool PerlDevKit.

Important Information

This particular piece of software is provided under the terms of the GNU Public License, version 2. Visit the Free Software Foundation if you’ve been living in a cave and don’t know what that means.

Like all software on this site, this is provided without warranty in the hopes that it will be useful for you. If it breaks, please don’t sue me.