# \donttest{
library(omock)
library(dplyr)
# Create a mock cohort table
cohort <- tibble(
cohort_definition_id = c(1, 1, 2, 2, 1, 3, 3, 3, 1, 3),
subject_id = c(1, 4, 2, 3, 5, 5, 4, 3, 3, 1),
cohort_start_date = as.Date(c(
"2020-04-01", "2021-06-01", "2022-05-22", "2010-01-01", "2019-08-01",
"2019-04-07", "2021-01-01", "2008-02-02", "2009-09-09", "2021-01-01"
)),
cohort_end_date = cohort_start_date
)
# Generate a mock CDM from preexisting CDM structure and cohort table
cdm <- mockCdmFromTables(cdm = mockCdmReference(), tables = list(cohort = cohort))
# Access the newly integrated cohort table and the standard person table in the CDM
print(cdm$cohort)
print(cdm$person)
# }
Run the code above in your browser using DataLab