Checks a cohort against the domain invariants: controlled vocabularies for
sex, injury_region, triage and therapy; life_points inside
1:6; unique non-missing id; and a positive whole arrival_order. All
violations across all columns are collected and reported together.
Usage
validate_cohort(x, call = rlang::caller_env())Arguments
- x
A
cohortfromsdt_cohort().- call
The calling environment, used to attribute the error.
Examples
co <- sdt_cohort(sdt_synthetic_cohort(n = 5, seed = 1))
validate_cohort(co)