Hi,
I'm facing some weird issue with the DIS-style queries I'm sending while
using xmlps.
Case:
DIS-style query1:
prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND loc_nurse_unit_cd_desc_1 =
'PICU'
Gets converted to the SQL-query:
SELECT person.mrn as mrn,person.birth_dt_tm as birth_dt_tm FROM encounter
INNER JOIN person ON person.person_id = encounter.person_id INNER JOIN
encntr_loc_hist ON encntr_loc_hist.encntr_id = encounter.encntr_id WHERE
encntr_loc_hist.loc_nurse_unit_cd_desc = 'PICU'
Result: I get valid outputs.
----------
DIS-style query2:
prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND loc_nurse_unit_cd_desc_1 =
'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'
Converted SQL-query:
SELECT person.mrn as mrn,person.birth_dt_tm as birth_dt_tm FROM encounter
INNER JOIN person ON person.person_id = encounter.person_id INNER JOIN
encntr_loc_hist ON encntr_loc_hist.encntr_id = encounter.encntr_id
WHERE (encntr_loc_hist.loc_nurse_unit_cd_desc
= PICU2 AND encntr_loc_hist.loc_nurse_unit_cd_desc = 'PICU')
Result: Invalid column name 'PICU2'. In the above converted SQL-query the
single quotes disappears around PICU2.
----------
DIS-style query3: Added parenthesis to DIS-style query2
prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND {loc_nurse_unit_cd_desc_1 =
'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'}
Converted SQL-query:
SELECT person.mrn as mrn,person.birth_dt_tm as birth_dt_tm FROM encounter
INNER JOIN person ON person.person_id = encounter.person_id INNER JOIN
encntr_loc_hist ON encntr_loc_hist.encntr_id = encounter.encntr_id WHERE
(encntr_loc_hist.loc_nurse_unit_cd_desc = PICU2 OR
encntr_loc_hist.loc_nurse_unit_cd_desc = 'PICU')
Result: Invalid column name 'PICU2'. Again, no single quotes around PICU2.
I tried the above cases with LIKE and the single quotes still does not
appear. Is there a proper way of defining the DIS-style queries to correct
this?
Thanks,
Sheryl