How cogstack/dbt_mimic_omop works
This repository converts MIMIC-IV into OMOP CDM tables with dbt, with optional note NLP and MIMIC-CXR imaging extensions. Users load clinical CSVs, vocabularies, and optionally imaging metadata into DuckDB, then run dbt to produce cleaned/mapped intermediate data and gold tables. The graph preserves the documented clinical, vocabulary, note, imaging, and metrics branches. SQL model relationships are not asserted individually because their contents were not sampled; edges reflect only loader code and README statements.
Main entry points: gold OMOP CDM models · load_mimic_to_duckdb.py MIMIC loader · load_vocabularies_to_duckdb.py Vocabulary loader · load_mimic_cxr_to_duckdb.py CXR loader
Components 15
Data loading
- MIMIC-IV files
data/mimic - Vocabulary files
data/custom_mappings - CXR metadata
data/mimic_cxr - MIMIC loader
load_mimic_to_duckdb.py - Vocabulary loader
load_vocabularies_to_duckdb.py - CXR loader
load_mimic_cxr_to_duckdb.py - DuckDB database
dbt transformation
- Staging and mapping
models/silver
Clinical outputs
- OMOP CDM models
models/gold - Vocabulary tables
models/gold/vocabulary
Extensions and metrics
- Notes and NLP
models/gold/note - Imaging extension
models/silver/mimic_cxr - Image tables
models/gold/image_occurrence - Summary metrics
models/gold/metrics
Other components
- Pipeline user
Connections 16
- Pipeline user → MIMIC loader: loads data
README.md - Pipeline user → Vocabulary loader: loads data
README.md - Pipeline user → CXR loader: optionally loads
README.md - MIMIC-IV files → MIMIC loader: reads CSVs
load_mimic_to_duckdb.py - Vocabulary files → Vocabulary loader: reads CSVs
load_vocabularies_to_duckdb.py - CXR metadata → CXR loader: reads CSVs
load_mimic_cxr_to_duckdb.py - MIMIC loader → DuckDB database: writes tables
load_mimic_to_duckdb.py - Vocabulary loader → DuckDB database: writes tables
load_vocabularies_to_duckdb.py - CXR loader → DuckDB database: writes tables
load_mimic_cxr_to_duckdb.py - Pipeline user → Staging and mapping: runs dbt
README.md - Staging and mapping → OMOP CDM models: builds CDM
README.md - OMOP CDM models → Vocabulary tables: includes vocabularies
README.md - OMOP CDM models → Notes and NLP: includes notes
README.md - Pipeline user → Imaging extension: optionally selects
README.md - Imaging extension → Image tables: produces imaging tables
README.md - Pipeline user → Summary metrics: optionally runs
README.md