Query+Response in the same port (QRY A19 + ADR A19)

Hello guys,

I'm trying to achieve the same at this guy:
https://groups.google.com/forum/#!topic/ensemble-in-healthcare/Hw9cRgVTTGY

But I couldn't actually figure out how to save the calling application port and then use it in the Business Service to forward the complete response (ADR A19) onto the same port that made the request.

I know it isn't possible to forward message from a Business Process back to a Business Service.

Can you help me out?

Thanks!

  • 0
  • 332
  • 0
  • 1

Answers

Hi Murillo,

It is possible to return messages back to your service.

HL7 TCP services have a setting called "Ack Mode", found under "Additional Settings".

By default, this is set to immediate which will produce an automated HL7 ACK at the time the message is received.

To return an ADR A19 message from a process/operation as an ACK to a QRY A19 then you need to change this setting to "Application".

You don't mention how the ADR A19 is generated. I will assume two possibilities.

1. The operation sends the QRY A19 to an upstream system, which returns the ADR A19 message as its ACK.

In this instance wire up the service to the operation directly (using application mode) and it will just work.

Note, operations have a setting called "Reply Code Actions". If the upstream system returns an error ACK then by default Ensemble will fail the message and the ACK will not make it back down stream. Most likely, these types of ADR A19 message do need to make it back with the error message, so change the reply code error action to "W", which will log a warning, but treat the message as ok.

2. The operation is querying a database, for example, SQL server.

The operations OnMessage (or message map method) has a request and response argument. You will need to make the response argument of type EnsLib.HL7.Message. The operation should perform the SQL query and then use the resultset data to create the EnsLib.HL7.Message ADR A19 message. This will be returned by reference as the response argument.

Note, if you are using an HL7 router between the service and the operation, you will also need to configure the "Response From" setting so the router understands which operation it should expect an ACK from (as some messages will be routed to multiple targets).

Also, routers provide segment validation of messages. If the inbound QRY A19 message is malformed then the router will become responsible for producing an error ACK message. If you want to shift this responsibility upstream (pass-through solutions) then either wire up the service directly to the operation or change the "Validation" settings.

Hope that helps...

Sean