No announcement yet.

QRY channels

  • Filter
  • Time
  • Show
Clear All
new posts

  • QRY channels

    Hi all,

    I'm trying to develope a channel for patient info query using HL7 QRY messages. At this point, I know that I should use a LLP source channel for message listenning, but if I should execute a SP for data recovery, how can I answer those messages in the same channel (synchronously)?. What channel structure should I deploy?.

    LLP listener->channel writer->channel listener->???

    Somebody could help me?. Mmm...maybe any chance on javascript?

    Any help will be great!.

    Ricard Bernat

  • #2
    Re:QRY channels

    Hi Ricard!

    I think that the best aproximation to fit your needs is:

    * define a channel with a LLP Listener and a destination with type "Database writer".
    * define a transformer step in the source or in the destination, with type "JS transformer". You should define inside this JS transformer a mapping that links the type of QRY message and the SP that should be called. I guess that you're using different SPs for each type of QRY message. In this transformer you can put a code like

    var SP_called;
    ( if msg[XX][XX.23] == 'getA' ) {
    SP_called ="getA" }
    else if ...


    And, at the end of the transformer step, you can use the ChannelMap functions to let the "SP_called" variable visible from the destination code.

    * In the destination, use a JS-type Database Writer.
    Open the connection, as usual but get the SP to be called from the channel Map that you have previously stored. Then call this SP with a "exec " statement and put the results (if needed) of the SP to the ChannelMap again.

    * In the postprocessor step, create a "virtual destination" called CustomResponse or something like this. From this zone of the channel, you can get the results of the desatination execution, the results of executing the SP, and the type of the message. Using these values, you're able to create a custom HL7 response depending on the values of the above variables.

    * Finally, in the source "LLP Listener", setup to send the ACK from destination "CustomResponse", to send back the HL7 message you've created in the postprocessor step to the original sender

    And thats all

    I think that this may work for you. Currently I'm developing a channel that uses a very close structure, but designed to manage the different type of ACK messages.

    hope that helps.


    • #3
      Re:QRY channels

      Hi quimicefa,

      ok but, can I do same thing on source transformer executing SP on itself and sending all data recovered to destination?.


      Ricard Bernat


      • #4
        Re:QRY channels

        Definitely yes. But I'd rather split the JS code into tranformer, destination and postprocessor because in case of problems it's easier to debug (you can see in the channel Map which values have the different variables).

        As far as I know, you cannot access the execution status of a transformer from a destination, so, this way there is not an easy way to react if there was a problem calling the SP.