web stats
Custom ACK message when filtering source - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2009, 09:51 AM
richhaine richhaine is offline
Mirth Newb
 
Join Date: Jan 2009
Location: England
Posts: 10
richhaine
Question Custom ACK message when filtering source

I'm fairly new to Mirth, so this may be a dumb question, in any case would like some pointers:

I have Mirth 1.8.0 and am trying to return a custom message in the ERR segment of the ACK.

This should be applied when filtering the source message (so I do not have to process anything that is not valid).

This message must reflect why the message has been filtered out (e.g. MSH 11 contains a non-production value).

I have tried putting the validation into JavaScript and setting the message in the responseMap using the responseMap.put(connector, "Error") (just to test that I can add a custom message). No matter what I try, I cannot generate the ERR segment with the custom message, nor can I add the message to the AR response text.

I have a simple llp listener as the source and a file writer as the destination.

Thanks in advance for any suggestions.
Reply With Quote
  #2  
Old 03-30-2009, 10:27 AM
jbartels jbartels is offline
Mirth Guru
 
Join Date: Oct 2006
Posts: 728
jbartels is on a distinguished road
Default

Post your channel please.
__________________
Jon Bartels

Zen is hiring!!!!
http://consultzen.com/careers/
Talented healthcare IT professionals wanted. Engineers to sales to management.
Good benefits, great working environment, genuinely interesting work.
Reply With Quote
  #3  
Old 03-30-2009, 11:00 AM
richhaine richhaine is offline
Mirth Newb
 
Join Date: Jan 2009
Location: England
Posts: 10
richhaine
Post Added attachment

Thanks, please see attached my basic channel
Attached Files
File Type: xml HL7_File_Export.xml (25.6 KB, 111 views)
Reply With Quote
  #4  
Old 03-30-2009, 05:10 PM
jbartels jbartels is offline
Mirth Guru
 
Join Date: Oct 2006
Posts: 728
jbartels is on a distinguished road
Default

The channel isn't importing cleanly for me, but looking at the XML you have responseMap.put("Mirth Folder", "Error"); and IIRC the mapper doesn't like having spaces in the mapping names.
__________________
Jon Bartels

Zen is hiring!!!!
http://consultzen.com/careers/
Talented healthcare IT professionals wanted. Engineers to sales to management.
Good benefits, great working environment, genuinely interesting work.
Reply With Quote
  #5  
Old 03-31-2009, 02:13 AM
richhaine richhaine is offline
Mirth Newb
 
Join Date: Jan 2009
Location: England
Posts: 10
richhaine
Default

Jon,

That is part of my issue. If I select the option to Send ACK = YES on the Source tab, it will just respond with the messages as per the labels. If I try to select Respond From, then select the Destination, I get a null pointer exception as there is nothing to send an ACK.
Reply With Quote
  #6  
Old 03-31-2009, 11:47 AM
richhaine richhaine is offline
Mirth Newb
 
Join Date: Jan 2009
Location: England
Posts: 10
richhaine
Red face

Jon,

I have been trawling the forums and found this:

http://www.mirthproject.org/communit...ilter#post5831

It looks as though I cannot tell / change the ACK message based on the results of a filter.

Is there an alternative to this? Any suggestions would be gratefully received as I need to respond with an error that reflects the reason I am rejecting the message.

Thanks,
Richard
Reply With Quote
  #7  
Old 03-31-2009, 01:39 PM
jacobb jacobb is offline
Mirth Employee
 
Join Date: Aug 2006
Location: Irvine, CA
Posts: 1,218
jacobb is an unknown quantity at this point
Default

Quote:
Originally Posted by richhaine View Post
Jon,

I have been trawling the forums and found this:

http://www.mirthproject.org/communit...ilter#post5831

It looks as though I cannot tell / change the ACK message based on the results of a filter.

Is there an alternative to this? Any suggestions would be gratefully received as I need to respond with an error that reflects the reason I am rejecting the message.

Thanks,
Richard
You can respond with any message you want. Populate the responseMap with whatever you want to be sent back, and then in the respond from you should be able to choose that.
__________________
Jacob Brauer
Director, Software Development
NextGen Healthcare

Reply With Quote
  #8  
Old 04-02-2009, 10:54 AM
richhaine richhaine is offline
Mirth Newb
 
Join Date: Jan 2009
Location: England
Posts: 10
richhaine
Default

Jacob,

Thanks for the feedback.
The one thing that I want to add to the ACK is the reason a message has been filtered, e.g. Wrong Receiving application has been identified in MSH5.1. Any thoughts on how I get this info? I am currently only getting a message back from the responseMap "Message has been filtered".

Thanks,
Richard
Reply With Quote
  #9  
Old 04-02-2009, 11:07 AM
richhaine richhaine is offline
Mirth Newb
 
Join Date: Jan 2009
Location: England
Posts: 10
richhaine
Default

Please see attached my sample message and channel.
Attached Files
File Type: xml HL7_Feed.xml (122.2 KB, 329 views)
File Type: txt 20090317093753.txt (234 Bytes, 268 views)
Reply With Quote
  #10  
Old 06-22-2009, 06:11 PM
epfreed epfreed is offline
Mirth Newb
 
Join Date: Jan 2008
Posts: 14
epfreed
Default custom NAK

Thanks, that example Javascript is very helpful to me!

But, is it really necessary to build the HL7 by hand using the StringBuilder? Isn't there some facility to create the message in mirth (or in HAPI)? I just want to send a NAK if the message fails some criteria (and is filtered). I wish I could just ask for a NAK header and put it in the responseMap instead of building one by hand.
Reply With Quote
Reply

Tags
ack, custom, err

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:29 AM.


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