OHDSI / CohortDiagnostics

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

Date format sqlite database #1060

Open abbynewbury opened 1 year ago

abbynewbury commented 1 year ago

Should all dates in a sqlite3 database be in 'unixepoch' format prior to running CohortDiagnostics? My dates are currently in ISO-8601 format and when running CohortDiagnostics, the code stops after the GetCalendarYearRange.sql file since the returned yearRange is null. The specific sql query run by GetCalendarYearRange.sql is "SELECT CAST(STRFTIME('%Y', MIN(observation_period_start_date), 'unixepoch') AS INT) AS start_year,CAST(STRFTIME('%Y', MAX(observation_period_end_date), 'unixepoch') AS INT) AS end_year FROM main.observation_period;" which I believe is assumes that the existing dates are in unixepoch format. Thanks!