# omop-duck-db Tools for building an [OMOP Common Data Model](https://ohdsi.github.io/CommonDataModel/) (CDM) v5.4 database in [DuckDB](https://duckdb.org/), loading the OHDSI Athena vocabulary, mapping PCORnet-format source data into the CDM, and running cohort, feature and quality workflows on it. Provided as an R package (`omopduckdb`) and a Python package (`omop_etl`, also importable as `omop_duck_db`) that share the same schema and concept-mapping SQL. **Scope.** General-purpose mapping/ETL tooling and a small fabricated sample fixture. This repository does not ingest, store or process protected or identifiable data; real use happens against your own data infrastructure. ## Install ``` r # install.packages("remotes") remotes::install_github("jkylearmstrong/omop-duck-db") ``` ``` bash pip install omop-duck-db # or: pip install 'omop-duck-db[ml]' for the ML dependencies pip install 'omop-duck-db[postgres-embedded]' # optional: PostgreSQL inside Python, see testing/postgres-in-python.md ``` Working inside this repository with R? `.Rprofile` activates `renv`; run `renv::restore()`, or set `RENV_CONFIG_AUTOLOADER = FALSE` / use `Rscript --no-init-file` to use your system library. ## Quick start ``` r library(omopduckdb) build_schema("omop_cdm.duckdb") # empty CDM v5.4 schema load_vocabulary("path/to/athena_download", "omop_cdm.duckdb") # Athena vocabulary etl_pcornet("path/to/pcornet_extract", "omop_cdm.duckdb") # PCORnet -> CDM con <- omop_connect("omop_cdm.duckdb") # also attaches a sibling central vocabulary cohort <- define_study_cohort(con, visit_type = "inpatient", min_age = 18, table_name = "cohort") ``` ``` python from omop_etl import build_schema, etl_pcornet, load_vocabulary, omop_connect, define_study_cohort import duckdb con = duckdb.connect("omop_cdm.duckdb"); build_schema(con); con.close() load_vocabulary("path/to/athena_download", "omop_cdm.duckdb") etl_pcornet("path/to/pcornet_extract", "omop_cdm.duckdb") # a second full run needs overwrite=True con = omop_connect("omop_cdm.duckdb") cohort = define_study_cohort(con, visit_type="inpatient", min_age=18, table_name="cohort") ``` Command-line equivalents: `Rscript inst/scripts/etl_pcornet.R --source-dir ...` and `python -m omop_etl.build_omop_cdm --source-dir ...`. [`etl_pcornet()`](https://jkylearmstrong.github.io/omop-duck-db/reference/etl_pcornet.md) refuses to load into a database that already holds ETL output (it would duplicate every row); pass `overwrite = TRUE` to empty the CDM tables first. ## Docker image Every version tag publishes an image to GitHub Container Registry (not Docker Hub); the build runs both test suites. The badge above shows the latest build and links to the package page. ``` bash docker pull ghcr.io/jkylearmstrong/omop-duck-db:latest ``` ## Guides The long-form documentation lives in vignettes (the website’s *Articles* menu). | Topic | Guide | |----|----| | **Build and operate** | | |   Build the database, refresh the vocabulary, central vocabulary, custom and Usagi mappings, run the tests, sync large files | [`vignette("database_and_mapping")`](https://jkylearmstrong.github.io/omop-duck-db/articles/database_and_mapping.md) | |   Keep site databases in a PostgreSQL that runs inside Python (no install, no admin rights) and check the DuckDB \<-\> PostgreSQL round trip | [`testing/postgres-in-python.md`](https://jkylearmstrong.github.io/omop-duck-db/testing/postgres-in-python.md) | | **Cohorts and features** | | |   Study cohorts, comorbidity, measurement sanitisation, features, Table 1, reconciliation, the shipped eDERRI cohort definitions | [`vignette("study_cohorts_and_features")`](https://jkylearmstrong.github.io/omop-duck-db/articles/study_cohorts_and_features.md) | |   Add your own person-level features (R and Python), and fit them once for use across sites | [`vignette("study_features")`](https://jkylearmstrong.github.io/omop-duck-db/articles/study_features.md) | |   Circe evaluation, cohort reconciliation, bundles, feature ablation and the DQD catalog for a downstream study | [`vignette("study_design_tools")`](https://jkylearmstrong.github.io/omop-duck-db/articles/study_design_tools.md) | | **Clinical tools and multi-site work** | | |   Risk scores, wide tables, phenotypes, consortium federation, calibration, decision curves | [`vignette("clinical_tools_and_consortium")`](https://jkylearmstrong.github.io/omop-duck-db/articles/clinical_tools_and_consortium.md) | |   Small-cell suppression, CONSORT counts, site summary packages | [`vignette("disclosure_and_site_packages")`](https://jkylearmstrong.github.io/omop-duck-db/articles/disclosure_and_site_packages.md) | | **Machine learning and OHDSI** | | |   scikit-learn, omop-learn, OHDSI PLP / DeepPLP, tidymodels | [`vignette("ml_bridge")`](https://jkylearmstrong.github.io/omop-duck-db/articles/ml_bridge.md) | |   Benchmark features, deep-learning datasets, DGX Spark, Oracle | [`vignette("deep_learning_and_benchmarks")`](https://jkylearmstrong.github.io/omop-duck-db/articles/deep_learning_and_benchmarks.md) | |   What was checked against the official OHDSI tools, and what was not | [`vignette("ohdsi_integration")`](https://jkylearmstrong.github.io/omop-duck-db/articles/ohdsi_integration.md) | | **Cloud and demos** | | |   Run the diabetes cohort on public BigQuery data (CMS SynPUF); the runnable BigQuery-to-DuckDB check is `inst/examples/bigquery_duckdb_roundtrip.qmd` | [`vignette("bigquery_synthetic_demo")`](https://jkylearmstrong.github.io/omop-duck-db/articles/bigquery_synthetic_demo.md) | | **Reproducibility and status** | | |   Run this study at a sister site from raw PCORnet extracts (table & backfill matrix, anonymous outputs, relabelling) | [`vignette("sister_site_guide")`](https://jkylearmstrong.github.io/omop-duck-db/articles/sister_site_guide.md) | |   Reproducing the delivered manuscript, decisions that move the numbers | [`vignette("reproducing_the_manuscript")`](https://jkylearmstrong.github.io/omop-duck-db/articles/reproducing_the_manuscript.md) | |   What is claimed, verified and planned; architecture notes and the R/Python parity table | [`vignette("status_and_roadmap")`](https://jkylearmstrong.github.io/omop-duck-db/articles/status_and_roadmap.md) | ## Works with the OHDSI ecosystem The package is built to sit beside the standard OMOP tools, not replace them. Status by tool (the evidence is in [`vignette("ohdsi_integration")`](https://jkylearmstrong.github.io/omop-duck-db/articles/ohdsi_integration.md); [`vignette("status_and_roadmap")`](https://jkylearmstrong.github.io/omop-duck-db/articles/status_and_roadmap.md) says what is claimed versus verified): | Status | Tools | |----|----| | **Compared against the official tool** (DuckDB, DatabaseConnector 8.0.0) | [CirceR](https://github.com/OHDSI/CirceR) + CohortGenerator (cohort definitions), [FeatureExtraction](https://github.com/OHDSI/FeatureExtraction) (visit counts, custom covariates), [PatientLevelPrediction](https://github.com/OHDSI/PatientLevelPrediction) (`getPlpData`, study population, `runPlp`), [DeepPatientLevelPrediction](https://github.com/OHDSI/DeepPatientLevelPrediction) (an MLP trained on [`as_plp_data()`](https://jkylearmstrong.github.io/omop-duck-db/reference/as_plp_data.md) output), [CohortMethod](https://github.com/OHDSI/CohortMethod) (study population and an unadjusted odds ratio), [CohortConstructor](https://github.com/OHDSI/CohortConstructor) (concept and demographic cohorts), [DataQualityDashboard](https://github.com/OHDSI/DataQualityDashboard), Achilles, PhenotypeLibrary, CohortDiagnostics, via [HADES](https://github.com/OHDSI) DatabaseConnector; [omop-learn](https://github.com/clinicalml/omop-learn) (`DuckDBBackend` against the real classes) | | **Works, partly checked** | [ATLAS](https://github.com/OHDSI/Atlas) 2.x: `scripts/atlas/` imports the shipped Circe JSON and has WebAPI render SQL (verified on WebAPI 2.14; not a generation check). FeatureExtraction’s Charlson index is **not** equivalent to the package’s. | | **Not covered by any check** | ATLAS 3 (UI never run), [Data2Evidence](https://github.com/OHDSI/Data2Evidence), [Phenelope](https://github.com/OHDSI/Phenelope) (needs an LLM), [OHDSI GIS / Gaia](https://github.com/OHDSI/GIS) (PostgreSQL/PostGIS). Reasons in [`vignette("ohdsi_integration")`](https://jkylearmstrong.github.io/omop-duck-db/articles/ohdsi_integration.md). | Where the package overlaps an OHDSI tool (cohort engine, DQD catalog, Achilles subset, Table 1) it covers a subset and says so; prefer the official tool for anything you publish. ## Repository layout - `inst/extdata/5.4/duckdb/*.sql` – CDM v5.4 DDL; the schema source of truth for **both** languages. - `inst/sql/*.sql` – DuckDB macros shared by both ETLs (ID hashing, date parsing, ancestry). Concept resolution itself is written out in each loader. - `R/` – the R package. `python/omop_etl/` – the Python package, closely mirroring it (some features are language-specific; see [`vignette("status_and_roadmap")`](https://jkylearmstrong.github.io/omop-duck-db/articles/status_and_roadmap.md)). `python/omop_duck_db/` re-exports `omop_etl`. - `inst/scripts/` – command-line wrappers; `inst/cohorts/` – shipped Circe cohort definitions; `inst/examples/`, `scripts/` – worked examples and repository helper scripts; `vignettes/` – the guides above. ## Things to know before you rely on results - **Age.** [`define_study_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/define_study_cohort.md) computes age in completed years. The old calendar-year method is still available as `age_method = "year_difference"`, but it is deprecated: it admits people younger than `min_age`. - **Disclosure.** Aggregate helpers suppress counts from 1 to `min_cell_count - 1` (default 11) and blank what could be recovered from them by subtraction. Only the duplicate/overlap helpers and the site-summary export were audited; treat other helpers’ output as pre-suppression. Details: [`vignette("disclosure_and_site_packages")`](https://jkylearmstrong.github.io/omop-duck-db/articles/disclosure_and_site_packages.md). - **Vocabulary.** Athena downloads omit CPT4 concept names (AMA licence); until the licensed tool is run, CPT4 procedures map to concept 0. A few source fields (e.g. admission source) are not mapped yet. - **Post-build backfills.** Fresh builds via [`etl_pcornet()`](https://jkylearmstrong.github.io/omop-duck-db/reference/etl_pcornet.md) in both R and Python natively parse censored lab values (`operator_concept_id`), map `VITAL.TOBACCO` when `SMOKING` is absent, and route `MED_ADMIN` / `drug_exposure` records to their OMOP v5.4 domain tables ([`route_drug_domains()`](https://jkylearmstrong.github.io/omop-duck-db/reference/route_drug_domains.md)). Post-build repair functions for databases built by an older or external builder ([`backfill_all()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md), [`backfill_condition_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md), [`backfill_drug_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md), [`backfill_lab_values()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md), [`backfill_vital_tobacco()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md), [`backfill_med_admin()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md), [`repair_routed_med_admin_values()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md)) are implemented in Python (`omop_etl`); the R package provides `reticulate` wrappers of the same names that raise a clear error when Python / `omop_etl` is not configured. See [`vignette("sister_site_guide")`](https://jkylearmstrong.github.io/omop-duck-db/articles/sister_site_guide.md). - **Not run live.** The BigQuery sync and Oracle cohort-SQL translation are unit-tested only. Oracle transfers (`to_sql` / `verify_transfer`) and the DGX Spark image (`gpu-check`, `dgx-smoke`) have each been run on one real system; `testing/tested-environments.md` says what those runs show and what they do not. R behaviour on production-size data is less field-tested than Python’s. See `NEWS.md` for changes and [`vignette("status_and_roadmap")`](https://jkylearmstrong.github.io/omop-duck-db/articles/status_and_roadmap.md) for architecture notes and the R/Python parity table. # Package index ## Schema and vocabulary Initialize CDM tables and manage standard Athena vocabularies. - [`build_schema()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_schema.md) : Build the OMOP CDM v5.4 schema into a DuckDB database file - [`load_vocabulary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_vocabulary.md) : Load or refresh the OHDSI Athena vocabulary into the OMOP CDM database - [`attach_central_vocabulary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/attach_central_vocabulary.md) : Attach a Central Vocabulary Database via DuckDB Zero-Copy Views - [`concept_set_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`list_concept_sets()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`load_concept_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`load_concept_sets()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`concept_set_codes()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`concept_set_ids()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`concept_set_from_codes()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`concept_set_from_ids()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`resolve_concept_sets()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) [`loinc_coverage()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_sets.md) : OHDSI concept sets behind the feature columns - [`read_csv_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) [`read_parquet_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) [`attach_database()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) [`sql_copy_to()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) : SQL table-function expressions and file operations with sanitized paths - [`omop_connect()`](https://jkylearmstrong.github.io/omop-duck-db/reference/omop_connect.md) : Connect to an OMOP DuckDB Database with the Central Vocabulary Attached Transparently - [`omop_connect_lakehouse()`](https://jkylearmstrong.github.io/omop-duck-db/reference/omop_connect_lakehouse.md) : Delta Lake and Apache Iceberg Lakehouse Connector for OMOP DuckDB - [`load_from_bigquery()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_from_bigquery.md) : Copy OMOP-shaped table(s) from BigQuery into the local DuckDB CDM database - [`run_bigquery_demo()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_bigquery_demo.md) : Build the diabetes cohort on the public CMS SynPUF OMOP dataset in BigQuery - [`compile_cohort_bigquery()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compile_cohort_bigquery.md) : Compile a Circe cohort definition to BigQuery (GoogleSQL) statements - [`summarize_bigquery_demo()`](https://jkylearmstrong.github.io/omop-duck-db/reference/summarize_bigquery_demo.md) : Summarise the BigQuery demonstration features - [`BIGQUERY_DEMO_DISCLAIMER`](https://jkylearmstrong.github.io/omop-duck-db/reference/BIGQUERY_DEMO_DISCLAIMER.md) : Disclaimer printed on every BigQuery demonstration report - [`BIGQUERY_DEMO_UTILIZATION_NOTE`](https://jkylearmstrong.github.io/omop-duck-db/reference/BIGQUERY_DEMO_UTILIZATION_NOTE.md) : Note printed beside the utilization features in the BigQuery demonstration report - [`backend_parity`](https://jkylearmstrong.github.io/omop-duck-db/reference/backend_parity.md) : BigQuery vs DuckDB, and R vs Python, parity checks - [`run_duckdb_demo()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_duckdb_demo.md) : Build the BigQuery demo's cohort and features on DuckDB - [`copy_demo_sample_from_bigquery()`](https://jkylearmstrong.github.io/omop-duck-db/reference/copy_demo_sample_from_bigquery.md) : Copy a person sample of the BigQuery CDM into DuckDB - [`compare_cohorts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_cohorts.md) : Compare two cohort tables - [`compare_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_features.md) : Compare two feature tables row by row - [`compare_column_types()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_column_types.md) : Compare column types between BigQuery and DuckDB - [`check_id_precision()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_id_precision.md) : Id columns that cannot hold every 64-bit id exactly - [`compare_demo_summaries()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_demo_summaries.md) : Compare two `demo_summary.json` results - [`compare_demo_outputs()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_demo_outputs.md) : Compare two demo output folders - [`DEMO_FEATURE_COLUMNS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEMO_FEATURE_COLUMNS.md) : Feature columns written by both backends (`subject_id` is the key) - [`check_vocabulary_version()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_vocabulary_version.md) : Query vocabulary version and summary metrics from DuckDB OMOP CDM ## PCORnet ETL and synthesizers Ingest PCORnet extracts and generate required OHDSI eras and observation periods. - [`etl_pcornet()`](https://jkylearmstrong.github.io/omop-duck-db/reference/etl_pcornet.md) : Run the PCORnet -\> OMOP CDM v5.4 ETL (R implementation) - [`route_drug_domains()`](https://jkylearmstrong.github.io/omop-duck-db/reference/route_drug_domains.md) : Route non-Drug standard concepts out of drug_exposure into OMOP v5.4 domain tables - [`backfill_all()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md) [`backfill_condition_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md) [`backfill_drug_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md) [`backfill_lab_values()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md) [`backfill_vital_tobacco()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md) [`backfill_med_admin()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md) [`repair_routed_med_admin_values()`](https://jkylearmstrong.github.io/omop-duck-db/reference/backfill_all.md) : Post-Build Database Backfill Wrappers (Python Delegation via reticulate) - [`load_enrollment_spans()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_enrollment_spans.md) : Build enrolment spans from the PCORnet ENROLLMENT file - [`check_key_collisions()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_key_collisions.md) [`check_etl_keys()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_key_collisions.md) : Build-time surrogate-key collision check - [`build_observation_period()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_observation_period.md) : Synthesize Observation Period envelopes - [`build_drug_era()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_drug_era.md) : Synthesize Drug Eras - [`build_condition_era()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_condition_era.md) : Synthesize Condition Eras ## Multi-site Consortium Federation Federated CDM queries and multi-site metadata initialization. - [`federated_consortium()`](https://jkylearmstrong.github.io/omop-duck-db/reference/federated_consortium.md) : Multi-Site Federated Consortium Connector - [`consortium_query()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_query.md) : Execute a Query Across the Federated Consortium Views - [`consortium_site_summaries()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_site_summaries.md) : Audit Record Counts Across Participating Consortium Sites - [`consortium_calculate_scores()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_calculate_scores.md) : Generate Consortium-Wide and Site-Stratified Bedside Risk Scores - [`consortium_generate_table1()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_generate_table1.md) : Generate Federated Table 1 Baseline Demographics and Clinical Profiles - [`consortium_generate_table2()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_generate_table2.md) : Generate Federated Table 2 Completeness and Missingness Audit - [`consortium_close()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_close.md) : Close Federated Consortium DuckDB Connection - [`create_federated_consortium()`](https://jkylearmstrong.github.io/omop-duck-db/reference/create_federated_consortium.md) : Create a Zero-Copy Federated Consortium Connection - [`check_cross_database_discrepancy()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_cross_database_discrepancy.md) : Check Cross-Database Concept Frequency Discrepancy - [`with_cell_suppression()`](https://jkylearmstrong.github.io/omop-duck-db/reference/with_cell_suppression.md) : Create Privacy-Preserving View with Small-Cell Masking - [`with_differential_privacy()`](https://jkylearmstrong.github.io/omop-duck-db/reference/with_differential_privacy.md) : Create Privacy-Preserving View with Differential Privacy Laplace Noise - [`audit_cell_suppression()`](https://jkylearmstrong.github.io/omop-duck-db/reference/audit_cell_suppression.md) [`consortium_privacy_audit()`](https://jkylearmstrong.github.io/omop-duck-db/reference/audit_cell_suppression.md) : Privacy-Preserving Cell Suppression Auditor - [`consortium_multivariable_risk_factors()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_multivariable_risk_factors.md) : Robust Multivariable Odds Ratios with L2 / Ridge Inversion - [`consortium_cross_site_validation()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_cross_site_validation.md) : Internal-External Cross-Validation (IECV) Matrix - [`consortium_cohort_diagnostics()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_cohort_diagnostics.md) : Generate Pure DuckDB OHDSI Cohort Diagnostics - [`export_to_circe_json()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_to_circe_json.md) : Export CohortFlow to OHDSI Circe JSON - [`build_manuscript_scaffold()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_manuscript_scaffold.md) : Build End-to-End Consortium Manuscript Scaffold - [`federated_meta_analysis()`](https://jkylearmstrong.github.io/omop-duck-db/reference/federated_meta_analysis.md) : Multi-Site Federated Meta-Analysis Aggregator - [`assign_site_labels()`](https://jkylearmstrong.github.io/omop-duck-db/reference/assign_site_labels.md) : Assign anonymous site labels - [`save_site_labels()`](https://jkylearmstrong.github.io/omop-duck-db/reference/save_site_labels.md) [`load_site_labels()`](https://jkylearmstrong.github.io/omop-duck-db/reference/save_site_labels.md) : Save or load a site-to-label mapping - [`validate_site_labels()`](https://jkylearmstrong.github.io/omop-duck-db/reference/validate_site_labels.md) : Check a site-to-label mapping before a run - [`relabel_sites()`](https://jkylearmstrong.github.io/omop-duck-db/reference/relabel_sites.md) : Swap site labels in data or text - [`relabel_output_files()`](https://jkylearmstrong.github.io/omop-duck-db/reference/relabel_output_files.md) : Re-issue study outputs under a new site mapping (text files) - [`check_run_privacy()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_run_privacy.md) : Scan study outputs for real site names - [`load_care_site()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_care_site.md) : Ingest PCORnet facility.csv and/or Seed Primary Institutional Care Site - [`load_cdm_source()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_cdm_source.md) : Populate CDM_SOURCE metadata table - [`load_location()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_location.md) : Maps `lds_address_history.csv` into OMOP CDM `location` table and updates `person.location_id` ## Vocabulary mapping and Usagi Import custom crosswalks and audit unmapped source codes. - [`import_source_to_concept_map()`](https://jkylearmstrong.github.io/omop-duck-db/reference/import_source_to_concept_map.md) : Ingest custom mappings from a CSV into the OMOP source_to_concept_map table - [`import_usagi_mappings()`](https://jkylearmstrong.github.io/omop-duck-db/reference/import_usagi_mappings.md) : Import mappings exported from OHDSI Usagi into source_to_concept_map - [`export_unmapped_codes()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_unmapped_codes.md) : Export unmapped (concept_id = 0) codes aggregated by frequency ready for OHDSI Usagi - [`auto_remap_unmapped()`](https://jkylearmstrong.github.io/omop-duck-db/reference/auto_remap_unmapped.md) : Heuristic Remapping and Diagnostic Repair for Unmapped Records ## CDM table remapping Retroactively update existing CDM tables to new vocabulary concepts. - [`remap_cdm_table()`](https://jkylearmstrong.github.io/omop-duck-db/reference/remap_cdm_table.md) : Remap unmapped (concept_id = 0) or deprecated concepts in an OMOP table - [`remap_discharge_status()`](https://jkylearmstrong.github.io/omop-duck-db/reference/remap_discharge_status.md) : Recode transfer discharges in a database built before the ETL mapped 'IP' to 8717 - [`cap_observation_period()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cap_observation_period.md) : Cap observation periods of an already-built database at a data cutoff - [`check_observation_period_ends()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_observation_period_ends.md) : Flag observation periods that pile up on one end date - [`remap_all()`](https://jkylearmstrong.github.io/omop-duck-db/reference/remap_all.md) : Remap all supported clinical tables and optionally rebuild eras ## Cohorts and concept algebra Parameterized cohort builders, set operations, and transitive hierarchy algebra. - [`define_study_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/define_study_cohort.md) : Define an Index-Stay Study Cohort - [`build_readmission_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_readmission_cohort.md) : Build 30-Day Readmission Cohort - [`build_end_of_life_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_end_of_life_cohort.md) [`build_mortality_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_end_of_life_cohort.md) : Build End of Life / Mortality Cohort - [`build_treatment_episodes()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_treatment_episodes.md) : Collapse Longitudinal Medication Exposures into Continuous Treatment Episodes - [`generate_consort_attrition()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_consort_attrition.md) : Generate CONSORT Attrition Flowchart Object - [`summarize_attrition_consort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/summarize_attrition_consort.md) : CONSORT attrition table from counts, for one site or pooled across sites - [`write_consort_csv()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_consort_csv.md) : Write a CONSORT attrition table as a publication-ready CSV - [`export_consort_flowchart()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_consort_flowchart.md) : Export a publication-ready CONSORT flowchart image - [`to_mermaid()`](https://jkylearmstrong.github.io/omop-duck-db/reference/to_mermaid.md) : Convert Object to Mermaid Diagram - [`to_typst()`](https://jkylearmstrong.github.io/omop-duck-db/reference/to_typst.md) : Convert Object to Typst Flowchart - [`to_tikz()`](https://jkylearmstrong.github.io/omop-duck-db/reference/to_tikz.md) : Convert Object to LaTeX TikZ Flowchart - [`prepare_competing_risks_data()`](https://jkylearmstrong.github.io/omop-duck-db/reference/prepare_competing_risks_data.md) : Prepare Competing Risk Survival Data for Readmission vs. Mortality - [`create_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/create_cohort.md) : Materialize an OMOP Cohort - [`combine_cohorts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/combine_cohorts.md) : Combine Cohorts via Set Operations - [`compute_attrition()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compute_attrition.md) : Track Patient Attrition Across Phenotyping Rules (CONSORT Flowchart) - [`get_cohort_summary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/get_cohort_summary.md) : Get Cohort Summary Statistics - [`ensure_cohort_tables()`](https://jkylearmstrong.github.io/omop-duck-db/reference/ensure_cohort_tables.md) : Ensure Standard OMOP Cohort Tables Exist - [`build_ederri_diabetes_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_ederri_diabetes_cohort.md) : Authoritative eDERRI Diabetes Inclusion Cohort (FR-A6) - [`compare_cohort_definitions()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_cohort_definitions.md) : Compare two target-cohort definitions side by side - [`run_cohort_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_cohort_sql.md) : Render, translate and run one portable cohort SQL file on DuckDB - [`resolve_concept_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/resolve_concept_set.md) : Resolve Concept Set Algebra (ATLAS-Compatible) - [`get_concept_ancestors()`](https://jkylearmstrong.github.io/omop-duck-db/reference/get_concept_ancestors.md) : Resolve Concept Ancestors from Hierarchy Transitive Closure - [`get_concept_descendants()`](https://jkylearmstrong.github.io/omop-duck-db/reference/get_concept_descendants.md) : Resolve Concept Descendants from Hierarchy Transitive Closure ## Native CIRCE cohort compiler In-process compilation and execution of OHDSI ATLAS / CIRCE JSON definitions in DuckDB. - [`circe`](https://jkylearmstrong.github.io/omop-duck-db/reference/circe.md) : Native CIRCE / Atlas JSON-to-DuckDB Vectorized SQL Compiler - [`compile_circe_to_duckdb()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compile_circe_to_duckdb.md) : Compile CIRCE JSON to Vectorized DuckDB SQL - [`execute_circe_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/execute_circe_cohort.md) : Execute CIRCE JSON Cohort Directly in DuckDB ## Comorbidity profiling and phenotyping Validated 31 Elixhauser domains, Charlson comorbidity index, and composite risk scoring. - [`extract_elixhauser_comorbidities()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_elixhauser_comorbidities.md) : Elixhauser comorbidity profile (31 domains, van Walraven score) - [`extract_charlson_index()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_charlson_index.md) : Charlson comorbidity profile (17 categories, Charlson index) - [`calculate_bedside_scores()`](https://jkylearmstrong.github.io/omop-duck-db/reference/calculate_bedside_scores.md) : Bedside Clinical Risk Score Calculators for OMOP CDM Cohorts - [`calculate_lace_index()`](https://jkylearmstrong.github.io/omop-duck-db/reference/calculate_lace_index.md) : Calculate the LACE Index score for an acute hospital cohort - [`calculate_hospital_score()`](https://jkylearmstrong.github.io/omop-duck-db/reference/calculate_hospital_score.md) : Calculate the HOSPITAL Score for potentially avoidable 30-day readmissions - [`scores`](https://jkylearmstrong.github.io/omop-duck-db/reference/scores.md) : Clinical Benchmark Risk Score Calculators (LACE Index and HOSPITAL Score) - [`list_available_phenotypes()`](https://jkylearmstrong.github.io/omop-duck-db/reference/list_available_phenotypes.md) : List available pre-compiled phenotype bundle names - [`get_phenotype_concept_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/get_phenotype_concept_set.md) : Retrieve pre-compiled concept set definition for an OHDSI phenotype - [`phenotypes`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotypes.md) : Pre-compiled OHDSI Phenotype Library Concept Bundles ## Machine learning feature extraction Extract patient-level sparse concept matrices, windowed temporal features, and measurements. - [`extract_sparse_concept_matrix()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_sparse_concept_matrix.md) : Sparse concept matrix for ML / PLP-style models - [`extract_longitudinal_tensors()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) [`MAX_LONGITUDINAL_VISITS`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) [`MAX_TOKENS_PER_VISIT`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) [`VOCAB_SIZE`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) : Longitudinal sequence tensors for deep sequence models - [`extract_patient_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_patient_features.md) [`extract_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_patient_features.md) : Extract Machine Learning Feature Matrix from OMOP CDM - [`extract_temporal_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_temporal_features.md) : Extract Temporal Baseline and Prior Utilization Features - [`extract_clinical_sequence_tokens()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_clinical_sequence_tokens.md) : Extract Foundation Model Clinical Sequence Tokens - [`aggregate_concept_sets()`](https://jkylearmstrong.github.io/omop-duck-db/reference/aggregate_concept_sets.md) : Aggregate Concept Sets via Athena Ancestor Traversal - [`extract_measurements()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_measurements.md) : Extract Consolidated Measurements and Vitals - [`extract_standard_labs()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_standard_labs.md) : Extract Harmonized Inpatient Lab Panels with Outlier Sanitization - [`extract_inpatient_labs()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_inpatient_labs.md) : Index-stay laboratory values per cohort row, separating acute labs from routine ones - [`extract_prior_utilization()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_prior_utilization.md) : Prior healthcare utilization per cohort row, strictly before the index admission - [`consortium_calibration()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_calibration.md) : Cross-Site Model Calibration and Decision Curve Analysis (DCA) - [`decision_curve_analysis()`](https://jkylearmstrong.github.io/omop-duck-db/reference/decision_curve_analysis.md) : Clinical Decision Curve Analysis (DCA) - [`consortium_explainability()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_explainability.md) : Consortium Tree Model Explainability and TRIPOD Reporting - [`CORE_14_LAB_PANEL`](https://jkylearmstrong.github.io/omop-duck-db/reference/CORE_14_LAB_PANEL.md) : Curated Core 14 Inpatient Lab Panel LOINCs - [`ACUTE_LAB_PANEL`](https://jkylearmstrong.github.io/omop-duck-db/reference/ACUTE_LAB_PANEL.md) : Acute inpatient lab LOINCs (lactate, troponin I, arterial blood gases) - [`WORST_LAB_DIRECTION`](https://jkylearmstrong.github.io/omop-duck-db/reference/WORST_LAB_DIRECTION.md) : Direction in which each lab is clinically "worse" (used by `strategy = "worst"`) - [`DEFAULT_VISIT_CONCEPT_GROUPS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_VISIT_CONCEPT_GROUPS.md) : Default visit-concept groups for [`extract_prior_utilization()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_prior_utilization.md) - [`extract_velocity_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_velocity_features.md) : Raw utilization inputs plus the engineered velocity set for a cohort - [`engineer_clinical_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/engineer_clinical_features.md) : Clinical velocity, LACE-proxy, hemodynamic and organ-dysfunction features - [`site_baseline_risk()`](https://jkylearmstrong.github.io/omop-duck-db/reference/site_baseline_risk.md) : Per-site outcome rate as a feature, from training rows only - [`REQUIRED_VELOCITY_INPUTS`](https://jkylearmstrong.github.io/omop-duck-db/reference/REQUIRED_VELOCITY_INPUTS.md) : Input columns required by [`engineer_clinical_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/engineer_clinical_features.md) - [`NO_PRIOR_VISIT_DAYS`](https://jkylearmstrong.github.io/omop-duck-db/reference/NO_PRIOR_VISIT_DAYS.md) : Days used when a patient has no prior visit of a type (the 365-day sentinel) - [`VELOCITY_FEATURES`](https://jkylearmstrong.github.io/omop-duck-db/reference/VELOCITY_FEATURES.md) : Names of the features added by [`engineer_clinical_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/engineer_clinical_features.md) - [`VELOCITY_CONCEPTS`](https://jkylearmstrong.github.io/omop-duck-db/reference/VELOCITY_CONCEPTS.md) : Default measurement concepts used by [`extract_velocity_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_velocity_features.md) ## Source databases, model bundles and site telemetry Stream any DBI source to Parquet, import an existing OMOP CDM, validate feature contracts, score with hash-verified model bundles, and produce/pool aggregate-only consortium telemetry. - [`from_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/from_sql.md) : Stream source tables from any DBI database to Parquet - [`import_omop()`](https://jkylearmstrong.github.io/omop-duck-db/reference/import_omop.md) : Copy an OMOP CDM from a server database into a local DuckDB file - [`CDM_STUDY_TABLES`](https://jkylearmstrong.github.io/omop-duck-db/reference/CDM_STUDY_TABLES.md) : Standard CDM tables copied by [`import_omop()`](https://jkylearmstrong.github.io/omop-duck-db/reference/import_omop.md) - [`load_feature_spec()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_feature_spec.md) : Load a feature spec - [`validate_feature_frame()`](https://jkylearmstrong.github.io/omop-duck-db/reference/validate_feature_frame.md) : Validate a feature table against a feature contract - [`feature_validation_telemetry()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_validation_telemetry.md) : Aggregate-only validation counts for a telemetry packet - [`load_model_bundle()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_model_bundle.md) : Load and verify a model bundle - [`write_model_bundle()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_model_bundle.md) : Package a model bundle - [`export_to_onnx()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_to_onnx.md) : Export a model bundle to one standalone ONNX file - [`score_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/score_cohort.md) : Score a feature table with a model bundle - [`bundle_predict_proba()`](https://jkylearmstrong.github.io/omop-duck-db/reference/bundle_predict_proba.md) : Probabilities of a bundle for an ordered numeric matrix - [`score_encounter()`](https://jkylearmstrong.github.io/omop-duck-db/reference/score_encounter.md) : Point-of-care scoring of one encounter - [`score_fhir_bundle()`](https://jkylearmstrong.github.io/omop-duck-db/reference/score_fhir_bundle.md) : Score a FHIR Bundle without a pre-built database - [`explain_rows()`](https://jkylearmstrong.github.io/omop-duck-db/reference/explain_rows.md) : Local risk-driver explanations for scored rows - [`check_unit_sanity()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_unit_sanity.md) : Pre-scoring unit sanity check - [`harmonize_contract_units()`](https://jkylearmstrong.github.io/omop-duck-db/reference/harmonize_contract_units.md) : Rescale flagged features to the contract units - [`resolve_fhir_codes()`](https://jkylearmstrong.github.io/omop-duck-db/reference/resolve_fhir_codes.md) : Resolve FHIR codes to standard OMOP concept ids - [`VOCABULARY_BY_SYSTEM`](https://jkylearmstrong.github.io/omop-duck-db/reference/VOCABULARY_BY_SYSTEM.md) : FHIR system URIs and the OMOP vocabulary each one selects - [`REFERENCE_MEDIANS`](https://jkylearmstrong.github.io/omop-duck-db/reference/REFERENCE_MEDIANS.md) : Typical adult inpatient reference medians (contract units) - [`LOINC_TO_FEATURE`](https://jkylearmstrong.github.io/omop-duck-db/reference/LOINC_TO_FEATURE.md) : LOINC code to model feature, used by [`score_fhir_bundle()`](https://jkylearmstrong.github.io/omop-duck-db/reference/score_fhir_bundle.md) - [`write_drift_report()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_drift_report.md) : HTML drift and calibration report from the monitoring log - [`calibration_curve()`](https://jkylearmstrong.github.io/omop-duck-db/reference/calibration_curve.md) : Calibration curve by equal-count bins - [`population_stability_index()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) [`calibration_summary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) [`monitor_scores()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) [`update_monitoring_log()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) : Post-deployment drift and calibration monitoring - [`fit_capacity_thresholds()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_capacity_thresholds.md) [`map_risk_tiers()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_capacity_thresholds.md) [`tier_load()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_capacity_thresholds.md) : Capacity-calibrated risk tiers - [`sha256_file()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sha256_file.md) : SHA-256 of a file - [`DEFAULT_RISK_TIERS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_RISK_TIERS.md) : Default risk tiers of a model bundle - [`site_telemetry()`](https://jkylearmstrong.github.io/omop-duck-db/reference/site_telemetry.md) : Build an aggregate-only site telemetry packet - [`aggregate_telemetry()`](https://jkylearmstrong.github.io/omop-duck-db/reference/aggregate_telemetry.md) : Pool the telemetry packets of many sites - [`validate_packet()`](https://jkylearmstrong.github.io/omop-duck-db/reference/validate_packet.md) : Validate a telemetry packet against the JSON Schema - [`load_packet_schema()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_packet_schema.md) : Load the telemetry packet JSON Schema - [`auroc_delong()`](https://jkylearmstrong.github.io/omop-duck-db/reference/auroc_delong.md) : AUROC with DeLong standard error - [`average_precision()`](https://jkylearmstrong.github.io/omop-duck-db/reference/average_precision.md) : Average precision (area under the precision-recall step curve) - [`TELEMETRY_SCHEMA_VERSION`](https://jkylearmstrong.github.io/omop-duck-db/reference/TELEMETRY_SCHEMA_VERSION.md) : Schema version of the site telemetry packet - [`check_source()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_source.md) : Check a source directory against the ETL file/column contract - [`SOURCE_CONTRACT`](https://jkylearmstrong.github.io/omop-duck-db/reference/SOURCE_CONTRACT.md) : Source-file contract of the PCORnet -\> OMOP ETL - [`run_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_manifest.md) : Start a reproducibility manifest for a pipeline run - [`run_manifest_add_step()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_manifest_add_step.md) [`run_manifest_add_input()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_manifest_add_step.md) : Add an input file or an attrition step to a run manifest - [`write_run_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_run_manifest.md) : Write `run_manifest.json` - [`verify_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/verify_manifest.md) : Verify the inputs recorded in a run manifest - [`split_by_date()`](https://jkylearmstrong.github.io/omop-duck-db/reference/split_by_date.md) : Held-out temporal split - [`DEFAULT_SPLIT_DATE_COLUMNS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_SPLIT_DATE_COLUMNS.md) : Date columns that decide which side of a cutoff a CDM row falls on - [`EXTRA_EXPORT_TARGETS`](https://jkylearmstrong.github.io/omop-duck-db/reference/EXTRA_EXPORT_TARGETS.md) : Export targets generated from the single CDM DDL source - [`load_cdm_schema()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_cdm_schema.md) : Parse the CDM DDL file into a neutral schema model - [`generate_ddl()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_ddl.md) : CREATE TABLE statements for a target database - [`lint_ddl()`](https://jkylearmstrong.github.io/omop-duck-db/reference/lint_ddl.md) : Static lint of generated DDL ## Production scoring and train/serve skew guard A fitted imputer, scaler and model bundled with the ordered feature schema; scoring refuses frames that do not match it. - [`omop_scoring_pipeline()`](https://jkylearmstrong.github.io/omop-duck-db/reference/omop_scoring_pipeline.md) : Production scoring bundle with a train/serve skew guard - [`fit_scoring_pipeline()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_scoring_pipeline.md) : Fit a scoring pipeline on a training data frame - [`validate_scoring_input()`](https://jkylearmstrong.github.io/omop-duck-db/reference/validate_scoring_input.md) : Validate a frame against a scoring pipeline's schema - [`predict_scoring_pipeline()`](https://jkylearmstrong.github.io/omop-duck-db/reference/predict_scoring_pipeline.md) [`predict_scoring_class()`](https://jkylearmstrong.github.io/omop-duck-db/reference/predict_scoring_pipeline.md) : Score new patients with a scoring pipeline - [`save_scoring_pipeline()`](https://jkylearmstrong.github.io/omop-duck-db/reference/save_scoring_pipeline.md) [`load_scoring_pipeline()`](https://jkylearmstrong.github.io/omop-duck-db/reference/save_scoring_pipeline.md) : Save / load a scoring pipeline bundle - [`scoring_pipeline_out_of_range()`](https://jkylearmstrong.github.io/omop-duck-db/reference/scoring_pipeline_out_of_range.md) : Rows per feature outside the min/max seen at fit time (a drift check) ## Ecosystem bridges (HADES & tidymodels) Interoperability with OHDSI HADES PatientLevelPrediction and R tidymodels / orbital scoring. - [`hades_preflight()`](https://jkylearmstrong.github.io/omop-duck-db/reference/hades_preflight.md) : Check that a DuckDB file is ready for OHDSI HADES (PatientLevelPrediction / DeepPatientLevelPrediction) - [`hades_needs_integer64()`](https://jkylearmstrong.github.io/omop-duck-db/reference/hades_needs_integer64.md) : Does a CDM file hold ids that R doubles cannot represent? - [`readonly_attach_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/readonly_attach_sql.md) : SQL to attach a CDM file (and its vocabulary) read-only on every connection (FR-D4) - [`readonly_connect_wrapper()`](https://jkylearmstrong.github.io/omop-duck-db/reference/readonly_connect_wrapper.md) : Wrap a connect function so every connection attaches the CDM read-only - [`checkpoint_database()`](https://jkylearmstrong.github.io/omop-duck-db/reference/checkpoint_database.md) : Checkpoint a DuckDB file so it can be distributed and attached `READ_ONLY` - [`hades_set_integer64()`](https://jkylearmstrong.github.io/omop-duck-db/reference/hades_set_integer64.md) : Keep 63-bit surrogate keys exact in DatabaseConnector (FR-C9) - [`plp_database_details()`](https://jkylearmstrong.github.io/omop-duck-db/reference/plp_database_details.md) : PatientLevelPrediction database details for an omop-duck-db DuckDB file - [`cm_database_details()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cm_database_details.md) : CohortMethod database connection details for an omop-duck-db DuckDB file - [`cohort_definition_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_definition_set.md) : Build a CohortGenerator-ready `cohortDefinitionSet` from the shipped eDERRI cohorts (FR-D3) - [`cohort_definitions_dir()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_definitions_dir.md) : The folder with the shipped cohort definitions - [`as_plp_data()`](https://jkylearmstrong.github.io/omop-duck-db/reference/as_plp_data.md) : Turn a sparse concept matrix into a PatientLevelPrediction `plpData` - [`export_plp_study_package()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_plp_study_package.md) : Automated OHDSI PatientLevelPrediction Study Package Generator - [`duckdb_to_andromeda()`](https://jkylearmstrong.github.io/omop-duck-db/reference/duckdb_to_andromeda.md) : Stream DuckDB Tables into an Andromeda Object - [`as_andromeda()`](https://jkylearmstrong.github.io/omop-duck-db/reference/as_andromeda.md) : Convert DuckDB Tables to an Andromeda Object - [`as_tidymodels_data()`](https://jkylearmstrong.github.io/omop-duck-db/reference/as_tidymodels_data.md) : Sparse concept matrix as tidymodels-ready data - [`model_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/model_concepts.md) : Concepts a fitted model actually uses - [`materialize_concept_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/materialize_concept_features.md) : Write concept features to a DuckDB table, for in-database scoring ## Study-design features Add your own person-level features (RUCA, SDI, census income, SQL or R-defined) to an OMOP study; fitted state travels with the model. - [`study_features`](https://jkylearmstrong.github.io/omop-duck-db/reference/study_features.md) : Study-design features: add your own person-level features to an OMOP study - [`study_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/study_feature.md) : Describe one study-design feature - [`feature_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`add_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`remove_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`feature_set_columns()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`check_feature_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) : Collect study-design features - [`ruca_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`sdi_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`area_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`sql_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`custom_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) : Built-in study-design features - [`stays_from_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/stays_from_cohort.md) : Index stays of a cohort table - [`compute_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compute_features.md) : Compute the features of a set for a group of index stays - [`write_feature_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_feature_set.md) : Write computed features as `measurement` rows so OHDSI tools read them - [`feature_set_state()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) [`load_feature_state()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) [`feature_set_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) [`export_feature_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) : Fitted state and manifest of a feature set - [`feature_set_covariate_settings()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_covariate_settings.md) [`feature_set_extraction_r()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_covariate_settings.md) : OHDSI FeatureExtraction settings for a feature set - [`register_feature_factory()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) [`available_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) [`make_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) [`feature_list()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) : Registry of feature kinds and named feature lists ## Geography features (RUCA and SDI) Area-level covariates derived from the address in effect at admission, with fixed training-cohort SDI cut points. - [`ruca_category()`](https://jkylearmstrong.github.io/omop-duck-db/reference/geography.md) [`validate_sdi_cut_points()`](https://jkylearmstrong.github.io/omop-duck-db/reference/geography.md) [`fit_sdi_cut_points()`](https://jkylearmstrong.github.io/omop-duck-db/reference/geography.md) [`assign_sdi_quintile()`](https://jkylearmstrong.github.io/omop-duck-db/reference/geography.md) [`read_ruca_crosswalk()`](https://jkylearmstrong.github.io/omop-duck-db/reference/geography.md) [`read_sdi_table()`](https://jkylearmstrong.github.io/omop-duck-db/reference/geography.md) [`derive_geography_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/geography.md) : Area-level geography features (RUCA, SDI) for model replication - [`find_address_tables()`](https://jkylearmstrong.github.io/omop-duck-db/reference/find_address_tables.md) [`resolve_address_table()`](https://jkylearmstrong.github.io/omop-duck-db/reference/find_address_tables.md) : Find and choose the dated address table - [`write_geography_measurements()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_geography_measurements.md) : Write derived area-level values as `measurement` rows - [`write_custom_covariates()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_custom_covariates.md) : Add your own covariates so the OHDSI tools read them - [`write_custom_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/write_custom_features.md) : Write your own features so the OHDSI tools read them - [`register_custom_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_custom_concepts.md) : Concept ids for your own feature names - [`custom_concept_registry()`](https://jkylearmstrong.github.io/omop-duck-db/reference/custom_concept_registry.md) : The custom concepts registered in a database - [`export_custom_concept_registry()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_custom_concept_registry.md) : Write the custom concept registry so sites share concept ids - [`check_custom_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_custom_concepts.md) : Check the custom concept ids of a database, alone and against other sites - [`stamp_feature_spec_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/stamp_feature_spec_concepts.md) : Record the custom concept ids in a feature spec - [`validate_bundle_concepts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/validate_bundle_concepts.md) : Compare the custom concept ids recorded in a bundle with this site's - [`custom_covariate_settings()`](https://jkylearmstrong.github.io/omop-duck-db/reference/custom_covariate_settings.md) : FeatureExtraction settings that read custom covariates - [`GEOGRAPHY_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/GEOGRAPHY_CONCEPT_IDS.md) : Local concept ids of the geography measurements - [`encoded_column_names()`](https://jkylearmstrong.github.io/omop-duck-db/reference/categorical_encoding.md) [`encode_categoricals()`](https://jkylearmstrong.github.io/omop-duck-db/reference/categorical_encoding.md) : Deterministic one-hot encoding of categorical model features from fixed level lists - [`find_metformin_only_prediabetes_pcos()`](https://jkylearmstrong.github.io/omop-duck-db/reference/find_metformin_only_prediabetes_pcos.md) : Metformin-only prediabetes / PCOS patients ## Data quality, Table 1, and Export Run Data Quality Dashboard checks, build publication-grade Table 1s, and export datasets. - [`run_dqd()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_dqd.md) : Run Native DuckDB DataQualityDashboard (DQD) Engine - [`run_dqd_catalog()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_dqd_catalog.md) : Schema-driven DataQualityDashboard checks in DuckDB - [`run_dqd_full()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_dqd_full.md) : [`run_dqd()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_dqd.md) and [`run_dqd_catalog()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_dqd_catalog.md) in one DQD-shaped result - [`explain_cohort_gaps()`](https://jkylearmstrong.github.io/omop-duck-db/reference/explain_cohort_gaps.md) : Why is a reference patient not in the cohort? - [`reconcile_cohort()`](https://jkylearmstrong.github.io/omop-duck-db/reference/reconcile_cohort.md) : Compare a reference patient list with a cohort built here and explain the patients we miss - [`suppress_small_cells()`](https://jkylearmstrong.github.io/omop-duck-db/reference/suppress_small_cells.md) : Blank small counts so a report can leave a site - [`ablate_feature_groups()`](https://jkylearmstrong.github.io/omop-duck-db/reference/ablate_feature_groups.md) : How much does each group of features contribute? - [`compare_model_runs()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_model_runs.md) : Are two sets of predictions for the same patients really different? - [`ridge_logistic_fit_predict()`](https://jkylearmstrong.github.io/omop-duck-db/reference/ridge_logistic_fit_predict.md) : Ridge-regularised logistic regression for the ablation tools - [`sanitize_measurements()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sanitize_measurements.md) : Sanitize implausible numeric measurements (physiologic limits or statistical outliers) - [`generate_table1()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_table1.md) : Generate Table 1 and Completeness Matrix - [`export_table1()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_table1.md) : Export Table 1 or Table 1b to Markdown, LaTeX, Quarto, Typst, or CSV - [`table1_to_quarto()`](https://jkylearmstrong.github.io/omop-duck-db/reference/table1_to_quarto.md) : Format Table 1 into Publication-Grade Quarto Manuscript Syntax - [`table1_to_typst()`](https://jkylearmstrong.github.io/omop-duck-db/reference/table1_to_typst.md) : Format Table 1 into Native Typst Manuscript Table Syntax - [`generate_table3_odds_ratios()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_table3_odds_ratios.md) : Table 3: multivariable logistic-regression odds ratios with clinically scaled increments - [`export_table3()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_table3.md) : Export a Table 3 odds-ratio table - [`to_markdown()`](https://jkylearmstrong.github.io/omop-duck-db/reference/to_markdown.md) : Convert Object to Markdown Table - [`to_latex()`](https://jkylearmstrong.github.io/omop-duck-db/reference/to_latex.md) : Convert Object to LaTeX Table - [`validate_table1_reconciliation()`](https://jkylearmstrong.github.io/omop-duck-db/reference/validate_table1_reconciliation.md) : Validate Table 1 Reconciliation against Published Baseline - [`export_cdm()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_cdm.md) : Enterprise Multi-Target Export Engine for OMOP DuckDB CDM - [`export_to_parquet()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_to_parquet.md) : Export a CDM Table to Parquet - [`DEFAULT_LAB_LOINCS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_LAB_LOINCS.md) : Table 1 Descriptive Statistics Generator and Validation Harness - [`DEFAULT_MEDICATION_CONCEPTS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_MEDICATION_CONCEPTS.md) : Default Core Chronic Medication Classes (ATC / RxNorm Ancestors) - [`DEFAULT_VITAL_LOINCS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_VITAL_LOINCS.md) : Default Vital Sign LOINC Mappings ## Causal inference and survival analysis In-engine propensity score weighting (IPTW/SMR) and Kaplan-Meier / Competing Risks estimators. - [`generate_propensity_weights()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_propensity_weights.md) : In-Engine Propensity Score and Inverse Probability of Treatment Weighting (IPTW) Module - [`estimate_km_survival()`](https://jkylearmstrong.github.io/omop-duck-db/reference/estimate_km_survival.md) : Kaplan-Meier Survival and Fine-Gray Competing Risks Cumulative Incidence (CIF) Estimator - [`estimate_cif()`](https://jkylearmstrong.github.io/omop-duck-db/reference/estimate_cif.md) : Cause-Specific Cumulative Incidence Function (CIF) Estimator - [`fine_gray_estimator()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fine_gray_estimator.md) : Fine-Gray Subdistribution Hazard Estimator - [`plot_cif()`](https://jkylearmstrong.github.io/omop-duck-db/reference/plot_cif.md) : Plot Cumulative Incidence Function (CIF) ## Wide-table ingestion, datetime normalization and file paths Staged one-concept-per-commit loading of wide measurement tables, vectorized timestamp parsing, safe SQL file paths, and ETL source-view helpers. - [`load_wide_measurement()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_wide_measurement.md) : Staged, sequential ingestion of wide measurement tables - [`DEFAULT_VITAL_CONCEPT_MAPPING`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_VITAL_CONCEPT_MAPPING.md) : Default PCORnet VITAL concept mapping for [`load_wide_measurement()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_wide_measurement.md) - [`DEFAULT_VITAL_PLAUSIBILITY_FILTERS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_VITAL_PLAUSIBILITY_FILTERS.md) : Default clinical plausibility bounds for PCORnet vitals - [`vectorized_strptime()`](https://jkylearmstrong.github.io/omop-duck-db/reference/vectorized_strptime.md) [`normalize_time_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/vectorized_strptime.md) : Vectorized, fault-tolerant datetime normalization for messy EHR feeds - [`install_vectorized_strptime()`](https://jkylearmstrong.github.io/omop-duck-db/reference/install_vectorized_strptime.md) : Register `normalize_time()` and [`vectorized_strptime()`](https://jkylearmstrong.github.io/omop-duck-db/reference/vectorized_strptime.md) SQL macros on a connection - [`DEFAULT_DATETIME_FORMATS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_DATETIME_FORMATS.md) : Default prioritized datetime formats - [`sanitize_sql_path()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sanitize_sql_path.md) [`sql_path_literal()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sanitize_sql_path.md) : Cross-platform path sanitization for DuckDB file operations - [`read_csv_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) [`read_parquet_sql()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) [`attach_database()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) [`sql_copy_to()`](https://jkylearmstrong.github.io/omop-duck-db/reference/sql_path_helpers.md) : SQL table-function expressions and file operations with sanitized paths - [`build_safe_source_view()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_safe_source_view.md) : Fault-tolerant view over a source CSV ## Resource governor Size DuckDB memory, thread count and disk-spill location to the host. - [`configure_resources()`](https://jkylearmstrong.github.io/omop-duck-db/reference/configure_resources.md) : Size a DuckDB connection to the host: RAM limit, disk-spill location and threads - [`detect_system_ram()`](https://jkylearmstrong.github.io/omop-duck-db/reference/detect_system_ram.md) : Detect physical system RAM ## Medication-class strategies and phenotype DSL Dual-strategy (source crosswalk vs OMOP hierarchy) medication classification with a per-site kappa auditor, and a composable phenotype cohort DSL compiled to single-pass SQL. - [`extract_medication_classes()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_medication_classes.md) : Dual-strategy medication-class classifier - [`extract_medication_transitions()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_medication_transitions.md) : Extract medication trajectory flags across care transitions - [`medication_transitions()`](https://jkylearmstrong.github.io/omop-duck-db/reference/medication_transitions.md) : Transitions-of-care medication trajectories and trajectory summary statistics - [`audit_medication_strategies()`](https://jkylearmstrong.github.io/omop-duck-db/reference/audit_medication_strategies.md) : Per-site agreement audit of the source-crosswalk and OMOP-hierarchy strategies - [`condition_criteria()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_criteria.md) [`measurement_criteria()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_criteria.md) [`drug_criteria()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_criteria.md) : Composable phenotype cohort DSL compiled to single-pass DuckDB SQL - [`everyone()`](https://jkylearmstrong.github.io/omop-duck-db/reference/everyone.md) : All persons (base population for `!x`) - [`phenotype_union()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_operators.md) [`phenotype_intersect()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_operators.md) [`phenotype_not()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_operators.md) : Logical operators over phenotype expressions - [`phenotype_to_list()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_serialize.md) [`phenotype_from_list()`](https://jkylearmstrong.github.io/omop-duck-db/reference/phenotype_serialize.md) : Convert a phenotype expression to / from a plain list - [`compile_phenotype()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compile_phenotype.md) : Compile a phenotype expression to DuckDB SQL - [`execute_phenotype()`](https://jkylearmstrong.github.io/omop-duck-db/reference/execute_phenotype.md) : Compile and run a phenotype into a cohort table ## Bounds, units, domain profiles and cohort flow Physiologic bounding and unit harmonization, clinical domain profiles for Table 1, medication windows, CONSORT cohort flow, completeness profiling and the Arrow hand-off to PatientLevelPrediction. - [`DEFAULT_PHYSIOLOGIC_BOUNDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_PHYSIOLOGIC_BOUNDS.md) : Default physiologic plausibility bounds (Adult) - [`POPULATION_PHYSIOLOGIC_BOUNDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/POPULATION_PHYSIOLOGIC_BOUNDS.md) : Pluggable physiologic bounding and unit harmonization for measurements - [`DEFAULT_UNIT_RULES`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_UNIT_RULES.md) : Default unit-conversion rules - [`resolve_bounds()`](https://jkylearmstrong.github.io/omop-duck-db/reference/resolve_bounds.md) : Resolve bounds: defaults merged with user overrides - [`filter_bounds()`](https://jkylearmstrong.github.io/omop-duck-db/reference/filter_bounds.md) : Apply physiologic bounds to a data frame - [`harmonize_measurement_units()`](https://jkylearmstrong.github.io/omop-duck-db/reference/harmonize_measurement_units.md) : Unit-normalization preflight for the measurement table - [`harmonize_anthropometrics()`](https://jkylearmstrong.github.io/omop-duck-db/reference/harmonize_anthropometrics.md) : Anthropometric Harmonization (Height, Weight, and Calculated BMI) - [`medication_extractor()`](https://jkylearmstrong.github.io/omop-duck-db/reference/medication_extractor.md) : Medication exposure engine bound to a connection and drug-class specs - [`domain_profiles`](https://jkylearmstrong.github.io/omop-duck-db/reference/domain_profiles.md) : Modular clinical domain profiles and [`table1_generator()`](https://jkylearmstrong.github.io/omop-duck-db/reference/table1_generator.md) - [`domain_profile_names()`](https://jkylearmstrong.github.io/omop-duck-db/reference/domain_profile_names.md) : Built-in domain profile names - [`load_domain_profile()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_domain_profile.md) : Load a domain profile - [`table1_generator()`](https://jkylearmstrong.github.io/omop-duck-db/reference/table1_generator.md) : Table 1 generator extended by clinical domain profiles - [`cohort_flow()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_flow.md) : Sequential cohort filters, one set of counts, CONSORT outputs and pre-flight checks - [`to_graphviz()`](https://jkylearmstrong.github.io/omop-duck-db/reference/to_graphviz.md) : Convert an attrition table to Graphviz DOT source - [`generate_table2()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_table2.md) : Completeness / sentinel profiler ("Table 2") - [`as_plp_arrow()`](https://jkylearmstrong.github.io/omop-duck-db/reference/as_plp_arrow.md) : Stream a wide feature table into PatientLevelPrediction-shaped Arrow tables - [`plp_arrow_to_plp_data()`](https://jkylearmstrong.github.io/omop-duck-db/reference/plp_arrow_to_plp_data.md) : Turn [`as_plp_arrow()`](https://jkylearmstrong.github.io/omop-duck-db/reference/as_plp_arrow.md) output into a `plpData` object ## Large-file sync Synchronize DuckDB databases and vocabulary files via Google Drive. - [`gdrive_upload_snapshot()`](https://jkylearmstrong.github.io/omop-duck-db/reference/gdrive_upload_snapshot.md) : Upload the large generated artifacts to Google Drive - [`gdrive_download_latest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/gdrive_download_latest.md) : Download the latest snapshot from Google Drive ## Advanced analytics, causal inference, and data quality (v0.6.4) Negative controls, semantic concept set optimizer, trajectory features, federated survival, and synthetic twins. - [`add_missing_indicators()`](https://jkylearmstrong.github.io/omop-duck-db/reference/add_missing_indicators.md) : Add Missing Indicator Columns - [`assert_exposure_coverage()`](https://jkylearmstrong.github.io/omop-duck-db/reference/assert_exposure_coverage.md) : Assert Non-Zero Medication Exposure Coverage Across Sites - [`audit_code_list_coverage()`](https://jkylearmstrong.github.io/omop-duck-db/reference/audit_code_list_coverage.md) : Audit Clinical Code List Coverage - [`calibrate_estimates()`](https://jkylearmstrong.github.io/omop-duck-db/reference/calibrate_estimates.md) : Calibrate Nominal Study Estimates Using Empirical Null Distribution - [`check_vocabulary_provenance()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_vocabulary_provenance.md) : Check Vocabulary Provenance Between Databases - [`cohort_diagnostics`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_diagnostics.md) : OHDSI Cohort Diagnostics in Pure DuckDB - [`cohort_flow_tools`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_flow_tools.md) : [`cohort_flow()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_flow.md) (computable phenotype + CONSORT), [`generate_table2()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_table2.md) (completeness profiler) and [`as_plp_arrow()`](https://jkylearmstrong.github.io/omop-duck-db/reference/as_plp_arrow.md) (in-memory Arrow hand-off to PatientLevelPrediction) - [`cohort_from_index_stays()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_from_index_stays.md) : Force Study Cohort Index Stays from an External List - [`cohort_overlap()`](https://jkylearmstrong.github.io/omop-duck-db/reference/cohort_overlap.md) : Cohort Reconciliation and Membership Overlap - [`compare_feature_tables()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compare_feature_tables.md) : Feature Parity Ledger Comparing Two Derivations - [`concept_optimizer`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_optimizer.md) : Semantic Concept Set Optimizer & Usagi Auto-Suggester Module - [`consortium_patient_overlap()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_patient_overlap.md) : Consortium Patient Overlap - [`consortium_cross_site_duplicates()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_cross_site_duplicates.md) : Consortium Cross-Site Duplicate Patients - [`consortium_duplicate_report()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_duplicate_report.md) : Cross-site duplicate patients as one object that holds only safe aggregates - [`consortium_propensity_score()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_propensity_score.md) : Consortium Causal Inference Propensity Engine - [`consortium_survival_meta_analysis()`](https://jkylearmstrong.github.io/omop-duck-db/reference/consortium_survival_meta_analysis.md) : Multi-Site Federated Survival Meta-Analysis - [`detect_redundant_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/detect_redundant_features.md) : Detect Redundant and Derived Features (Constant Ratios, Differences, Collinearities) - [`dqd_summary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/dqd_summary.md) : Verify DQD Pass-Rate Mathematical Consistency and Reproducibility - [`explain_medication_disagreement()`](https://jkylearmstrong.github.io/omop-duck-db/reference/explain_medication_disagreement.md) : Explain Strategy Disagreements for Medication Exposure - [`export_medication_crosswalk()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_medication_crosswalk.md) : Export Medication Class Crosswalk from OMOP Hierarchy - [`extract_temporal_trajectories()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_temporal_trajectories.md) : Extract Longitudinal Measurement Trajectory Features - [`federated_survival`](https://jkylearmstrong.github.io/omop-duck-db/reference/federated_survival.md) : Multi-Site Federated Survival Meta-Analysis Module - [`generate_negative_controls()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_negative_controls.md) : Generate Candidate Negative Control Concepts - [`generate_site_patient_tokens()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_site_patient_tokens.md) : Generate Salted Site Patient Tokens - [`generate_synthetic_omop_twin()`](https://jkylearmstrong.github.io/omop-duck-db/reference/generate_synthetic_omop_twin.md) : Generate Synthetic OMOP Twin Database - [`integrity`](https://jkylearmstrong.github.io/omop-duck-db/reference/integrity.md) : Data Integrity, Statistical Leakage Scan, Informative Missingness, Provenance, and Overlap Tools - [`leakage_scan()`](https://jkylearmstrong.github.io/omop-duck-db/reference/leakage_scan.md) : Statistical Leakage Scan - [`manuscript`](https://jkylearmstrong.github.io/omop-duck-db/reference/manuscript.md) : End-to-End Manuscript Scaffold Builder - [`match_nearest_neighbor()`](https://jkylearmstrong.github.io/omop-duck-db/reference/match_nearest_neighbor.md) : 1:k Nearest-Neighbor Caliper Matching on Propensity Scores - [`missingness_by_outcome()`](https://jkylearmstrong.github.io/omop-duck-db/reference/missingness_by_outcome.md) : Missingness Stratified by Outcome - [`negative_controls`](https://jkylearmstrong.github.io/omop-duck-db/reference/negative_controls.md) : Automated Negative Control & Empirical Calibration Module - [`numbers_of_record()`](https://jkylearmstrong.github.io/omop-duck-db/reference/numbers_of_record.md) : Numbers-of-Record Manifest - [`observation_period_diagnostics()`](https://jkylearmstrong.github.io/omop-duck-db/reference/observation_period_diagnostics.md) : Observation Period Diagnostics - [`omopduckdb`](https://jkylearmstrong.github.io/omop-duck-db/reference/omopduckdb-package.md) [`omopduckdb-package`](https://jkylearmstrong.github.io/omop-duck-db/reference/omopduckdb-package.md) : omopduckdb: Build and Populate an OMOP CDM v5.4 Database in DuckDB - [`optimize_concept_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/optimize_concept_set.md) : Optimize Concept Set and Suggest Missing Codes - [`panel_missingness_audit()`](https://jkylearmstrong.github.io/omop-duck-db/reference/panel_missingness_audit.md) : Audit Laboratory Panel Completeness and Discordant Missingness - [`planned_readmission_filter()`](https://jkylearmstrong.github.io/omop-duck-db/reference/planned_readmission_filter.md) : Planned-Readmission Filter - [`plausibility_report()`](https://jkylearmstrong.github.io/omop-duck-db/reference/plausibility_report.md) : Table and Feature-Level Physiological Plausibility Report and CI Gate - [`plot_consort_flow()`](https://jkylearmstrong.github.io/omop-duck-db/reference/plot_consort_flow.md) : Plot Visual Cohort Attrition Flow (CONSORT / Sankey) - [`small_cell_mask()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`format_count()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`suppress_small_counts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`suppress_attrition_table()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`assert_disclosure_safe()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) : Small-cell suppression and disclosure control - [`audit_matrix_parity()`](https://jkylearmstrong.github.io/omop-duck-db/reference/audit_matrix_parity.md) : Parity audit between a legacy table and its OMOP-derived counterpart - [`plot_love_plot()`](https://jkylearmstrong.github.io/omop-duck-db/reference/plot_love_plot.md) : Generate SVG Love Plot for Covariate Balance - [`plot_multisite_attrition_heatmap()`](https://jkylearmstrong.github.io/omop-duck-db/reference/plot_multisite_attrition_heatmap.md) : Generate Multi-Site Attrition Heatmap - [`provenance()`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance.md) : Provenance Stamp - [`quality`](https://jkylearmstrong.github.io/omop-duck-db/reference/quality.md) : Data Quality, Plausibility, and Feature Integrity Audits - [`reconciliation`](https://jkylearmstrong.github.io/omop-duck-db/reference/reconciliation.md) : Pipeline Reconciliation, Cohort Overlap, and Parity Ledger - [`run_study_grid()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_study_grid.md) : Study Sensitivity Grid Execution - [`scan_document_numbers()`](https://jkylearmstrong.github.io/omop-duck-db/reference/scan_document_numbers.md) : Scan Document Numbers for Stale Figures - [`synthetic`](https://jkylearmstrong.github.io/omop-duck-db/reference/synthetic.md) : Automated Synthetic OMOP Twin Cohort Generator Module - [`trajectories`](https://jkylearmstrong.github.io/omop-duck-db/reference/trajectories.md) : Longitudinal Temporal Trajectory Features Module - [`vocabulary_preflight()`](https://jkylearmstrong.github.io/omop-duck-db/reference/vocabulary_preflight.md) : Runs a comprehensive preflight verification of OMOP CDM vocabulary coverage, ATC hierarchies, unmapped concept 0 rates across clinical tables, and drug exposure types. ## EHR prescriptions, adherence, and acute trajectories (v0.6.5 - v0.6.6) Modern multi-vocabulary drug exposure routing, combination products, PDC adherence, unit discordance, and acute lab trajectories. - [`DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS.md) [`DEFAULT_ADMINISTERED_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS.md) [`DEFAULT_DISPENSED_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS.md) : Default OMOP CDM concept sets for drug exposure types - [`KNOWN_UNIT_CONVERSIONS`](https://jkylearmstrong.github.io/omop-duck-db/reference/KNOWN_UNIT_CONVERSIONS.md) : Known laboratory unit conversions and standard ratios - [`audit_combination_products()`](https://jkylearmstrong.github.io/omop-duck-db/reference/audit_combination_products.md) : Combination Product Disaggregation Audit - [`compute_adherence_pdc()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compute_adherence_pdc.md) : Compute Adherence (PDC & MPR) - [`compute_drug_eras()`](https://jkylearmstrong.github.io/omop-duck-db/reference/compute_drug_eras.md) : Compute Drug Eras On-The-Fly - [`detect_unit_discordance()`](https://jkylearmstrong.github.io/omop-duck-db/reference/detect_unit_discordance.md) : Detect Unit Discordance & Bimodal Normalization - [`export_companion_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_companion_manifest.md) : Export Companion Identifier Manifest - [`extract_acute_trajectories()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_acute_trajectories.md) : Extract Acute In-Hospital Episode Trajectories - [`impute_encounter_observations()`](https://jkylearmstrong.github.io/omop-duck-db/reference/impute_encounter_observations.md) : Deterministic In-Encounter LOCF & Leakage-Safe Imputation - [`load_drug_exposure()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_drug_exposure.md) : Load Drug Exposure Records from PCORnet Extract - [`load_macros()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_macros.md) : Load SQL Macros into Connection - [`normalize_units()`](https://jkylearmstrong.github.io/omop-duck-db/reference/normalize_units.md) : Normalize Units - [`stream_to_parquet()`](https://jkylearmstrong.github.io/omop-duck-db/reference/stream_to_parquet.md) : Stream object out-of-core to Parquet dataset - [`to_arrow_dataset()`](https://jkylearmstrong.github.io/omop-duck-db/reference/to_arrow_dataset.md) : Convert object to Arrow Dataset - [`extract_benchmark_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_benchmark_features.md) : Leakage-free benchmark feature table in one call - [`adjust_for_prevalence()`](https://jkylearmstrong.github.io/omop-duck-db/reference/adjust_for_prevalence.md) : Prior-shift correction between a training and a target prevalence - [`BENCHMARK_LAB_LOINCS`](https://jkylearmstrong.github.io/omop-duck-db/reference/BENCHMARK_LAB_LOINCS.md) [`BENCHMARK_VITAL_LOINCS`](https://jkylearmstrong.github.io/omop-duck-db/reference/BENCHMARK_LAB_LOINCS.md) : LOINC codes per lab and per vital sign for the benchmark feature table - [`build_concept_tokenizer()`](https://jkylearmstrong.github.io/omop-duck-db/reference/build_concept_tokenizer.md) : Build a concept tokenizer (omop-learn layout) - [`capacity_risk_tiers()`](https://jkylearmstrong.github.io/omop-duck-db/reference/capacity_risk_tiers.md) : Two risk tiers whose cut-point is set by capacity - [`capacity_threshold()`](https://jkylearmstrong.github.io/omop-duck-db/reference/capacity_threshold.md) : Probability cut-off that flags the riskiest share - [`DEFAULT_BOUNDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_BOUNDS.md) [`DEFAULT_RESCALE`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_BOUNDS.md) [`DEFAULT_UNIT_CONVERSIONS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_BOUNDS.md) : Physiologic plausibility bounds and rescaling for single vital / lab measurements - [`DEFAULT_DISPOSITION_MAP`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_DISPOSITION_MAP.md) : Discharge disposition concept -\> benchmark category - [`EDERRI_MEDICATION_SPECS`](https://jkylearmstrong.github.io/omop-duck-db/reference/EDERRI_MEDICATION_SPECS.md) : Medication classes of the eDERRI protocol - [`evaluate_at_capacity()`](https://jkylearmstrong.github.io/omop-duck-db/reference/evaluate_at_capacity.md) : What flagging the riskiest share achieves - [`evaluate_loso_transport()`](https://jkylearmstrong.github.io/omop-duck-db/reference/evaluate_loso_transport.md) : Leave-one-site-out transport evaluation - [`export_concept_vocabulary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_concept_vocabulary.md) [`import_concept_vocabulary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_concept_vocabulary.md) : Freeze and share a tokenizer - [`extract_protocol_history_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_protocol_history_features.md) : The eDERRI protocol's history columns - [`fit_recalibrator()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_recalibrator.md) : Fit a recalibration map - [`isotonic_fit()`](https://jkylearmstrong.github.io/omop-duck-db/reference/isotonic_fit.md) [`isotonic_apply()`](https://jkylearmstrong.github.io/omop-duck-db/reference/isotonic_fit.md) : Isotonic recalibration (pool-adjacent-violators) - [`make_pretraining_targets()`](https://jkylearmstrong.github.io/omop-duck-db/reference/make_pretraining_targets.md) : Masked-concept and next-visit pre-training targets - [`platt_scaling_fit()`](https://jkylearmstrong.github.io/omop-duck-db/reference/platt_scaling_fit.md) [`platt_scaling_apply()`](https://jkylearmstrong.github.io/omop-duck-db/reference/platt_scaling_fit.md) : Platt scaling of probabilities ## Hierarchical rollups, tabular loaders, concept patterns, fuzzy mappings, domain provenance, and Parquet crosswalk cache (v0.6.7 - v0.6.8) Declarative multi-domain hierarchical rollups, native tabular and workbook loaders, bundled clinical code lists, concept set pattern matching, DuckDB in-database fuzzy string matching, clinical provenance filters, Parquet crosswalk materialization, and vocabulary drift auditing. - [`audit_concept_drift()`](https://jkylearmstrong.github.io/omop-duck-db/reference/audit_concept_drift.md) : Audit Concept Drift Across Vocabulary Releases - [`concept_pattern()`](https://jkylearmstrong.github.io/omop-duck-db/reference/concept_pattern.md) : Define a Concept Pattern Specification - [`extract_rollup_exposures()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_rollup_exposures.md) : Extract Cohort Exposures Matched to Rollup - [`filter_conditions()`](https://jkylearmstrong.github.io/omop-duck-db/reference/filter_conditions.md) : Filter Conditions by Diagnostic Provenance - [`filter_measurements()`](https://jkylearmstrong.github.io/omop-duck-db/reference/filter_measurements.md) : Filter Measurements by Clinical Provenance - [`filter_visits()`](https://jkylearmstrong.github.io/omop-duck-db/reference/filter_visits.md) : Filter Visits by Clinical Provenance - [`hierarchical_rollup()`](https://jkylearmstrong.github.io/omop-duck-db/reference/hierarchical_rollup.md) : Define a Hierarchical Rollup Specification - [`hierarchical_rollup_from_bundled()`](https://jkylearmstrong.github.io/omop-duck-db/reference/hierarchical_rollup_from_bundled.md) : Load Hierarchical Rollup from Bundled Reference Code Lists - [`hierarchical_rollup_from_csv()`](https://jkylearmstrong.github.io/omop-duck-db/reference/hierarchical_rollup_from_csv.md) : Load Hierarchical Rollup from a CSV File - [`hierarchical_rollup_from_excel()`](https://jkylearmstrong.github.io/omop-duck-db/reference/hierarchical_rollup_from_excel.md) : Load Hierarchical Rollup from an Excel Worksheet - [`materialize_crosswalk()`](https://jkylearmstrong.github.io/omop-duck-db/reference/materialize_crosswalk.md) : Materialize Crosswalk from Rollup Specification - [`DEFAULT_INPATIENT_VISIT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_OUTPATIENT_VISIT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_EMERGENCY_VISIT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_PRIMARY_CONDITION_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_ADMITTING_CONDITION_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_PROBLEM_LIST_CONDITION_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_LAB_RESULT_MEASUREMENT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_ORDER_MEASUREMENT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_POC_MEASUREMENT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) : Modern OMOP CDM Visit, Condition, and Measurement Provenance Concept IDs - [`resolve_concept_patterns()`](https://jkylearmstrong.github.io/omop-duck-db/reference/resolve_concept_patterns.md) : Resolve Concept Patterns with Wildcards and Hierarchy Closures - [`rollup_engine()`](https://jkylearmstrong.github.io/omop-duck-db/reference/rollup_engine.md) : Define a Rollup Engine Specification - [`rollup_engine_from_bundled()`](https://jkylearmstrong.github.io/omop-duck-db/reference/rollup_engine_from_bundled.md) : Load Rollup Engine from Bundled Reference Code Lists - [`rollup_engine_from_csvs()`](https://jkylearmstrong.github.io/omop-duck-db/reference/rollup_engine_from_csvs.md) : Load Rollup Engine from a Sequence of CSV Files - [`rollup_engine_from_excel()`](https://jkylearmstrong.github.io/omop-duck-db/reference/rollup_engine_from_excel.md) : Load Rollup Engine from an Excel Workbook - [`rollup_engine_from_folder()`](https://jkylearmstrong.github.io/omop-duck-db/reference/rollup_engine_from_folder.md) : Load Rollup Engine by Scanning a Directory of CSV Files - [`rollups`](https://jkylearmstrong.github.io/omop-duck-db/reference/rollups.md) : Extensible Hierarchical Rollups, Concept Pattern Matching, and Crosswalk Materialization - [`spec_hash()`](https://jkylearmstrong.github.io/omop-duck-db/reference/spec_hash.md) : Compute Cryptographic SHA-256 Hash of Rollup Specification - [`suggest_source_mappings()`](https://jkylearmstrong.github.io/omop-duck-db/reference/suggest_source_mappings.md) : In-Database Fuzzy and Partial Matching for Unmapped Codes ## Other exported functions and constants Study-feature, disclosure, calibration and constant helpers not grouped above. - [`BENCHMARK_LAB_LOINCS`](https://jkylearmstrong.github.io/omop-duck-db/reference/BENCHMARK_LAB_LOINCS.md) [`BENCHMARK_VITAL_LOINCS`](https://jkylearmstrong.github.io/omop-duck-db/reference/BENCHMARK_LAB_LOINCS.md) : LOINC codes per lab and per vital sign for the benchmark feature table - [`DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS.md) [`DEFAULT_ADMINISTERED_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS.md) [`DEFAULT_DISPENSED_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_PRESCRIBED_TYPE_CONCEPT_IDS.md) : Default OMOP CDM concept sets for drug exposure types - [`DEFAULT_INPATIENT_VISIT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_OUTPATIENT_VISIT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_EMERGENCY_VISIT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_PRIMARY_CONDITION_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_ADMITTING_CONDITION_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_PROBLEM_LIST_CONDITION_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_LAB_RESULT_MEASUREMENT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_ORDER_MEASUREMENT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) [`DEFAULT_POC_MEASUREMENT_TYPE_CONCEPT_IDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/provenance_concept_ids.md) : Modern OMOP CDM Visit, Condition, and Measurement Provenance Concept IDs - [`DEFAULT_BOUNDS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_BOUNDS.md) [`DEFAULT_RESCALE`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_BOUNDS.md) [`DEFAULT_UNIT_CONVERSIONS`](https://jkylearmstrong.github.io/omop-duck-db/reference/DEFAULT_BOUNDS.md) : Physiologic plausibility bounds and rescaling for single vital / lab measurements - [`extract_longitudinal_tensors()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) [`MAX_LONGITUDINAL_VISITS`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) [`MAX_TOKENS_PER_VISIT`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) [`VOCAB_SIZE`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_longitudinal_tensors.md) : Longitudinal sequence tensors for deep sequence models - [`feature_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`add_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`remove_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`feature_set_columns()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) [`check_feature_set()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set.md) : Collect study-design features - [`ruca_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`sdi_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`area_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`sql_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) [`custom_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/builtin_study_features.md) : Built-in study-design features - [`small_cell_mask()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`format_count()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`suppress_small_counts()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`suppress_attrition_table()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) [`assert_disclosure_safe()`](https://jkylearmstrong.github.io/omop-duck-db/reference/disclosure.md) : Small-cell suppression and disclosure control - [`register_feature_factory()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) [`available_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) [`make_feature()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) [`feature_list()`](https://jkylearmstrong.github.io/omop-duck-db/reference/register_feature_factory.md) : Registry of feature kinds and named feature lists - [`population_stability_index()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) [`calibration_summary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) [`monitor_scores()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) [`update_monitoring_log()`](https://jkylearmstrong.github.io/omop-duck-db/reference/population_stability_index.md) : Post-deployment drift and calibration monitoring - [`check_key_collisions()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_key_collisions.md) [`check_etl_keys()`](https://jkylearmstrong.github.io/omop-duck-db/reference/check_key_collisions.md) : Build-time surrogate-key collision check - [`feature_set_state()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) [`load_feature_state()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) [`feature_set_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) [`export_feature_manifest()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_state.md) : Fitted state and manifest of a feature set - [`extract_patient_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_patient_features.md) [`extract_features()`](https://jkylearmstrong.github.io/omop-duck-db/reference/extract_patient_features.md) : Extract Machine Learning Feature Matrix from OMOP CDM - [`feature_set_covariate_settings()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_covariate_settings.md) [`feature_set_extraction_r()`](https://jkylearmstrong.github.io/omop-duck-db/reference/feature_set_covariate_settings.md) : OHDSI FeatureExtraction settings for a feature set - [`export_concept_vocabulary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_concept_vocabulary.md) [`import_concept_vocabulary()`](https://jkylearmstrong.github.io/omop-duck-db/reference/export_concept_vocabulary.md) : Freeze and share a tokenizer - [`isotonic_fit()`](https://jkylearmstrong.github.io/omop-duck-db/reference/isotonic_fit.md) [`isotonic_apply()`](https://jkylearmstrong.github.io/omop-duck-db/reference/isotonic_fit.md) : Isotonic recalibration (pool-adjacent-violators) - [`load_vital()`](https://jkylearmstrong.github.io/omop-duck-db/reference/load_vital.md) : Load PCORnet VITAL into measurement and observation - [`fit_capacity_thresholds()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_capacity_thresholds.md) [`map_risk_tiers()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_capacity_thresholds.md) [`tier_load()`](https://jkylearmstrong.github.io/omop-duck-db/reference/fit_capacity_thresholds.md) : Capacity-calibrated risk tiers - [`platt_scaling_fit()`](https://jkylearmstrong.github.io/omop-duck-db/reference/platt_scaling_fit.md) [`platt_scaling_apply()`](https://jkylearmstrong.github.io/omop-duck-db/reference/platt_scaling_fit.md) : Platt scaling of probabilities - [`run_manifest_add_step()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_manifest_add_step.md) [`run_manifest_add_input()`](https://jkylearmstrong.github.io/omop-duck-db/reference/run_manifest_add_step.md) : Add an input file or an attrition step to a run manifest # Articles ### Build and operate Create the CDM, load the vocabulary, map concepts, run the tests. - [Building the database, vocabulary and concept mapping](https://jkylearmstrong.github.io/omop-duck-db/articles/database_and_mapping.md): ### Cohorts and features - [Study cohorts, comorbidity, sanitisation and Table 1](https://jkylearmstrong.github.io/omop-duck-db/articles/study_cohorts_and_features.md): - [Study-design features: add your own person-level features to an OMOP study](https://jkylearmstrong.github.io/omop-duck-db/articles/study_features.md): - [Study-design features and tools for a downstream study](https://jkylearmstrong.github.io/omop-duck-db/articles/study_design_tools.md): ### Clinical tools and multi-site work - [Clinical tools, risk scores and consortium federation](https://jkylearmstrong.github.io/omop-duck-db/articles/clinical_tools_and_consortium.md): - [Disclosure control, CONSORT counts and site summary packages](https://jkylearmstrong.github.io/omop-duck-db/articles/disclosure_and_site_packages.md): ### Machine learning and OHDSI - [ML bridge: omop-learn, scikit-learn, SARD and OHDSI PLP](https://jkylearmstrong.github.io/omop-duck-db/articles/ml_bridge.md): - [Benchmark features, deep-learning datasets, DGX Spark and Oracle](https://jkylearmstrong.github.io/omop-duck-db/articles/deep_learning_and_benchmarks.md): - [omop-duck-db and the OHDSI tools](https://jkylearmstrong.github.io/omop-duck-db/articles/ohdsi_integration.md): ### Cloud and demos - [Run the diabetes cohort on public BigQuery data (CMS SynPUF)](https://jkylearmstrong.github.io/omop-duck-db/articles/bigquery_synthetic_demo.md): ### Reproducibility and status - [Run this study at your site](https://jkylearmstrong.github.io/omop-duck-db/articles/sister_site_guide.md): - [Reproducing the delivered manuscript and the decisions that move the numbers](https://jkylearmstrong.github.io/omop-duck-db/articles/reproducing_the_manuscript.md): - [Status, verification and roadmap](https://jkylearmstrong.github.io/omop-duck-db/articles/status_and_roadmap.md):