Registers a cohort definition in cohort_definition and inserts qualifying subject
spans into cohort.
Usage
create_cohort(
con,
cohort_id,
cohort_name,
cohort_description = NULL,
entry_sql = NULL,
exit_rule = "fixed_days",
exit_offset_days = 0
)Arguments
- con
Active DuckDB DBI connection.
- cohort_id
Integer unique identifier for this cohort.
- cohort_name
Character display name for the cohort.
- cohort_description
Optional character description.
- entry_sql
SQL string returning candidate events with
person_id(orsubject_id) andstart_date(orcohort_start_date), and optionallyend_date.- exit_rule
Character, either
"fixed_days"(default) or"from_query".- exit_offset_days
Integer days added to
cohort_start_datewhenexit_rule = "fixed_days".
