Announcement

Collapse
No announcement yet.

Response Transformer to run Stored Procedures in DB

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

  • Response Transformer to run Stored Procedures in DB

    Is there any way to take a response message from a HL7 tcp channel and run a sql stored procedure based on the content of the response message?

  • #2
    Originally posted by jjones View Post
    Is there any way to take a response message from a HL7 tcp channel and run a sql stored procedure based on the content of the response message?
    Yeah, you can use the response transformer for that. You can do a manual database call in the JavaScript itself, or you can route the response to another channel and do it there.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Almost there

      I am able to get a message successfully to the other channel but I can't figure out how to send the full response message that comes back to the destination response transformer. This is what I have in the response transformer: (This worked as a test but just sent the orginal source message)

      router.routeMessageByChannelId('cee2efe5-760c-433b-b571-d97f904f4ce8', connectorMessage.getRawData())

      What would I put in place of the connectorMessage.getRawData() to pass in the response from the destination?

      Comment


      • #4
        Use response.getMessage() instead.
        Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

        Nicholas Rupley
        Work: 949-237-6069
        Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


        - How do I foo?
        - You just bar.

        Comment


        • #5
          Thanks

          That worked. Thanks for your help. This code successfully routed my response to another channel:

          Code:
          router.routeMessageByChannelId('cee2efe5-760c-433b-b571-d97f904f4ce8', response.getMessage())

          Comment

          Working...
          X