powered by
Filter the cohort table keeping only the first cohort record per subject.
requireIsFirstDrugEntry( cohort, cohortId = NULL, name = omopgenerics::tableName(cohort) )
The cohort table having applied the first entry requirement.
A cohort_table object.
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 |> requireIsFirstDrugEntry() attrition(cdm$cohort1) |> dplyr::glimpse() # }
Run the code above in your browser using DataLab