I've been trying this today, but I couldn't find the solution. I work on a J2EE application that runs under JBoss with EJB, datasources to the DB,... but I have no HL7 tool yet; that's why I tried Mirth.

I want my clients to send their HL7 messages on a socket and got their answer on the same socket. Let's do it with an example: a third party application (a labo application) sends a QRY^A19 using the LLP to have a list of patient according to a criteria. I have to sent a ADR^A19 back with that list of patients. But as my patients are managed in my central application, I don't want to re-write all my queries in Mirth to have my object "Patient"; I'd like to reuse my own classes to make the JDBC interaction.

1. Is it possible to do this? I don't have a clue of what I have to do... I will certainly need an adapter between the ADR^A19 and my application, but I don't know how to integrate it in Mirth.

2. I have to send my response on the same socket (on the outptstream). How can I do this? I tried using a LLP Writer as destination with the same IP and the same port than the LLP Reader as source, but it didn't work...

Don't know if my question is clear, but I'd really like to find a solution as Mirth could be a very powerful answer to my HL7 compatibility problem.