Skip to contents

A software demonstration and smoke test: compiles inst/cohorts/diabetes_phenotype.circe.json to GoogleSQL (CirceR + SqlRender), builds the cohort and baseline features (age, sex, race, prior-year utilization) in a scratch dataset of your project, and writes demo_report.md, demo_summary.json, demo_features.csv and the SQL to output_dir. The data are synthetic claims with no labs or vital signs; those features are reported as 100% missing and never imputed. Results say nothing about clinical performance (see BIGQUERY_DEMO_DISCLAIMER).

Usage

run_bigquery_demo(
  billing_project = NULL,
  output_dir = "bigquery_demo_out",
  dataset = NULL,
  scratch_dataset = NULL,
  vocabulary_dataset = NULL,
  cohort_json = NULL,
  cohort_id = 1L,
  dry_run = FALSE,
  runner = NULL
)

Arguments

billing_project

Your GCP project id. Defaults to billing_project in config/bigquery.yml.

output_dir

Where the report and SQL are written.

dataset

Source CDM, "project.dataset".

scratch_dataset

A writable "project.dataset" (default <billing_project>.omop_duckdb_demo).

vocabulary_dataset

Where concept_ancestor lives if not in dataset.

cohort_json

Circe JSON; defaults to inst/cohorts/diabetes_phenotype.circe.json relative to the working directory (run from the repository root).

cohort_id

Cohort definition id.

dry_run

TRUE compiles and writes the SQL only (no BigQuery call, no credentials).

runner

For tests: a list with execute(sql), fetch(sql) and ensure_dataset(dataset).

Value

Invisibly, the summary list.

Details

The public SynPUF copy has no visit_occurrence or measurement table. A missing one is replaced by an empty table of the same shape in the scratch dataset (stub_visit_occurrence, stub_measurement), so the cohort still runs; utilization is then 0 for everyone and labs are unavailable, and the report lists the stand-ins.

Reading the public dataset needs only a project to bill; the run also needs permission to run BigQuery jobs and create a dataset in billing_project (or a scratch_dataset you already own). Authenticate once with bigrquery::bq_auth().