
Last chance! 50% off unlimited learning
Sale ends in
Filter the cohort table keeping only the cohort records for which the required amount of time has passed since the last cohort entry ended for that individual.
requirePriorDrugWashout(
cohort,
days,
cohortId = NULL,
name = omopgenerics::tableName(cohort)
)
The cohort table having applied the washout requirement.
A cohort_table object.
The number of days required to have passed since the last cohort
record finished. Any records with fewer days than this will be dropped. Note
that setting days to Inf will lead to the same result as that from using the
requireIsFirstDrugEntry
function (with only an individual´s first cohort
record kept).
A cohort definition id to restrict by. If NULL, all cohorts will be included.
Name of the new cohort table, it must be a length 1 character vector.
# \donttest{
cdm <- mockDrugUtilisation()
cdm$cohort1 <- cdm$cohort1 |>
requirePriorDrugWashout(days = 90)
attrition(cdm$cohort1) |>
dplyr::glimpse()
# }
Run the code above in your browser using DataLab