Skip to contents

Introduction

Cohorts are a fundamental building block for studies that use the OMOP CDM, identifying people who satisfy one or more inclusion criteria for a duration of time based on their clinical records. Currently cohorts are typically built using CIRCE which allows complex cohorts to be represented using JSON. This JSON is then converted to SQL for execution against a database containing data mapped to the OMOP CDM. CIRCE JSON can be created via the ATLAS GUI or programmatically via the Capr R package. However, although a powerful tool for expressing and operationalising cohort definitions, the SQL generated can be cumbersome especially for complex cohort definitions, moreover cohorts are instantiated independently, leading to duplicated work.

The CohortConstructor package offers an alternative approach, emphasizing cohort building in a pipeline format. It first creates base cohorts and then applies specific inclusion criteria. Unlike the “by definition” approach, where::here cohorts are built independently, CohortConstructor follows a “by domain” approach, which minimizes redundant queries to large OMOP tables. More details on this approach can be found in the Introduction vignette.

We benchmarked this package using nine phenotypes from the OHDSI Phenotype library that cover a range of concept domains, entry and inclusion criteria, and cohort exit options. We replicated these cohorts using CodelistGenerator and CohortConstructor to assess computational time and agreement between CIRCE and CohortConstructor.

Code and collaboration

The benchmarking code is available on the BenchmarkCohortConstructor repository on GitHub.

If you are interested in running the code on your database, feel free to reach out to us for assistance, and we can also update the vignette with your results! :)

Databases

Current results were obtained from a 100,000-person sample of the CPRD GOLD database on Postgres.

The table below show how many records are in OMOP tables used in the benchmark script for each participating database.

OMOP table Database
CPRD Gold 100k
person 100,000
observation_period 100,000
drug_exposure 12,403,195
condition_occurrence 3,191,739
procedure_occurrence 1,914,271
visit_occurrence 9,183,206
measurement 10,913,588
observation 11,107,039

Cohorts

We replicated the following cohorts from the OHDSI phenotype library: COVID-19 (ID 56), inpatient hospitalisation (23), new users of beta blockers nested in essential hypertension (1049), transverse myelitis (63), major non cardiac surgery (1289), asthma without COPD (27), endometriosis procedure (722), new fluoroquinolone users (1043), acquired neutropenia or unspecified leukopenia (213).

The COVID-19 cohort was used to evaluate the performance of common cohort stratifications. To compare the package with CIRCE, we created definitions in Atlas, stratified by age groups and sex, which are available in the benchmark GitHub repository with the benchmark code.

Cohort counts and overlap

The following table displays the number of records and subjects for each cohort across the participating databases:

Tool
Cohort name CIRCE CohortConstructor
Number records Number subjects Number records Number subjects
CPRD Gold 100k
Acquired neutropenia or unspecified leukopenia 2719 1167 2675 1167
Asthma without COPD 8808 8808 8741 8741
COVID-19 3231 2881 3275 2881
COVID-19: female 1748 1543 1771 1543
COVID-19: female, 0 to 50 1271 1125 1291 1125
COVID-19: female, 51 to 150 477 418 480 418
COVID-19: male 1483 1338 1504 1341
COVID-19: male, 0 to 50 1054 960 1072 960
COVID-19: male, 51 to 150 429 381 432 381
Endometriosis procedure 0 0 0 0
Inpatient hospitalisation 0 0 0 0
Major non cardiac surgery 4146 4146 4146 4146
New fluoroquinolone users 5412 5412 5412 5412
New users of beta blockers nested in essential hypertension 1723 1723 1723 1723
Transverse myelitis 31 11 15 11

We also computed the overlap between patients in CIRCE and CohortConstructor cohorts, with results shown in the plot below:

Performance

To evaluate CohortConstructor performance we generated each of the CIRCE cohorts using functionalities provided by both CodelistGenerator and CohortConstructor, and measured the computational time taken.

Two different approaches with CohortConstructor were tested:

  • By definition: we created each of the cohorts seprately.

  • By domain: All nine targeted cohorts were created together in a set, following the by domain approach described in the Introduction vignette. Briefly, this approach involves creating all base cohorts at once, requiring only one call to each involved OMOP table.

By definition

The following plot shows the times taken to create each cohort using CIRCE and CohortConstructor when each cohorts were created separately.

By domain

The table below depicts the total time it took to create the nine cohorts when using the by domain approach for CohortConstructor.

Database_name Time by tool (minutes)
CIRCE CohortConstructor
CPRD Gold 100k 73.41 7.85

Cohort stratification

Cohorts are often stratified in studies. With Atlas cohort definitions, each stratum requires a new CIRCE JSON to be instantiated, while CohortConstructor allows stratifications to be generated from an overall cohort. The following table shows the time taken to create age and sex stratifications for the COVID-19 cohort with both CIRCE and CohortConstructor.

Database Time (minutes)
CIRCE CohortConstructor
CPRD Gold 100k 93.25 1.17

Use of SQL indexes

For Postgres SQL databases, the package uses indexes in conceptCohort by default. To evaluate how much these indexes reduce computation time, we instantiated a subset of concept sets from the benchmark, both with and without indexes.

Four calls were made to conceptCohort, each involving a different number of OMOP tables. The combinations were:

  1. Drug exposure

  2. Drug exposure + condition occurrence

  3. Drug exposure + condition occurrence + procedure occurrence

  4. Drug exposure + condition occurrence + procedure occurrence + measurement

The plot below shows the computation time with and without SQL indexes for each scenario: