Announcement

Collapse
No announcement yet.

Want to alert on an AE ACK

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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|Brad|Mirth Certified Interface Analyst^Cancer Treatment Centers of America

  • #2
    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
    SIG|1|Brad|Mirth Certified Interface Analyst^Cancer Treatment Centers of America

    Comment


    • #3
      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.
      Last edited by Brad_AZ; 08-03-2019, 04:07 PM.
      SIG|1|Brad|Mirth Certified Interface Analyst^Cancer Treatment Centers of America

      Comment


      • #4
        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());

        Comment

        Working...
        X