This topic contains 4 replies, has 2 voices, and was last updated by  karim.samir 1 year, 11 months ago.

Querying patient data and return the results

  • I recently needed to be able to query for a patient details and return the results back to the sending application.
    The data should be returned in XML format, the sending application is a java file that has a socket connection to the iguana channel. The java file send the id value to the channel, then the channel query the database and create an XML object with patient details.

    My question is, how to return the results back to the sending application – java file?
    Is there any helpful resources for this scenario?

    Best Regards

    What protocol is used for the socket connection? Is it proprietary, or based on a standard like HTTP? Has the developer/vendor of the Java application provided any specifications for the method of communication?

    Your tag list seems to indicate the possibility of LLP as the enveloping mechanism, which suggests a message format of HL7 for the query. If HL7 is the message format, which HL7 version are you working with (i.e. 2.x vs. 3.x)?

    There are many articles in the iNTERFACEWARE wiki surrounding the parsing, creation and population of XML documents. Here is a good place to start.

    Jeff Drumm ◊ VP and COO ◊ HICG, LLC. ◊

    We use a simple protocol between the java application and the socket.

    The request will be like this

    And the response like:
    <firstName> FN </firstName>
    <lastName> LN </lastName>
    <DOB> date_of_birth </DOB>
    <Address> Address </Address>

    This is for testing only, on future we will use HL7 v2.8 protocol.


    What you’ve described would adapt to a RESTful web service very easily, but the Java application would need to generate a properly formed HTTP request to a “From HTTP” channel. In the “From HTTP” translator, you would parse the request with net.http.parseRequest{}, perform any actions based on the payload, and use net.http.respond{} to return the XML data to the Java application.

    If the expectation is that Iguana will function as the server/listener for a connection from the Java application using a non-HTTP mechanism, you will effectively need to use a “From LLP” endpoint with the Java application wrapping the request with the LLP envelope characters (those characters are configurable in Iguana). An ACK translator (one of the ACK types selectable in the channel configuration) can then be used to build the response, and that translator would then return the acknowledgement to the source application with ack.send().

    Jeff Drumm ◊ VP and COO ◊ HICG, LLC. ◊

    Thank you

    I will use the second option “From LLP” i think it meets my needs. also i found this tutorial in the documentation Query Response Example


    Best Regards

You must be logged in to reply to this topic.