Returns the IDs of patients who are active at a given stage (or who were excluded for a specific reason at a given stage).
Arguments
- tracker
An
hv_consort_tracker.- stage
Character – either the
include_colname (e.g."eligible") or the stage label (case-insensitive, e.g."Eligible").- reason
Optional character. If supplied, returns patients excluded from this stage for the specified reason (the string must exactly match a value in the exclusion column). The
stagearg then refers to the stage before the exclusion (e.g."screened"forexcl_screen).
Examples
tracker <- hv_consort_start(data.frame(id = 1:10, age = c(rep(15,3), rep(30,7))),
patient_id = id) |>
hv_consort_exclude(label = "Eligible", col = "excl_screen",
age < 18 ~ "Age < 18")
hv_consort_patients(tracker, "eligible")
#> [1] "4" "5" "6" "7" "8" "9" "10"
hv_consort_patients(tracker, "screened", reason = "Age < 18")
#> [1] "1" "2" "3"