web stats
Mirth Community - View Single Post - Auto Generated responses - what do they respond?
View Single Post
Old 11-10-2014, 07:34 AM
gkittlaus gkittlaus is offline
OBX.3 Kenobi
Join Date: Jan 2012
Posts: 104
gkittlaus is on a distinguished road

Originally Posted by narupley View Post
The two things you're asking don't make sense together at all. If you need to wait until all your destinations have finished before sending a response, then you can't respond immediately. And if you want to respond immediately, then you can't be waiting on your destinations to finish.

If you want to respond immediately and don't care about using a dynamic response based on the completion status of the destinations, then that's where you would want to turn on the source queue, and use one of the auto-generate response options. Currently auto-generation is only implemented for HL7 v2.x, so if that's what your inbound data type is, then it should work.
yeah I know that sounds confusing, but is exactly what I need.

to explain it a little bit more:
we have three inbound trigger: send document, send document2 and query for data

when receiving the inbound trigger for sending a document, it can imediatly reponse back with success.
when receiving the query trigger, we want to build a response containing the data for that query. I know this is not possible, this is just logical.

Anyhow, I wannt to try something different. I don't care about the query resquest so I simply want to send a response back imediatly, regarding the trigger, meaning:
receive query > respond with "var queryResponse"
receive doc1> respond with "var doc1Response"
receive doc2> respond with "var doc2Response"

The logic works: I build something in my preprocessor like:
var tempo = new XML(SerializerFactory.getSerializer('XML').toXML(message))
var SOAPACTION = tempo['Header']['SOAPAction'].toString()

if ( SOAPACTION == 'QueryRequest' ) {
	ResponseFactory.getSentResponse('<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...query...</s:Envelope>')
} else if ( SOAPACTION == 'Document1' ) {
	ResponseFactory.getSentResponse('<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...doc1...</s:Envelope>')
} else if ( SOAPACTION == 'Document2' ) {
	ResponseFactory.getSentResponse('<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...doc2...</s:Envelope>')
}	else {
anyway, what do I have to setup that mirth will respond with what I setup in my preprocessor?
is this possible?
Reply With Quote