-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Feature: Support for datetime calculations in cohort definitions #2886
New Feature: Support for datetime calculations in cohort definitions #2886
Comments
Note, SqlRender already supports DATEADD and some DATEDIFF calculations for non-day intervals. There is a pull request to add support for Spark and Oracle - and it should be possible to add support for other databases by simply updating the replacementPatterns.csv file (e.g. no R or Java changes needed). So, the level of effort to modify the SQL calls may be relatively small. Any place that currently uses |
Problem Statement
Multiple US electronic Clinical Quality Measure (eCQM) require datetime calculations when doing computations from electronic health records. Public domain examples are published here. The trend for needing datetime logic appears to be increasing.
In many cases, it is possible to create versions of those eCQM as Atlas cohorts, and then adapt the SQL to use datetime calculations instead of datetime. Although this may work for single institutions, it does not lend itself to developing these as phenotypes that can be run in a network study.
Examples:
Current Behavior
The Atlas GUI for selecting timespans (e.g. between two dates) only supports whole-number date logic.
Desired behavior
Augment the Atlas GUI to allow for whole number datetime interval logic, with options to specify "seconds", "minutes", "hours", or "days" instead of only "days".
For simplicity to the users, the internal logic should know to use datetime interval logic instead of date logic whenever "seconds", "minutes", or "hours" are selected. This would eliminate the need for cohort authors to choose between "index start date" and "index start datetime".
For example, if you want to know that an event occurred within 24 hours of admission, you would use an interval of 24 hours (which would use datetime logic) rather than 1 day (which would use date logic).
Here is example where I'd want to use 24 hours:
And here is example where I'd want to use minutes:
Feature Request Scope
Note, although not all data source have datetime-level data, the 5.3 OMOP data model and above all require datetime fields. By convention, those are populated with the same value that are in the matching data field. So, if this enhancement is added, phenotypes using seconds/minutes/hours should work (without breaking) on any 5.3 and above OMOP datasets. Data contributors would need to clarify which subset (if any) of their data has true datetime values, and Researchers would need to take that into consideration.
The text was updated successfully, but these errors were encountered: