powered by
It creates columns to indicate the presence of cohorts
addCohortIntersectFlag( x, targetCohortTable, targetCohortId = NULL, indexDate = "cohort_start_date", censorDate = NULL, targetStartDate = "cohort_start_date", targetEndDate = "cohort_end_date", window = list(c(0, Inf)), nameStyle = "{cohort_name}_{window_name}", name = NULL )
table with added columns with overlap information.
Table with individuals in the cdm.
name of the cohort that we want to check for overlap.
vector of cohort definition ids to include.
Variable in x that contains the date to compute the intersection.
whether to censor overlap events at a specific date or a column date of x.
date of reference in cohort table, either for start (in overlap) or on its own (for incidence).
date of reference in cohort table, either for end (overlap) or NULL (if incidence).
window to consider events of.
naming of the added column or columns, should include required parameters.
Name of the new table, if NULL a temporary table is returned.
# \donttest{ cdm <- mockPatientProfiles() cdm$cohort1 |> addCohortIntersectFlag( targetCohortTable = "cohort2" ) mockDisconnect(cdm = cdm) # }
Run the code above in your browser using DataLab