web stats
MIrth with sequential data flow - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2019, 08:14 AM
Mits87 Mits87 is offline
OBX.1 Kenobi
 
Join Date: Nov 2016
Posts: 45
Mits87 is on a distinguished road
Default MIrth with sequential data flow

Mirth version 3.5.2

I am connecting to an Application which has multiple sequential workflows. The app communicates using TCP connection with the XML data format

1. App sends Hello message to Mirth
2. Mirth send ACK for Hello
3. App sends a validation message to Mirth
4. Mirth send ACK for validation message
5. App sends data in XML format.
6. Mirth sends ACK for data.
7. App sends end of the data message to mirth.
8. App sends a disconnect request message to mirth
9. Mirth sends an ack for the disconnect request message.
10. App sends the final ACK to Mirth.

I captured message ID in source tranformer, check the message type based on the xml tag put this values into globalchannel map and used that in post process to create custom ack. The post-process have custom ack based on each message type but it's not working correctly. Once app sends hello mirth is not sending hello ack and the app is timing out.

Below is my code in post process

Code:
var msg = globalChannelMap.get('rawMsg');
var curdate = DateUtil.getCurrentDate('yyyy-MM-dd');
var curdate = DateUtil.getCurrentDate('HH:mm:ss.SS');
var fulcurdatetime = curdate +"T"+curdate+"-04:00";
var controllerID = globalChannelMap.get('XMLControlID');
var HELdeteceted = globalChannelMap.get('HEL');
var DSTdeteceted = globalChannelMap.get('DST');
var OBSdeteceted = globalChannelMap.get('OBS');
var ENDdeteceted = globalChannelMap.get('END');

var ackHEL = '<ACK.R01><HDR><HDR.message_type V="ACK.R01" /><HDR.control_id V="1" /><HDR.version_id V="" /><HDR.creation_dttm V="' + fulcurdatetime +'" /></HDR><ACK><ACK.type_cd V="AA" DN="" /><ACK.ack_control_id V="'+ controllerID+ '" /></ACK></ACK.R01>';
var ackDST = '<ACK.R01><HDR><HDR.message_type V="ACK.R01" /><HDR.control_id V="2" /><HDR.version_id V="" /><HDR.creation_dttm V="' + fulcurdatetime +'" /></HDR><ACK><ACK.type_cd V="AA" DN="" /><ACK.ack_control_id V="'+ controllerID+ '" /></ACK></ACK.R01>';
var ackOBS = '<ACK.R01><HDR><HDR.message_type V="ACK.R01" /><HDR.control_id V="4" /><HDR.version_id V="" /><HDR.creation_dttm V="' + fulcurdatetime +'" /></HDR><ACK><ACK.type_cd V="AA" DN="" /><ACK.ack_control_id V="'+ controllerID+ '" /></ACK></ACK.R01>';
//var ackEND = '<END.R01><HDR><HDR.message_type V="END.R01" /><HDR.control_id V="5" /><HDR.version_id V="" /><HDR.creation_dttm V="' + fulcurdatetime +'" /></HDR><TRM><TRM.reason_cd V="NRM" /></TRM></END.R01>';

if ( HELdeteceted == 'yes')
	{
	responseMap.put('ACK', ackHEL);
	}

if ( DSTdeteceted == 'yes')
	{
	responseMap.put('ACK', ackDST);
	}

if ( OBSdeteceted == 'yes')
	{
	responseMap.put('ACK', ackOBS);
	}

if ( ENDdeteceted == 'yes')
	{
	responseMap.put('ACK', ackEND);
	}

return;
Reply With Quote
  #2  
Old 01-09-2019, 05:57 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 598
agermano is on a distinguished road
Default

What you're attempting is difficult in mirth. A potential problem that I see right away is that you're storing state information in multiple keys in the globalChannelMap. Where do you clear them out?

It would be helpful if you could post your entire channel, as well as samples of what the entire conversation is supposed to look like.
Reply With Quote
  #3  
Old 01-14-2019, 10:36 AM
Mits87 Mits87 is offline
OBX.1 Kenobi
 
Join Date: Nov 2016
Posts: 45
Mits87 is on a distinguished road
Default

Thanks for your input. I am using Mirth 3.6.1 and have my channel along with the document which contains all messages.

I only need to forward the OBS messages to end destination so really don't care about the Hello, EOT and END message but they are required from the Careapp I am connecting as its POCT1 communication.
Attached Files
File Type: xml testapp.xml (16.1 KB, 0 views)
File Type: doc CareAppMirth.doc (48.5 KB, 1 views)

Last edited by Mits87; 01-14-2019 at 10:48 AM.
Reply With Quote
Reply

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 02:05 PM.


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