createCohorts: Construct cohorts

Description Usage Arguments Value Examples

View source: R/Cohorts.R

Description

Creates a set of predefined cohorts in a cohort table. WARNING: this will delete all existing cohorts in the table!

Usage

1
2
3
4
5
6
createCohorts(
  connectionDetails,
  cdmDatabaseSchema = "main",
  cohortDatabaseSchema = "main",
  cohortTable = "cohort"
)

Arguments

connectionDetails

The connection details to connect to the (Eunomia) database.

cdmDatabaseSchema

The name of the database schema holding the CDM data.

cohortDatabaseSchema

The name of the database schema where the cohorts will be written.

cohortTable

The name of the table in the cohortDatabaseSchema where the cohorts will be written.

Value

A data frame listing all created cohorts.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
connectionDetails <- getEunomiaConnectionDetails()
createCohorts(connectionDetails)

connection <- connect(connectionDetails)

sql <- "SELECT COUNT(*)
FROM main.cohort
WHERE cohort_definition_id = 1;"

renderTranslateQuerySql(connection, sql)

disconnect(connection)

Eunomia documentation built on Nov. 8, 2020, 4:39 p.m.