Package: CohortGenerator 1.1.0

Anthony Sena

CohortGenerator: Cohort Generation for the OMOP Common Data Model

Generate cohorts and subsets using an Observational Medical Outcomes Partnership (OMOP) Common Data Model (CDM) Database. Cohorts are defined using 'CIRCE' (<https://github.com/ohdsi/circe-be>) or SQL compatible with 'SqlRender' (<https://github.com/OHDSI/SqlRender>).

Authors:Anthony Sena [aut, cre], Jamie Gilbert [aut], Gowtham Rao [aut], Freddy Avila Cruz [aut], Martijn Schuemie [aut], Observational Health Data Science and Informatics [cph]

CohortGenerator_1.1.0.tar.gz
CohortGenerator_1.1.0.zip(r-4.7)CohortGenerator_1.1.0.zip(r-4.6)CohortGenerator_1.1.0.zip(r-4.5)
CohortGenerator_1.1.0.tgz(r-4.6-any)CohortGenerator_1.1.0.tgz(r-4.5-any)
CohortGenerator_1.1.0.tar.gz(r-4.7-any)CohortGenerator_1.1.0.tar.gz(r-4.6-any)
CohortGenerator_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
CohortGenerator/json (API)

# Install 'CohortGenerator' in R:
install.packages('CohortGenerator', repos = c('https://ohdsi.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ohdsi/cohortgenerator/issues

Pkgdown/docs site:https://ohdsi.github.io

Uses libs:
  • openjdk– OpenJDK Java runtime, using Hotspot JIT
Datasets:

On CRAN:

Conda:

hadesopenjdk

8.50 score 14 stars 269 scripts 561 downloads 66 exports 55 dependencies

Last updated from:62a8a0ba25. Checks:7 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING221
source / vignettesOK413
linux-release-x86_64WARNING234
macos-release-arm64WARNING150
macos-oldrel-arm64WARNING158
windows-develWARNING216
windows-releaseWARNING2850
windows-oldrelWARNING173
wasm-releaseOK155

Exports:addCohortSubsetDefinitionaddCohortTemplateDefintionaddExcludeOnIndexSubsetDefinitionaddIndicationSubsetDefinitionaddRestrictionSubsetDefinitionaddSqlCohortDefinitionaddUnionCohortDefinitioncheckAndFixCohortDefinitionSetDataTypesCohortSubsetDefinitionCohortSubsetOperatorCohortTemplateDefinitioncomputeChecksumcomputeCohortAttritioncreateAtcCohortTemplateDefinitioncreateCohortSubsetcreateCohortSubsetDefinitioncreateCohortSubsetOperatorcreateCohortTablescreateCohortTemplateDefintioncreateDemographicSubsetcreateDemographicSubsetOperatorcreateEmptyCohortDefinitionSetcreateEmptyNegativeControlOutcomeCohortSetcreateLimitSubsetcreateLimitSubsetOperatorcreateResultsDataModelcreateRxNormCohortTemplateDefinitioncreateSnomedCohortTemplateDefinitioncreateSubsetCohortWindowcreateUnionCohortTemplateDemographicSubsetOperatordropCohortStatsTablesexportCohortStatsTablesexportCohortSubsetStatsTablesgenerateCohortSetgenerateNegativeControlOutcomeCohortsgetCohortCountsgetCohortDefinitionSetgetCohortInclusionRulesgetCohortStatsgetCohortTableNamesgetCohortValidationCountsgetDataMigratorgetExcludeOnIndexSubsetDefinitionIdsgetIndicationSubsetDefinitionIdsgetLastGeneratedCohortChecksumsgetRestrictionSubsetDefinitionIdsgetResultsDataModelSpecificationsgetSubsetDefinitionsgetTemplateDefinitionsinsertInclusionRuleNamesisCamelCaseisCohortDefinitionSetisFormattedForDatabaseUploadisSnakeCaseLimitSubsetOperatormigrateDataModelreadCsvrunCohortGenerationsampleCohortDefinitionSetsaveCohortDefinitionSetsaveCohortSubsetDefinitionSubsetCohortWindowSubsetOperatoruploadResultswriteCsv

Dependencies:backportsbitbit64blobcheckmateclicliprcpp11crayonDatabaseConnectorDBIdbplyrdigestdplyrfastmapgenericsgluehmsjsonlitelaterlifecyclelubridatemagrittrmemuseParallelLoggerpillarpkgconfigpoolprettyunitsprogresspurrrR6RcppreadrResultModelManagerrJavarlangrstudioapisnowSqlRenderstringistringrtibbletidyrtidyselecttimechangetriebeardtzdburltoolsutf8vctrsvroomwithrxml2zip

Creating Cohort Subset Definitions
Introduction | Subset Operators | Subset Definition | Creating cohort subset definitions | Cohort Definition Set | Subset operators | Create the subset definition | Adding subsets to Cohort Definition Set | Generating subsets | Visualizing subset membership | Saving and loading subset definitions | Saving to packages/directories | Writing json objects

Last update: 2026-02-10
Started: 2023-03-10

Generating Cohorts
Guide for generating cohorts using CohortGenerator | Basic Example | Loading a cohort definition set from ATLAS | Loading an example cohort definition set | Saving in a study package | Advanced Options | Cohort Statistics (Inclusion Rule Statistics) | Incremental Mode

Last update: 2026-02-10
Started: 2021-12-15

Using Template Cohorts
Introduction | Limitations of this approach | Basic SQL templates | Validating custom sql cohorts | Built in large scale definitions | Drug ingredient cohorts | ATC Base cohorts | SNOMED condition cohorts | Creating custom cohort templates | Generating the cohorts | On execution order | Conclusion

Last update: 2026-02-10
Started: 2025-11-12

Sampling Cohorts
Sampling with CohortGenerator | Sampling method | Using the sampler functions

Last update: 2025-11-12
Started: 2024-05-28

Readme and manuals

Help Manual

Help pageTopics
Add cohort subset definition to a cohort definition setaddCohortSubsetDefinition
Add Cohort template definition to cohort setaddCohortTemplateDefintion
Add exclude on index subset definitionaddExcludeOnIndexSubsetDefinition
Add Indication Subset DefinitionaddIndicationSubsetDefinition
Add Restriction Subset DefinitionaddRestrictionSubsetDefinition
Add an sql cohort definitionaddSqlCohortDefinition
Add union cohort definition to cohort definition setaddUnionCohortDefinition
Check if a cohort definition set is using the proper data typescheckAndFixCohortDefinitionSetDataTypes
Cohort Subset DefinitionCohortSubsetDefinition
Cohort Subset OperatorCohortSubsetOperator
Class for automating the creation of bulk cohortsCohortTemplateDefinition
Computes the checksum for a valuecomputeChecksum
Compute cohort attrition from inclusion rule statisticscomputeCohortAttrition
Create ATC Cohort Template DefinitioncreateAtcCohortTemplateDefinition
Create Cohort Subset OperatorcreateCohortSubset
Create Subset DefinitioncreateCohortSubsetDefinition
A definition of subset functions to be applied to a set of cohortscreateCohortSubsetOperator
Create cohort tablescreateCohortTables
Create Cohort Template DefinitioncreateCohortTemplateDefintion
Create Demographic Subset OperatorcreateDemographicSubset
Create createDemographicSubset Subset operatorcreateDemographicSubsetOperator
Create an empty cohort definition setcreateEmptyCohortDefinitionSet
Create an empty negative control outcome cohort setcreateEmptyNegativeControlOutcomeCohortSet
Create Limit Subset OperatorcreateLimitSubset
Create Limit Subset OperatorcreateLimitSubsetOperator
Create the results data model tables on a database server.createResultsDataModel
Create Rx Norm Cohort Template DefinitioncreateRxNormCohortTemplateDefinition
Create SNOMED Cohort Template DefinitioncreateSnomedCohortTemplateDefinition
Create a relative time window for cohort subset operationscreateSubsetCohortWindow
Create cohort template to union multiple cohortscreateUnionCohortTemplate
Demographic Subset OperatorDemographicSubsetOperator
Drop cohort statistics tablesdropCohortStatsTables
Export the cohort statistics tables to the file systemexportCohortStatsTables
Export cohort subset statistics tables to the file systemexportCohortSubsetStatsTables
Generate a set of cohortsgenerateCohortSet
Generate a set of negative control outcome cohortsgenerateNegativeControlOutcomeCohorts
Count the cohort(s)getCohortCounts
Get a cohort definition setgetCohortDefinitionSet
Get Cohort Inclusion Rules from a cohort definition setgetCohortInclusionRules
Get Cohort Inclusion Stats Table DatagetCohortStats
Used to get a list of cohort table names to use when creating the cohort tablesgetCohortTableNames
Validate cohortgetCohortValidationCounts
Get database migrations instancegetDataMigrator
Get Exclude On Index Subset Definition IdsgetExcludeOnIndexSubsetDefinitionIds
Get Indication Subset Definition IdsgetIndicationSubsetDefinitionIds
Get last generated cohort checksumsgetLastGeneratedCohortChecksums
Get Restriction Subset Definition IdsgetRestrictionSubsetDefinitionIds
Get specifications for CohortGenerator results data modelgetResultsDataModelSpecifications
Get cohort subset definitions from a cohort definition setgetSubsetDefinitions
Extract template definitions from a cohort definition setgetTemplateDefinitions
Used to insert the inclusion rule names from a cohort definition set when generating cohorts that include cohort statisticsinsertInclusionRuleNames
Used to check if a string is in lower camel caseisCamelCase
Is the data.frame a cohort definition set?isCohortDefinitionSet
Is the data.frame formatted for uploading to a database?isFormattedForDatabaseUpload
Used to check if a string is in snake caseisSnakeCase
Limit Subset OperatorLimitSubsetOperator
Migrate Data modelmigrateDataModel
OMOP CDM Drug Exposure Sample DataomopCdmDrugExposure
OMOP CDM Person Sample DataomopCdmPerson
Used to read a .csv filereadCsv
Run a cohort generation and export resultsrunCohortGeneration
Sample Cohort Definition SetsampleCohortDefinitionSet
Save the cohort definition set to the file systemsaveCohortDefinitionSet
Save cohort subset definitions to jsonsaveCohortSubsetDefinition
Time Window For Cohort Subset OperatorSubsetCohortWindow
Abstract base class for subsets.SubsetOperator
Upload results to the database server.uploadResults
Used to write a .csv filewriteCsv