Skip to contents

Executes vectorized DuckDB SQL queries against OMOP CDM tables to generate:

  1. Calendar-year incidence rates (new cases, person-years, incidence rate per 1,000 PY).

  2. Time-to-event and observation duration distributions (min, p25, median, p75, max, mean, sd).

  3. Age/sex population pyramids (10-year age bins stratified by gender).

  4. Baseline top condition concept prevalence. Automatically applies complementary secondary cell suppression for HIPAA/GDPR compliance.

Usage

consortium_cohort_diagnostics(
  con,
  cohort_table = "cohort",
  cohort_id = 1L,
  baseline_window_days = 365L,
  top_n_concepts = 10L,
  secondary_suppression = TRUE,
  min_cell_count = 11L
)

Arguments

con

Active DuckDB connection (DBI::dbConnect).

cohort_table

Name of the cohort table (default "cohort").

cohort_id

Target cohort definition ID (default 1L).

baseline_window_days

Lookback window in days for concept prevalence (default 365L).

top_n_concepts

Number of top concepts to profile (default 10L).

secondary_suppression

Logical; whether to apply complementary cell suppression (default TRUE).

min_cell_count

Small cell count threshold for redaction (default 11L).

Value

An S3 object of class consortium_cohort_diagnostics containing $incidence, $time_to_event, $population_pyramid, $concept_prevalence, and $metadata.