web stats
Process HL7 ACK from multiple destination - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2018, 08:16 AM
Mits87 Mits87 is offline
OBX.1 Kenobi
 
Join Date: Nov 2016
Posts: 40
Mits87 is on a distinguished road
Default Process HL7 ACK from multiple destination

I have a channel with 4 destinations. Each destination will filter the message and only one of them will accept the message. On top of this, all 4 destinations replay with AA on a different port. I need to receive the response and pass the same back to the original application can someone guide me on how to achieve this.

In the response dropdown, I can only select one destination but while processing its not fixed which destination will reply back with ACK and so need to accept ACK from all four destinations.

This is strictly HL7 based channel and I am using 3.6.1 version of mirth.
Reply With Quote
  #2  
Old 12-10-2018, 04:46 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 561
agermano is on a distinguished road
Default

The post-processor can be used for this. It can access the responses from all 4 destinations and return the appropriate one for that message. You'll probably have to generate your own ACK if there is an error sending to the destination, which you can also do in the post-processor.
Reply With Quote
  #3  
Old Yesterday, 12:55 PM
Mits87 Mits87 is offline
OBX.1 Kenobi
 
Join Date: Nov 2016
Posts: 40
Mits87 is on a distinguished road
Default

Thank you Agermano.

I have postprocess script with below code but somehow it is not sending ACK back to source. I do have postprocess selected as response.

The destinations are sending a CA message and I need to convert them to AA message before I pass to the original application. Below code only contains logic for 2 destinations but i have same if the condition for other destinations too.
Code:
// Get the response from each destination.
var string_response1 = responseMap.get('d1').getMessage();
var response1 = new XML($r('d1').getMessage());
var string_response2 = responseMap.get('d2').getMessage();
var response2 = new XML($r('d2').getMessage());

if (responseMap.get('d1').getStatus() == "SUCCESS")
{
	var msg = new XML(SerializerFactory.getSerializer('HL7V2').toXML(string_response1));
	var ackreponse = msg['MSA']['MSA.1']['MSA.1.1'].toString();
	if  (ackreponse == "CA");
	{
		 msg['MSA']['MSA.1']['MSA.1.1'] = 'AA';
		 return msg;
	}
}

if (responseMap.get('d2').getStatus() == "SUCCESS")
{
	var msg = new XML(SerializerFactory.getSerializer('HL7V2').toXML(string_response2));
	var ackreponse = msg['MSA']['MSA.1']['MSA.1.1'].toString();
	if  (ackreponse == "CA");
	{
		 msg['MSA']['MSA.1']['MSA.1.1'] = 'AA';
		 return msg;
	}
}

return msg;

Last edited by Mits87; Yesterday at 03:39 PM.
Reply With Quote
Reply

Tags
ack, ack on different port, acknoweldgement, multiple destination

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 04:23 AM.


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