powered by
Date of cohorts that are present in a certain window
addCohortIntersectDate( x, targetCohortTable, targetCohortId = NULL, indexDate = "cohort_start_date", censorDate = NULL, targetDate = "cohort_start_date", order = "first", window = c(0, Inf), nameStyle = "{cohort_name}_{window_name}", name = NULL )
x along with additional columns for each cohort of interest.
Table with individuals in the cdm.
Cohort table to.
Cohort IDs of interest from the other cohort table. If NULL, all cohorts will be used with a time variable added for each cohort of interest.
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 interest in the other cohort table. Either cohort_start_date or cohort_end_date.
date to use if there are multiple records for an individual during the window of interest. Either first or last.
Window of time to identify records relative to the indexDate. Records outside of this time period will be ignored.
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 |> addCohortIntersectDate(targetCohortTable = "cohort2") mockDisconnect(cdm = cdm) # }
Run the code above in your browser using DataLab