Announcement

Collapse
No announcement yet.

Custom ACK message when filtering source

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

  • 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.

  • #2
    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.

    Comment


    • #3
      Added attachment

      Thanks, please see attached my basic channel
      Attached Files

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment


          • #6
            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

            Comment


            • #7
              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

              sigpic

              Comment


              • #8
                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

                Comment


                • #9
                  Please see attached my sample message and channel.
                  Attached Files

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      Eric,

                      I could not find anything which is why I had to build the ACK manually. The capabilities around filtering appear to be a little short of what I needed so I had to work around this with the Javascript.
                      Last edited by richhaine; 06-23-2009, 03:13 AM. Reason: spelling!

                      Comment

                      Working...
                      X