web stats
Mirth Community - View Single Post - Processing Response Objects in the Response Transformer for custom Acknowledgment
View Single Post
Old 01-28-2014, 08:25 AM
amith amith is offline
Mirth Newb
Join Date: Aug 2010
Location: London, UK
Posts: 7
amith is on a distinguished road
Default custom Acknowledgment with queues

I've found a hacky way around this.
My Solution with Mirth v3.01: On the Source channel transformer(TEST_ADT_HL7_To_XML):

On the Response End channel Response Transformer (TEST_XML_Sender) - Update the response flag.

if (response.getMessage() != '') 
    var ResponseMessage = response.getMessage()
    var ResponseXML = new XML(ResponseMessage.toString());
}else{//wait if queued}
On the Response End channel Post-Processor(TEST_XML_Sender) - Set the Response setting to "Post Processor" Write a While loop. (use a timeoout if you want don't want to wait forever)

var ADTResponseReadyFlag = globalMap.get("ADTRESPONSEREADYFLAG");

if(debug)logger.info("Start Response Wait")
while(ADTResponseReadyFlag == "false")
  ADTResponseReadyFlag = globalMap.get("ADTRESPONSEREADYFLAG");
if(debug) logger.info("End Response Wait")
return globalMap.get("ADTRESPONSE");

Last edited by amith; 01-28-2014 at 08:27 AM. Reason: code blocking
Reply With Quote