5 Replies Latest reply on Sep 19, 2014 6:57 AM by jas.singh

    How to use a scanned barcode as a SQL parameter

    jas.singh

      Hello World

       

      I've set up a layout that prompts the user to scan a barcode using FM Go on an iPOD

       

      I would like to use this barcode (returns 7 digit number) as parameter that would then query a SQL database (added to environment via ESS)

       

      It should then reurn the values and add them to the relevant fields (eg. Forename/Surname/DOB/Gender etc)

       

      App scans the barcode and add it to field on the layout called LabNo

       

      OnObjectExit (LabNo) I'm running a script 'GetPatientDemographics

       

      SELECT RXKNumber, Surname, Forename, Sex, DOB

      FROM Orders

      WHERE LabNo = ?

      "

      ;"";""; )

       

       

       

      I've tried adding the parameter as follows

      SELECT RXKNumber, Surname, Forename, Sex, DOB

      FROM Orders

      WHERE LabNo = ?

      "

      ;"";"";MyLayoutName::LabNo )

       

       

      tried to run the below in DataViewer

      ExecuteSQL(

      "

      SELECT RXKNumber, Surname, Forename, Sex, DOB

      FROM Orders

      WHERE ShortLabCode = ?

      FETCH FIRST 1 ROW ONLY

      "

      ;"";""; Orders::LabNo)

       

      any advice greatly appreciated

       

      Thanks