Running HL7 Reports

A report is basically specific fields pulled from a set of HL7 records and presented in a table format. You might be interested in figuring out what types of events you get over an ADT feed, for example, and this would let you capture just the MSH:9 field from those records. If you captured it with the message time you could use a spreadsheet type program to produce graphs of the data over time.

To start a report, you basically need to get the data you want to report on in an HL7Browser window. If it's a file you can simply load it, or you need to prepare a file that the browser can load. The data in the table is just a view of the data in the browser window, so this step is not optional. The data you get will be from the window you clicked on the report icon in if you have more than one window open. There is no way to load data directly into the report window.

Making the report itself is easy. Type a name in the first text field (like LName for last name) and the field you wish to capture in the second, in this case it would be PID:5-0-1. That field definition might be a little odd, but it is designed to always be consistent between the various programs that use the included HL7 manipulation libraries.

The field definition looks like this:

SEG[#]:field[-rep[-comp[-subcomp]]]

SEG - the segment ID and field, which is an integer number for the field you want, are required. Optionally you may specify which count of a given segment (OBX5:3 would give you the fifth OBX:3 field), the repetition, component and subcomponent. The order is important here as you must specify a repetition if you want to access a component. Likewise you must specify repetition and component if you want a subcomponent. This is true even if the given field you are using doesn't allow repetitions. The reason is because even though the library is good at parsing HL7 documents, it knows nothing about the actual rules governing these messages.

So, in our example above for the last name, we specify PID:5-0-1, even though our PID:5 doesn't have a repetition, because PID:5-1 would give us every component in the first (and probably only) repetition. Again, this is because the library alwas assumes a field could be repeated.

If you change your mind about a given field in a report, it's simple to get rid of it. Select the field from the dropdown menu on the right and delete it. If you've got two fields with the same name (the name, not the definition is shown) then you can be sure that they are listed in the same order that they are shown on, in the table itself.

Lastly, these reports would be of little value if you couldn't save the data. In this utility, the data is saved in a tab delimited format. The first line of the file has the column names that you specified creating the report.

One more note. You cannot reorder the columns as the application works today. Because the data is just a view of the underlying HL7 browser window, it always appears in the same order as the data in the browser window. If you need to reorder or report on this data, consider using a spreadsheet-type program.