web stats
How does Source Connector Response gets the response from a destination? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2017, 11:03 AM
ppazos ppazos is offline
OBX.2 Kenobi
 
Join Date: May 2008
Posts: 76
ppazos
Default How does Source Connector Response gets the response from a destination?

For a TCP Listener in MLLP mode, the Response field can be set to any of the available destinations, independently of the destination connector type.

How does the source connector get the response from a destination if the destination Connector type is whatever like JS or database writer?

Not sure how this works, can't find this on the docs.

I tried to return a string from a JS Writer destination and tried returning an ACK generated with Response Factory, on both cases I'm getting "Error evaluating response transformer" with the exception "syntax error unexpected token: X". Where X is the first character of the string I returned from the JS Writer.

Is there an example of a destination that generates an ACK for a source that selects that destination as response?

Thanks!
Reply With Quote
  #2  
Old 10-30-2017, 12:33 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

If you are using a JS writer you have to create your ack there in the script and then return the ACK. Like here I am creating a custom, non HL7 informative response

Code:
var channelResponse = new Response(Status, Text);
return channelResponse

//Status - SENT, ERROR, QUEUED or FILTERED only.
If you want to generate an HL7 ACK the syntax changes to

Code:
channelResponse= new generateAckResponse(connectorMessage.getRawData(),'AA','Successful');
return channelResponse;
http://javadocs.mirthcorp.com/connec...Generator.html
__________________
HL7v2.7 Certified Control Specialist!

Last edited by siddharth; 10-30-2017 at 12:35 AM. Reason: foo
Reply With Quote
  #3  
Old 10-30-2017, 09:35 AM
ppazos ppazos is offline
OBX.2 Kenobi
 
Join Date: May 2008
Posts: 76
ppazos
Default

Perfect, so the key is to return a Response object instead of string or xml.

Just wondering what happens on File Writer or DB Writer when the Source Response option is set to one of those destinations since those can't create a response object.

I tried also with a TCP Sender Destination, selecting the Response on the Source Connector to be that destination, and without doing anything the system that sent the message to Mirth gets the response correctly. It is really obscure how the Response option works on different cases. I suppose I need to test every option and create my own documentation
Reply With Quote
Reply

Tags
destination, mllp source, response

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 12:46 PM.


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