Pass Query Parameter to inbound Database thread

Clovertech Forums Cloverleaf Pass Query Parameter to inbound Database thread

  • Creator
    Topic
  • #122234
    Ken Smith
    Participant

      I am trying perform a SELECT against a database table using the inbound database thread. I want to implement a where clause to select based upon patient ID, e.g.:

      SELECT name, DOB from tblPatient where tblPatient.PatientID = patientID

      In this case “patientID” is a value in a vrl (mapped from an HL7 msg). The message passed to the database thread is in that vrl format

      I’ve tried setting it as <patientID>, similar to a db lookup table it errors on the “<”

      I’ve also tried adding the vrl name, e.g, patientVRL.patientID

      Is there a way to get this to accept a parameter on the SELECT?

    Viewing 2 reply threads
    • Author
      Replies
      • #122235
        Diana de Bruin
        Participant

          You could try using a Database Lookup Table in your .xlt but because this wil only give you 1 return parameter, I think you should use a select statement that combines name and DOB in 1 result field so you can parse that field in an extra .xlt action (either use a post_proc or an @temp_var to process the results in another actions)

          Diana

           

          LUMC -Leiden University Medical Centre
          The Netherlands

        • #122236
          Ken Smith
          Participant

            Thanks but the problem is not getting fields/columns from the table but getting the db thread to accept a parameter that feeds into the WHERE clause. I want to filter on patient and can’t get the thread to run that query.

            I did think about the db lookup table, but I will receive a variable number of rows which would return, I think, as a list into the outbound message. With the data I am hoping to return, the list would be extremely awkward.

          • #122237
            Ken Smith
            Participant

              As I look at it again, it appears the inbound db thread simply doesn’t accept an inbound message so barking up the wrong tree. The outbound db thread does

          Viewing 2 reply threads
          • You must be logged in to reply to this topic.