ohdsi-studies / Covid19SubjectsAesiIncidenceRate

Extending on our previous work by Li et al. in understanding the incidence rates of adverse events of special interest (AESI) for COVID-19, this work will look at the rates of these AESIs in patients who had COVDI-19 disease.
https://ohdsi-studies.github.io/Covid19SubjectsAesiIncidenceRate/Protocol.html
2 stars 4 forks source link

Missing Subgroups in IR #18

Closed ericaVoss closed 2 years ago

ericaVoss commented 2 years ago

Some of the IR reports run are missing subgroups in the run. Sent instructions via email asking for rerun.

ericaVoss commented 2 years ago

I'm not sure the reason why sometimes the data is missing subgroups - I just ask for a rerun.

anthonysena commented 2 years ago

The R function createCohortsAndRef seems to be the root cause of the problem here. Just documenting my findings for reference:

When calling createCohortsAndRef, the reference tables are created here. Later in the function, the subgroups are created here. Unlike the target/outcome cohorts, the SQL for creating the subgroups does 2 operations: it creates the reference table and then builds the subgrouped cohorts.

In the situation when you run createCohortsAndRef multiple times in incremental mode, the first time will create the subgroup_ref_table properly. Subsequent runs will wipe out the subgroup_ref_table and since the SQL for the subgroup construction has run already, the processing will skip it thus leaving the subgroup_ref_table table empty. Then later when the IR analysis runs, it attempts to create the combinations of target, subgroup, outcome and TAR cross-reference table by selecing from all of the reference tables, including the subgroup_ref_table here

ericaVoss commented 2 years ago

I believe V1.2.7 should fix this issue, but I want to make sure before I close the ticket.

ericaVoss commented 2 years ago

I would just run from a clean folder and rerun the whole thing.

Make sure the the version of the package you get is V1.2.7. image

I sometimes run these first just to double make sure the old package is gone:

#renv::deactivate()
#remove.packages("Covid19SubjectsAesiIncidenceRate")
#renv::purge("Covid19SubjectsAesiIncidenceRate")

Related to https://github.com/ohdsi-studies/Covid19SubjectsAesiIncidenceRate/issues/28