Creates a set of predefined cohorts in a cohort table. WARNING: this will delete all existing cohorts in the table!
createCohorts(
connectionDetails,
cdmDatabaseSchema = "main",
cohortDatabaseSchema = "main",
cohortTable = "cohort"
)
The connection details to connect to the (Eunomia) database.
The name of the database schema holding the CDM data.
The name of the database schema where the cohorts will be written.
The name of the table in the cohortDatabaseSchema where the cohorts will be written.
A data frame listing all created cohorts.
connectionDetails <- getEunomiaConnectionDetails()
createCohorts(connectionDetails)
connection <- connect(connectionDetails)
sql <- "SELECT COUNT(*)
FROM main.cohort
WHERE cohort_definition_id = 1;"
renderTranslateQuerySql(connection, sql)
disconnect(connection)