James Fitzpatrick · Feb 10, 2020

Process Response for HL7 Message Router


I am playing around with an HL7 business rule set and a EnsLib.HL7.MsgRouter.RoutingEngine component. I'm wondering how I can get the routing engine to fire a rule when a response is received from a business operation.

I have a simple "debug" statement in my rule to log the "Source" value when a message is received. This debug statement only seems to fire when the message comes as a request from the business service (trace item #1 below). However, I want to fire a rule when a response is received from a specific business operation (item #6 below) - specifically, I  want to execute a DTL just on that response data. Is there a way to do this within the same routing engine?

One workaround I see with this is to add a new target to the "Response Target Config Names", but trying to  avoid using another business process here.


1 416
Discussion (6)1
Log in or sign up to continue

What do you have set for the Response From and Response Target Config Names fields in the router's configuration? I'm thinking the former should be the operation from which you're receiving the response, and the latter should be the router itself.

Thanks for the suggestion, Jeffrey.

I did try this out before, but this causes the messages to get caught in a loop. That is because after the router receives the response (#7 below), it will send a response to a new target specified by the rule set (new target = boHL7FileOut). But because Response From has some value, the router will generate a local response after some time and then send that response to itself...going on and on.

From the Response From property documentation: 

"If none of the listed targets gets called or the replying target does not return a document, this router will generate an ACK response if needed."

Is there some other way to control when the router should generate a local response? 

Seems to work fine if you route the ACK to another Business Process. For the router handling messages from an inbound service:

Response comes in from TestTCPOut; the received ACK is sent to the original service and forwarded to a BP called AckWrangler. That BP runs a routing rule that optionally transforms the ACK and passes it off to another operation called AckTarget:

Yeah, I think this is the only way to do it without customizing any of the Ensemble classes. You would need a different business process handling the ACK processing. Thanks for the responses!

Hi James,

You must have seen the documentation of rules, they are not supposed to handle responses. They are only there to "ROUTE". Responses need to be handled in BP's 

Once the ACK is received by the Router, it's forwarded as a Request object to the ResponseTargetConfigName list, so at that point it's just like any other message. No need for BPLs in this specific instance.