OHDSI / CohortDiagnostics

An R package for performing various cohort diagnostics.
https://ohdsi.github.io/CohortDiagnostics
41 stars 48 forks source link

incidence_rate results csv not matching the table specification #1032

Closed anthonysena closed 3 days ago

anthonysena commented 1 year ago

CohortDiagnostics defines the incidence_rate table based on ref.

In reviewing the resulting incidence_rate.csv file, it appears that some fields are empty - for example, when producing an overall incidence rate that is not stratified by gender/age_group, you'll get something like this:

"cohort_count","person_years","gender","age_group","calendar_year","incidence_rate","cohort_id","database_id"
220227,41883569.8311,,,,5.258076159412607,10393,"-948018521"

I think the primary key definition of the incidence_rate table is correct and perhaps some additional formatting is required when producing the result such that an empty gender/age_group is given a designation (i.e. zero) to indicate that it is not used in that row? This is currently causing upload problems since the upload functionality in CD handles these cases by using an assumed value for these missing fields while the approach I've been working on will not make such an assumption.

azimov commented 3 days ago

This was related to an old issue with the primary key columns for strata and should now be resolved