Mirth is a broker to help with healthcare application HL7 message integration.
My question is about saving yourself the trouble of hitting your own datastore everytime you want to do a lookup on some data contained within the HL7.
Scenario:
for each message received by the channel, I want to find the facility's mnemonic/code/ID and get the full name of the facility. Unfortunately I cannot ask the sender of the HL7 message to send it along in the message for me. So I have to write my own DB access code to call a stored procedure, pass in the ID, and receive the full name.
Any idea on how to create a cache of data in Mirth so that you can access the lookup from any channel, source, destination, transformer or filter?
Best Answer
In our case, where we had to load lookup values from a database, we solved this as follows:
Note: In our case, each key could have two values associated with it. If we did not use both we just set the second to null in the query from the database.
To load the global map place this in your deploy script of your channel (customize as needed):
In order to access these values you use the following function as a global template.
A sample of code to access the values:
Your mileage may vary ... but this has worked for us up to now.
Thanks, Frans de Wet