Skip to contents

Fresh builds via etl_pcornet already include censored lab parsing, VITAL.TOBACCO observations, and OMOP v5.4 MED_ADMIN domain routing natively in both R and Python. For OMOP DuckDB databases built earlier or by an external builder, the post-build backfill routines live in the Python omop_etl package (0.36.0, S1/S2); these R wrappers call them through reticulate when available and raise a clear error otherwise.

Usage

backfill_all(
  db_path,
  raw_dir,
  dry_run = TRUE,
  central_vocab = NULL,
  crosswalk = NULL,
  start = NULL,
  end = NULL
)

backfill_condition_concepts(
  db_path,
  central_vocab = NULL,
  add_rows = TRUE,
  dry_run = FALSE
)

backfill_drug_concepts(db_path, central_vocab = NULL, dry_run = FALSE)

backfill_lab_values(
  db_path,
  lab_result_cm,
  central_vocab = NULL,
  start = NULL,
  end = NULL,
  dry_run = FALSE,
  crosswalk = NULL
)

backfill_vital_tobacco(db_path, vital_path, dry_run = FALSE, crosswalk = NULL)

backfill_med_admin(
  db_path,
  med_admin_path,
  central_vocab = NULL,
  dry_run = FALSE,
  crosswalk = NULL,
  route_domains = TRUE,
  force = FALSE
)

repair_routed_med_admin_values(db_path, dry_run = FALSE)

Arguments

db_path

Path to the OMOP DuckDB database file.

raw_dir

Path to the raw PCORnet source extract directory (for backfill_all()).

dry_run

Logical; if TRUE (default for backfill_all), opens read-only and reports what would change without modifying the database.

central_vocab

Optional path to central_vocabulary.duckdb to attach read-only.

crosswalk

Optional path to a PATID–ssid crosswalk CSV.

start, end

Optional ISO date window ("YYYY-MM-DD") for backfill_lab_values().

lab_result_cm, vital_path, med_admin_path

Source file paths (.csv, .parquet, or .zip).

add_rows

Logical; in backfill_condition_concepts(), add extra rows for multi-target ICD mappings.

route_domains, force

Options for backfill_med_admin().

Value

A data.frame (backfill_all, backfill_lab_values) or named list of counts.