National-COVID-Cohort-Collaborative / Phenotype_Data_Acquisition

The repository for code and documentation produced by the N3C Phenotype and Data Acquisition workstream
60 stars 35 forks source link

PhenotypeScripts: OMOP SQL bug? #172

Closed mgkahn closed 3 years ago

mgkahn commented 3 years ago

Present in all OMOP versions of the PhenotypeScript preventing completion of Phenotype 3.0 cohort:

Table n3c_case_cohort does not have field named case_person_id but subquery on line 833 (in bigquery script) references n3c_case_cohort.case_person_id. Should this subquery reference n3c_control_map which does that this field defined?

image image
empfff commented 3 years ago

This is a good catch, this did not throw an error in other dialects b/c it was inside a "NOT IN" statement. We updated it in all the scripts. The change to make is to change case_person_id in the WHERE in the subquery to person_id. Let us know if we can clarify.