HL7 Tutorial: Highlight, validate, and compare hl7 messages

How-to guide: Validate, Highlight and Compare HL7 Messages.

The real trick to an HL7 integration is making sure that both sides agree on the definition for the HL7 messages. Traditionally this comes from hundreds of pages of documentation that neither side gets totally right. HL7 soup allows you to define the validation rules, then share them with your integration partner.

Return to Tutorial Directory

Video Transcript

Validate, Highlight and Compare HL7 Messages:

Hello, and welcome to this tutorial where we look at how to validate, highlight and compare your HL7 messages.

I’m going to start by loading HL7 soup. We see here that it comes with a list of sample message, and these I will use to demonstrate the features.

Let’s start with the basics, and look at how we can highlight a particular field in every message. For arguments sake I will set my patients last name to always highlight as green so I can easily find it. I’ll just quickly click in the interpretations window to find the last name, and now I can right click and select to highlight the last name (PID-5.1) green whenever the field is in the message.

Now you see that this field is highlighted green, and it shows as such for every message that I have going forward. This makes it much easier to find.

You probably noticed however that the rules extended beyond just checking for its existence. If I go back to the highlights menu I can select other options, like equalling or containing a certain value, or when it actually has any value. I can also go to the “not” indicator and highlight where it is not a certain value or doesn’t have a value.

If I highlight a date field, I get options that are more suitable to date values, such as greater than or less than. I can for instance highlight this date orange when it was older than 2014. This might have been when a system change that took place and the orange can warn me of a risk.

Notice if I change this date it only highlights when the date is older than 2014.

The red colour highlight has been given additional functionality. It is reserved for invalid values, those that deserve special attention. One bug I find frequently with HL7 messages are invalid dates. It is surprisingly difficult to spot this issue without highlighters. Let’s add a red invalid highlighter to this date field.

Now notice as I change this date’s value to an invalid month we see it instantly highlights it red, but it goes further and adds an error message to the interpretations window, and also highlights any other currently loaded messages that have the same problem.

If I right click on my messages list I can create a filter that shows only valid or invalid messages, so I can work through them and find my issues.

BTW, HL7 Soup has validations out of the box that checks for invalid dates on the most popular HL7 message types.

Another popular highlighter show when your fields need to have values that are in the lookup tables. Let me show you by marking any administrative sex fields (PID-8) invalid if it isn’t found in the data table. See how soup instantly highlights all the messages, and also gives a detailed description of what’s wrong.

So now that we have some highlighters, let’s see what can be done to manage these.

Navigate up to the “Highlighters and Validation” window, and we can see the list of current highlighters. From here we can change any of the existing highlighters we have made, including the ability to change the values to anything that we like, i.e. values that weren’t in the original message. We can even add custom text that will show in the field’s tooltip, or in the invalid message description.

Something I find extremely helpful is the ability to create different sets of validation. To clone an existing Set I simply click the + button and give the new set a new name. This allows me to create rules specifically for a certain customer or application, then easily jump back and forth between them.

Perhaps most importantly of all, I can even export out these validation sets to my colleges or customers so they can take advantage of them. Imagine being able to create validation rules that ensure messages will work with a certain integration, and then allow others to use this. Your customers or suppliers could be given the set and have the chance to make sure there message conform before you even get them.

From the management window we can also generate bulk list of highlighters from the existing message. This allows us to rapidly build large sets. For instances, lets validate all invalid dates and data tables.

If I go back to the sample messages we can see that they all have lots of errors. This is because the samples come from real world examples that didn’t often conform to the data tables. However, because of the highlighting it is very easy to go through and fix these as required.

Now I’m going to create a new highlight set, clear out all highlighters, and show off some of the other generation features.

Firstly there is the “doesn’t exist” highlighter. This once generated from an existing message will make sure that all other messages have the same segments and fields as a minimum. The fields don’t need values, but they must at least be in the message. It simply creates a filter for the last field in each segment that ensures it is there.

Then we have the “Value is empty” highlighter. This scans the current message, looking through all fields and components. If they have a value in this message then a highlighter will be created that suggests they need to be in other messages too. Fields missing from the current message don’t have to be in other messages.

Finally we have the “Value is different” highlighter, or simply the message comparer. It creates a highlighter for every field and component and checks that it has the same value. I can now take two messages and see exactly how they differ. I can even generate this from the second message so it highlights both ways. Very helpful when you are looking for subtle differences between messages.

Don’t forget that HL7 Soup comes with a free 30 day trial, particularly helpful if you’d like your customers/suppliers to use your validation rules on their messages without cost.

You can download HL7 Soup by googling HL7 Soup, clicking on the free trial.

Also, if you have found my videos have helped you, then please click like, or subscribe to the series so YouTube can inform you when more tutorials are released.

Also, comments and suggestions for future videos are very welcome.

Download 30 Day Free Trial of HL7 Soup