OHDSI / WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications
Apache License 2.0
127 stars 166 forks source link

inconsistent generation of unrestrictive cohort definitions #114

Closed Sigfried closed 8 years ago

Sigfried commented 8 years ago

Testing on ohdsi web: http://www.ohdsi.org/web/atlas/#/cohortdefinition/2837 http://www.ohdsi.org/web/atlas/#/cohortdefinition/2838 These two cohort definitions are both empty. But generating one of them results in 836 distinct people and the other results in 0 people. (I saw the same behavior with a single criteria of Any Condition.)

When I first create the cohort definition and generate, I get 0 members. If I change the definition to something that would have members and then change back to an empty definition, then generation results in 836 members.

chrisknoll commented 8 years ago

@Sigfried , The 2387 definition isn't valid: it doesn't define any primary criteria. It's probably failing silently (which is a separate issue) but 2837 (with no primary criteria) is definitely not the same as the 2838 definition which sets the primary criteria to 'any condition'. The reason why you're getting 0 from the initial (without primary criteria) is that the results page is just doing a select count(*) from the cohort table looking for the cohort_definition_id. Whether the cohort was generated or not, that's the count that the query returns, in this case 0 rows were found so the members show up as 0.

I'm going to close this as not an issue with 'inconsistent generation of unrestrictive cohort definitions' because the empty cohort definition can't be generated in the first place. If there are other elements you would like to see improved such as error reporting or cohort definition validation, those should be opened up as separate issues so we can track them separately.

Sigfried commented 8 years ago

@chrisknoll , sorry, I left 2838 in a different state than 2837, but actually 2837 does have members. Maybe because it failed silently and kept the members it had previously. Still, if you go through the steps I outlined with a primary criteria of Any Condition, the problem occurs. Maybe it's too unusual to have such an unrestrictive definition, but the generation behavior is inconsistent.