Sidebar

How can I setup and use a template HL7 message?

+1 vote
1.5K views
asked Jul 10, 2014 by michael-h-5027 (14,350 points)
I want to create an HL7 message from a csv file, database query, or some other source other than HL7.

1 Answer

+1 vote
 
Best answer

One method would be to create a system variable to be used as the template.

MSH|^~\&|sender|sender|recipient|recipient|{SYSTEM_DATE[yyyyMMddhhmmss]}||MDM^T02|{UUID-NO-DASHES}|P|2.3|||NE|NE
EVN|T02|{SYSTEM_DATE[yyyyMMddhhmmss]}
PID|1||123||FakeLastName^FakeFirstName^^||19500101000000|M|||||||||||111551234|||
TXA|1|CM|TX|20130127142151||||20130127142151||||{UUID-NO-DASHES}||994|||AU|UC|AV|||^^^^^^^^^^^^^^20130127142151
OBX|1|ST|||Discharge|||||||||20130127142151
Then create a custom mapping function that creates your HL7 message and sets the value to the above template.
 
message = qie.createHL7Message();
message.setNode('/', qie.evaluateTemplate(qie.getVariable('templateHL7')));

 

answered Jul 10, 2014 by michael-h-5027 (14,350 points)
selected Jul 11, 2014 by mike-r-7535
commented Jul 11, 2014 by mike-r-7535 (13,830 points)
I completely agree that this is the easiest and simplest way. If a segment conditionally needs to exist in the message, then you will need to supplement the message using functions like message.addChildAfter().
...