Details
-
Bug
-
Status: New
-
Critical
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
If the ontology term has a single apostrophe in it, and it is early enough in the term that it is included in the path, the query will result in an error and will not run. Below is a Generated SQL example that will cause the error:
with t as (
select f.patient_num
from i2b2crcdata.dbo.diag_obs_fact f
where
f.concept_cd IN (select concept_cd from i2b2crcdata.dbo.concept_dimension where concept_path LIKE '\Diagnoses\(A00-B99) Cert~ugmm\(B50-B64) Prot~crln\(B57) Chagas'~ppxe\%')
group by f.patient_num
)
insert into #global_temp_table (patient_num, panel_count)
select t.patient_num, 0 as panel_count from t
<*>
insert into #dx ( patient_num ) select * from ( select distinct patient_num from #global_temp_table where panel_count = 0 ) q
with t as (
select f.patient_num
from i2b2crcdata.dbo.diag_obs_fact f
where
f.concept_cd IN (select concept_cd from i2b2crcdata.dbo.concept_dimension where concept_path LIKE '\Diagnoses\(A00-B99) Cert~ugmm\(B50-B64) Prot~crln\(B57) Chagas'~ppxe\%')
group by f.patient_num
)
insert into #global_temp_table (patient_num, panel_count)
select t.patient_num, 0 as panel_count from t
<*>
insert into #dx ( patient_num ) select * from ( select distinct patient_num from #global_temp_table where panel_count = 0 ) q