web stats
Want to alert on an AE ACK - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2019, 11:17 AM
Brad_AZ Brad_AZ is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Arizona, USA
Posts: 17
Brad_AZ is on a distinguished road
Default Want to alert on an AE ACK

I am receiving AE ACKs occasionally from an application and I am trying to configure an alert but having no luck. I started searching here and will continue to do so, but have not found anything yet.

TEST DATA (no PHI):
“MSH|^~\&|CST|1|G500|1|20190802135002||ACK|176438| T|2.3
MSA|AE|00000000860554|[EMPI # 910117] SCHEDULING ERROR: Source id 0006533372 is already used by another engagement.”

We are using Mirth 3.8 in an Active/Active cluster. We have the advanced alerting plug in. Our channel is set to queue. In the channel summary, AE and CE are listed as ACK error codes. The response above did not error, it shows as sent. (and that's OK). I just want to be able to let the app owners know when this occurs.
__________________
SIG|1|Mirth Certified Interface Analyst^Cancer Treatment Centers of America|
Reply With Quote
  #2  
Old 08-02-2019, 02:41 PM
Brad_AZ Brad_AZ is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Arizona, USA
Posts: 17
Brad_AZ is on a distinguished road
Default

Not sure if I'm getting closer. I was able to add a 2nd destination and that sends the ACK and the message in an email. But now I am struggling with my filter. (I don't want to send this for AA's)

I thought I read that the response is also 'msg'. Trying to pick that up so I can filter the ACK based on MSA-1.

Will update as I go. Here is the channel as it currently stands.
Attached Files
File Type: xml BRAD_TEST_NAK.xml (40.2 KB, 1 views)
__________________
SIG|1|Mirth Certified Interface Analyst^Cancer Treatment Centers of America|
Reply With Quote
  #3  
Old 08-03-2019, 10:39 AM
Brad_AZ Brad_AZ is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Arizona, USA
Posts: 17
Brad_AZ is on a distinguished road
Default

OK - it's not pretty but this seems to work. I welcome any other suggestions.

I put a response transformer on the connection that sends the message. It creates a channelMap variable which returns the 2 characters after 'MSA|',

Code:
// Gets status from the response by capturing the 2 characters after 'MSA|'
var rsp = response.getMessage(); 

var status = rsp.split("MSA")[1].toString();

status = status.substring(1,3);

channelMap.put('status',status);
Then I added a 2nd connection that emails the response and the message. Our exchange settings encrypt this and it only goes to the appropriate parties since this is PHI.

The second connection uses a JavaScript filter based on the status channel Map variable.

Code:
//Sends only if the response is 'AE' or 'AR'
if (($('status') == 'AE') || ($('status') == 'AR')) {
    return true;	
	}
return false;
I initially did a != 'AA' status, but that returned true even when the connection was down, so the above code works better for this application.
__________________
SIG|1|Mirth Certified Interface Analyst^Cancer Treatment Centers of America|

Last edited by Brad_AZ; 08-03-2019 at 04:07 PM.
Reply With Quote
  #4  
Old 08-05-2019, 08:36 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 894
agermano is on a distinguished road
Default

In your response transformer you should be able to do this either as a javascript or mapper step. Then you can use the map variable in the same way in your filter.
Code:
channelMap.put('status', msg['MSA']['MSA.1']['MSA.1.1'].toString());
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 11:33 AM.


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