
Flag observation periods that pile up on one end date
Source:R/cohort.R
check_observation_period_ends.RdThe signature of events filled with the build date. The latest period-end date is compared with the median number of
periods ending per day over the preceding 30 days that have any. It is flagged when at least min_periods periods end
on it and the count is min_ratio times that median (a genuine data cutoff holds about one ordinary day of ends). The
share of all periods is deliberately not tested: 33 ends against a typical day of 1 is unmistakable even when it is
0.015% of 200,000 periods. define_study_cohort() and extract_patient_features() call this.
Arguments
- con
Active DuckDB connection.
- warn
If
TRUE, a flagged result also raises a warning namingcap_observation_period().- min_ratio
Times the typical daily count the latest end date must reach.
- min_periods
Fewest periods that must end on the latest date.