Currently, clinical events with no known "applicable" date are NULL in EMIS (this is the date we use in cohortextractor which represents the date the information applies to, rather than when it was entered). In TPP unknown dates default to 1900-01-01. This means that these events are treated differently in cohort-extractor: (a) events with null dates are excluded when an on-or-before date is entered, and (b) if no date limits are entered, a result is returned for all returning options other than date, which returns a null, not indicating that the patient had actually matched the given criteria.
We should consider implementing this as a FLOOR_DATE and (CEILING_DATE?) "constant" in code to make its intent clear. We will also need to be sure we add this in the right places in documentation.
Problem
Currently, clinical events with no known "applicable" date are NULL in EMIS (this is the date we use in cohortextractor which represents the date the information applies to, rather than when it was entered). In TPP unknown dates default to
1900-01-01
. This means that these events are treated differently in cohort-extractor: (a) events with null dates are excluded when anon-or-before
date is entered, and (b) if no date limits are entered, a result is returned for allreturning
options other thandate
, which returns a null, not indicating that the patient had actually matched the given criteria.Further discussion in this issue.
Solution
Convert null dates to
1900-01-01
(or make sure cohortextractor treats them as such).