web stats
Problem with HL7-Binary ACK response. - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 12-13-2019, 08:48 AM
fharvey fharvey is offline
What's HL7?
Join Date: Nov 2019
Posts: 1
fharvey is on a distinguished road
Default Problem with HL7-Binary ACK response.


I have to process a Binary HL7 feed sent by a Cloverleaf interface.

It seem Mirth don't manage Binary HL7 on the TCP listenet out of the box.

I set Data Type to Binary but I had to do this Preprocessor Script
to properly process the entry HL7 messages.

var message_decoded;
message_decoded = FileUtil.decode(message);
var string = new java.lang.String(message_decoded, 'ISO-8859-1' );

return string;
With this I process the message Ok.


The ACK messages generated end up being strange and it fill the sending interface with error messages:

MSHIfF5+IMIRTHIITkF8VEVTVHxURVNUIwMTkxMjEyMDkzNDQz I20191212103707.665IIACKffACKI20191212103707.665IP I2.4
MSAIAAI1IMessage recu par Citadel
This seem to be a mix of text value of the variable to create the messages and BASE64 encoded values

When I try to built the ACK using Postprocessor and turning off the Auto-generate option with this script :

var stringmsg=message.getConnectorMessages().get(0).getRawData().toString().getBytes('ISO-8859-1');
var base64msg=FileUtil.encode(message.getConnectorMessages().get(0).getRawData().toString().getBytes('ISO-8859-1'));

var ackCode = 'AA';
var ackMessage = 'Message recu par Citadel';
var ackhl7 = ACKGenerator.generateAckResponse( stringmsg , ackCode, ackMessage );

return ackhl7;
I get

MSHcdba9cMIRTHcccc20191213114222ccACKddACKc2019121 3114222cPc2.4
MSAcAAc1cMessage recu par Citadel
I have tried numerous thing and combination, scanned everything I could on this forum to no avail.

How can I produce a regular ACK message like ?

MSH|^~\&|TEST|TEST|TEST|HNA|20191212105545.488||AC K|20191212105545.488|P|2.3
MSA|AA|Q707407300T782731569|Message recu par Citadel
Reply With Quote
Old 12-23-2019, 05:45 PM
peterl peterl is offline
Mirth Employee
Join Date: Mar 2013
Posts: 14
peterl is on a distinguished road

In your postprocessor script, you should be able to do
var stringMsg = message.getConnectorMessages().get(0).getProcessedRawData();
to get the already processed HL7 data instead of trying to work with the raw data again.
Reply With Quote

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 05:49 AM.

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