I am trying to set up i2b2 to use multi fact tables. I've been following the instructions here:
https://community.i2b2.org/wiki/display/MFT/Multi-fact+Table+Home?preview=%2F339480%2F339493%2Fmultifact-setup-guide.pdf
Everything went well, I created several fact tables and updated the c_facttablecolumn column in ontology tables. I can run queries in the webclient etc.
However, when running queries that have terms from the Providers ontology, I noticed that the generated sql only looks for providers in the observation_fact table, so none of the other fact tables (see sql below). Needless to say, the patient count returned is incorrect.
Has anybody run into this issue? Is there something I'm missing with the setup?
Any suggestions are appreciated.
Thank you.
Eg.
with t as (
select f.patient_num
from i2b2crcdata.dbo.observation_fact f
where
f.provider_id IN (select provider_id from i2b2crcdata.dbo.provider_dimension where provider_path LIKE '\i2b2\Providers\Hospitalist\%')
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