web stats
How to wirte outbound message at destination - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 03-19-2019, 09:54 PM
Saqib Javaid Saqib Javaid is offline
What's HL7?
Join Date: Mar 2019
Posts: 1
Saqib Javaid is on a distinguished road
Red face How to wirte outbound message at destination


I am newbie to Mirth Connect. I have successfully created Inbound channel where Source is TCP/File Reader and creates Acknowledgments at destination.But, now I have been assigned a task to create a channel for Outboundmessage. Where I have to read from Database (Source) and Write outbound message in Destination. Source part was easy i.e Read from database. But when I just write outbound file it writes with column names too in destination file like

result|receivingapplication|LABADTsecurity|Psendin gapplication|ADT1datetimeofmessage|2019-03-20sendingfacility|MCMmessagecontrolid|MSGAbCdrecei vingfacility|MCM

which is wrong. Any hint, please.

Thanks in advance
Reply With Quote
Old 03-27-2019, 10:53 AM
rutledj rutledj is offline
Mirth Guru
Join Date: Nov 2010
Location: North Carolina
Posts: 399
rutledj is on a distinguished road

Perhaps posting your channel would help us more understand what you are doing.
Reply With Quote
Old 04-15-2019, 11:23 PM
schillert schillert is offline
OBX.1 Kenobi
Join Date: Jul 2012
Posts: 31
schillert is on a distinguished road

I guess the result of your database query looks like this

The inbound datatype of the source connector should be XML and
the outbound datatype should be HL7V2

You have to add a transformer step and change it's type to javascript.
Then you start building your HL7 message - segment by segment and field by field
in the correct syntactical and numerical order.

The information you provided would be a part of the MSH-segment of the message.
The javascript would look like that

tmp=new XML("<HL7Message>");
tmp["MSH.7"]["MSH.7.1"]=DateUtil.convertDate("yyyy-MM-dd", yyyyMMdd, msg["datetimeofmessage"].toString());
tmp["MSH.9"]["MSH.9.1"]="ADT"; // The message type you want
tmp["MSH.9"]["MSH.9.2"]="A01"; // The event you want


further fields and segments


Reply With Quote

destination template, destinations, file writer, outbound

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 10:12 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation