Skip to contents

Cohort Generation

Functions that support generating cohorts.

runCohortGeneration()
Run a cohort generation and export results
generateCohortSet()
Generate a set of cohorts

Cohort Tables

Functions that support creating the necessary cohort tables.

createCohortTables()
Create cohort tables
getCohortTableNames()
Used to get a list of cohort table names to use when creating the cohort tables

Cohort Defintion Set

Functions that support working with a cohort definition set

saveCohortDefinitionSet()
Save the cohort definition set to the file system
getCohortDefinitionSet()
Get a cohort definition set
createEmptyCohortDefinitionSet()
Create an empty cohort definition set
checkAndFixCohortDefinitionSetDataTypes()
Check if a cohort definition set is using the proper data types
isCohortDefinitionSet()
Is the data.frame a cohort definition set?

Cohort Counts

Function for obtaining the counts of subjects and events for one or more cohorts

getCohortCounts()
Count the cohort(s)

Cohort Subset Functions

Functions for creating cohort subset definitions and subset operators.

addCohortSubsetDefinition()
Add cohort subset definition to a cohort definition set
createCohortSubset()
A definition of subset functions to be applied to a set of cohorts
createCohortSubsetDefinition()
Create Subset Definition
createDemographicSubset()
Create createDemographicSubset Subset
createLimitSubset()
Create Limit Subset
createSubsetCohortWindow()
A definition of subset functions to be applied to a set of cohorts
getSubsetDefinitions()
Get cohort subset definitions from a cohort definition set
saveCohortSubsetDefinition()
Save cohort subset definitions to json

Cohort Subset Classes

R6 classes for cohort subset definitions and subset operators.

CohortSubsetDefinition
Cohort Subset Definition
CohortSubsetOperator
Cohort Subset Operator
DemographicSubsetOperator
Demographic Subset Operator
LimitSubsetOperator
Limit Subset Operator
SubsetCohortWindow
Time Window For Cohort Subset Operator
SubsetOperator
Abstract base class for subsets.

Cohort Statistics

Functions for inserting inclusion rule names from a cohort definition, exporting the cohort statistics to the file system and a helper function for dropping those tables when they are no longer needed. These functions assume you are using Circe for inclusion rules and cohort statistics.

getCohortStats()
Get Cohort Inclusion Stats Table Data
getCohortInclusionRules()
Get Cohort Inclusion Rules from a cohort definition set
insertInclusionRuleNames()
Used to insert the inclusion rule names from a cohort definition set when generating cohorts that include cohort statistics
exportCohortStatsTables()
Export the cohort statistics tables to the file system
dropCohortStatsTables()
Drop cohort statistics tables

Negative Control Outcomes

Functions for creating negative control outcome cohorts for use in population-level estimation.

createEmptyNegativeControlOutcomeCohortSet()
Create an empty negative control outcome cohort set
generateNegativeControlOutcomeCohorts()
Generate a set of negative control outcome cohorts

Result Model Management

Functions for managing the results of running Cohort Generator via runCohortGeneration

createResultsDataModel()
Create the results data model tables on a database server.
getDataMigrator()
Get database migrations instance
getResultsDataModelSpecifications()
Get specifications for CohortGenerator results data model
migrateDataModel()
Migrate Data model
uploadResults()
Upload results to the database server.

CSV File Helpers

Functions for reading and writing CSV files to ensure adherance to the HADES standard when interfacing between R and SQL/File System: https://ohdsi.github.io/Hades/codeStyle.html#Interfacing_between_R_and_SQL

readCsv()
Used to read a .csv file
writeCsv()
Used to write a .csv file
isCamelCase()
Used to check if a string is in lower camel case
isSnakeCase()
Used to check if a string is in snake case
isFormattedForDatabaseUpload()
Is the data.frame formatted for uploading to a database?

Record Keeping

Functions that support record keeping of tasks performed. CohortGenerator uses these functions when running in incremental mode to only generate cohorts when their definition has changed from a previous run.

getRequiredTasks()
Get a list of tasks required when running in incremental mode
recordTasksDone()
Record a task as complete
isTaskRequired()
Is a task required when running in incremental mode
saveIncremental()
Used in incremental mode to save values to a file
computeChecksum()
Computes the checksum for a value

Cohort Sampling

Functions that support sampling a cohort. Please note this is only for software development purposes and NOT for running studies.

sampleCohortDefinitionSet()
Sample Cohort Definition Set