Article
· 18 hr ago 3m read

How to create your own search table for HL7 messaging

My intention is to show how simple it is to generate a lookup table taking into account the information received in our HL7 messaging. The HL7 message lookup table provided by IRIS is certainly sufficient for most of the searches we want to perform, but we always have that special field in our HIS, LIS, RIS, etc. that we'd like to search by. But that's in a segment outside of that lookup table. That field forces us to generate a specific search using the expanded search criteria. We'll likely have many messages, and we'll also have to filter by date and time so we don't timeout.
 

 

How do we solve this?

By generating our own search table.

And how do we generate our search table?

As we non-geniuses have always done, COPYING! In our lives, we will meet 3-4 geniuses. They will be the ones who invent, generate, visualize the afterlife, etc. If you are one of them, you already know how to do this. You'll be in the top 100 of the global masters, you'll have more than 500,000 points, and a veritable trousseau of InterSystems products in your home. The rest of us will do as we have done all these years before the chatGPT: copy, and without any shame, with our heads held high, so let's begin.

 

First Step

We will generate our class in Visual Studio Code, we will open the EnsLib.HL7.SearchTable class that IRIS gives us, and we will copy all the content of the class (CTRL+C). Then we will go to our class and paste (CTRL+V).
 

 

Super important: we will also copy the Extends, the ClassType, Inheritance. We are not leaving anything out, just the Copyright, that doesn't interest us. We don't have enough ego to leave our mark of great work.

 

 

If you're old school, this screen will seem very familiar to you 😉

 

Second Step

 

Now we do the magic: we add our fields, remove the ones we aren't interested in, and we can even translate it into Spanish to make it look better.
 

 

 

In this case, I've added the message source, destination, event, service, and patient episode, and this is where your need comes in. Add any field you want/need. As you can see, you can add the segment, field, and component numerically. For me, it's easier than adding the English name, but keep in mind that we can only guarantee that segment 1 will be the MSH; the rest will depend on each message. So, in the case of segments, it's better to use the code (PID, PV1).

After all this arduous task, we compile and now have our lookup table. We just need to assign it to the components in our production, obviously the HL7 components. Let's get to it.

 

 

Third Step

 

We open our production and look for the HL7 components, we go to the additional parameters and there we will find our lookup table, we select it and proceed to apply the changes, from that moment on, all the messages that enter through that component will be stored in our lookup table. If later we add more fields to the lookup table, it will be from the compilation of this when they will begin to be saved, and for previous messages, that field will be blank.

 

 

Whether they enter or exit, in HL7 type operations we also have the lookup table. Normally, in the output components nothing is activated by default, but if we are interested in controlling the output we also have it available.

 

 

With these simple steps we have our production ready to save the data we are interested in. We just need to generate the queries, and to do that we go to the message viewer.

 

Demonstration

 

In the messaging within the criteria, when we select the lookup tables, we will find what we did. When we select it, we can now start playing with our fields

 

 

Below, I'll give several examples, but your imagination is the limit. I'm getting carried away. The fields in the lookup table will set the limits for you.


1. Search if no condition. We only want to see the input message event and message ID.

 

 

2. Search by event showing patient and episode codes

 


3. Search by episode showing the service, patient name and HL7 message type

 

 


From here on it's up to you, enjoy 😋

Discussion (0)1
Log in or sign up to continue