Details
Description
When building queries for "Inpatient" visit dimension term, generated SQL no longer contains the visit date restriction parameters if dates are restricted on the front end. For example, we query simply "Inpatient" for 01/01/13 - 01/31/13 and get the same result as when we query with no date restrict for the same term. In 1.5, the date restrict worked on non-observation_fact terms, but on 1.6 it doesn't seem to function appropriately. Tested in the Partners demo domain with the same result. See below for 1) example of 1.5 query with visit dim date restrict and 2) example of 1.6 query with date restrict on the front end of the web client and workbench, but not in the generated SQL. Was this function deprecated for some reason with the upgrade to 1.6? I cannot find any documentation on this particular issue.
------------------------------------------------------------------------------------------------------------------------
INSERT INTO i2b2_did_crc.QUERY_GLOBAL_TEMP ( patient_num, panel_count)
SELECT patient_num, 1 FROM (
SELECT /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ patient_num FROM i2b2_did_crc.visit_dimension WHERE (((encounter_num IN (select encounter_num from i2b2_did_crc.visit_dimension c where inout_path LIKE '\i2b2\Visit Details\Inpatient\%')) AND start_date>= to_date('01-Jan-2013 00:00:00','DD-MON-YYYY HH24:MI:SS') ))
group by patient_num having count(*) >=1) t
<*>
INSERT INTO i2b2_did_crc.DX (patient_num) SELECT * FROM (
SELECT DISTINCT t.patient_num FROM i2b2_did_crc.QUERY_GLOBAL_TEMP t WHERE panel_count = 1
) q
<*>
------------------------------------------------------------------------------------------------------------------------------------------------------------
select count(distinct patient_num) as patient_num_count from (
(select patient_num ,1 as panel_count from ( select /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ patient_num from i2b2_did_crc.visit_dimension where encounter_num IN (select encounter_num from i2b2_did_crc.visit_dimension where inout_path LIKE '\i2b2\Visit Details\Inpatient\%' {ESCAPE '?'} ) group by patient_num ) t
)
) allitem
------------------------------------------------------------------------------------------------------------------------
INSERT INTO i2b2_did_crc.QUERY_GLOBAL_TEMP ( patient_num, panel_count)
SELECT patient_num, 1 FROM (
SELECT /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ patient_num FROM i2b2_did_crc.visit_dimension WHERE (((encounter_num IN (select encounter_num from i2b2_did_crc.visit_dimension c where inout_path LIKE '\i2b2\Visit Details\Inpatient\%')) AND start_date>= to_date('01-Jan-2013 00:00:00','DD-MON-YYYY HH24:MI:SS') ))
group by patient_num having count(*) >=1) t
<*>
INSERT INTO i2b2_did_crc.DX (patient_num) SELECT * FROM (
SELECT DISTINCT t.patient_num FROM i2b2_did_crc.QUERY_GLOBAL_TEMP t WHERE panel_count = 1
) q
<*>
------------------------------------------------------------------------------------------------------------------------------------------------------------
select count(distinct patient_num) as patient_num_count from (
(select patient_num ,1 as panel_count from ( select /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ patient_num from i2b2_did_crc.visit_dimension where encounter_num IN (select encounter_num from i2b2_did_crc.visit_dimension where inout_path LIKE '\i2b2\Visit Details\Inpatient\%' {ESCAPE '?'} ) group by patient_num ) t
)
) allitem
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 1.7.02 [ 10091 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Workflow | classic default workflow [ 10218 ] | i2b2 Issues [ 10404 ] |
Component/s | CRC Cell [ 10000 ] | |
i2b2 Feature/s | Queries [ 10081 ] |
i2b2 Feature/s | Queries [ 10081 ] | Constraints - Date,Queries [ 10079, 10081 ] |
Workflow | i2b2 Issues [ 10404 ] | i2b2 Issues Workflow [ 10475 ] |
Component/s | CRC Cell [ 10049 ] | |
Component/s | CRC Cell [ 10000 ] | |
Fix Version/s | 1.7.02 [ 10155 ] | |
Fix Version/s | 1.7.02 [ 10091 ] | |
Key |
|
|
Project | i2b2 [ 10000 ] | i2b2 Core Project [ 10034 ] |
Affects Version/s | 1.6.08 [ 10149 ] | |
Affects Version/s | 1.6.08 [ 10074 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |