NWICU MEDS Extraction ETL
Northwestern Medicine (NM) is a network of twelve hospitals located in Chicago and the surrounding area. NM originally used a variety of electronic medical record (EMR) systems across the network, but in 2018 migrated all the hospitals to the same EMR platform, Epic. As an essential element of routine medical care, the EMR collects data on patients, admissions, diagnoses, patient status, procedures, medications, and all the other aspects of patient care.
This pipeline extracts the NWICU dataset (from physionet, https://physionet.org/content/nwicu-northwestern-icu/0.1.0/) into the MEDS format.
Usage:
With download:
pip install NWICU_MEDS
export DATASET_DOWNLOAD_USERNAME=...
export DATASET_DOWNLOAD_PASSWORD=...
meds-extract-run spec=NWICU output_dir=$OUTPUT_DIR
Without download (if you already have the dataset):
pip install NWICU_MEDS
meds-extract-run spec=NWICU do_download=false input_dir=$PHYSIONET_INPUT_DIR output_dir=$OUTPUT_DIR
Configuration
This package contains no ETL code. The entire pipeline is one file,
src/NWICU_MEDS/messy.yaml, registered under the
MEDS_extract.pipelines entry-point group.
Everything the old pre_MEDS.py did is now config:
| Was | Now |
|---|---|
fix_static_data — earliest death time per subject |
_table.join with cols: {deathtime: min}, then dod_final: $deathtime ?? $dod |
DOB from anchor_year - anchor_age |
_table.cols: year_of_birth: ($anchor_year - $anchor_age)::str |
add_discharge_time_by_hadm_id |
_table.join on hadm_id for dischtime |
add_icd_diagnosis_dot |
inlined into the diagnosis parent_codes expression |
Post-hoc codes.parquet rebuild |
_metadata blocks against NWICU's own d_labitems / d_items |
Demographics
insurance, language, marital_status and race are properties of the subject rather than
annotations on the admission, so each is emitted as its own event — INSURANCE//…,
LANGUAGE//…, MARITAL_STATUS//…, RACE//… — co-timed with the admission, since NWICU records
no separate timestamp for them.
Their nulls are deliberately not coalesced to UNK, unlike the composite codes elsewhere in
this config. A null code component drops the row under MEDS-Extract 0.7, so a missing
demographic produces no event at all rather than minting a RACE//UNK code that would read as
an observed category.
Raw data layout
The PhysioNet release nests its tables one level down, under data/nw_hosp/ and
data/nw_icu/, and the table prefixes in the config match that exactly. This matters if you
stage the raw data yourself: point input_dir at the directory containing data/, which is
what meds-extract-download writes, not at data/ itself.
Code descriptions
Lab, chart-event and procedure codes get descriptions from NWICU's own item dictionaries via
_metadata blocks, joined on itemid alone so a label applies to every unit variant of a code.
This replaces the Python rebuild that existed because the MIMIC-IV crosswalks are keyed on MIMIC
itemids that never match NWICU's — a mismatch that now surfaces as a WARNING instead of silently
matching zero rows.
Citation
If you find our work useful, please cite the resource through the github repository (or the bibtex entry below), and cite the original dataset through PhysioNet.
This is the original dataset citation from PhysioNet:
@article{PhysioNet-nwicu-northwestern-icu-0.1.0,
author = {Moukheiber, Dana and Temps, William and Molgi, Bhadrappa and Li, Yikuan and Lu, Alice and Nannapaneni, Prasanth and Chahin, Abdulrahman and Hao, Sicheng and {Torres Fabregas}, Felipe and Celi, Leo Anthony and Wong, Adrian and Lloyd, Maxwell and {Borrat Frigola}, Xavier and Lee, Hyung-Chul and Schneider, Daniel and Pollard, Tom and Luo, Yuan and Kho, Abel and Mark, Roger},
title = {{Northwestern ICU (NWICU) database}},
journal = {{PhysioNet}},
year = {2024},
month = nov,
note = {Version 0.1.0},
doi = {10.13026/s84w-1829},
url = {https://doi.org/10.13026/s84w-1829}
}
The following is the recommended citation for this package:
@software{van_de_Water_NWICU_MEDS_ETL_2025,
author = {van de Water, Robin Philippus},
doi = {10.5281/zenodo.14892134},
license = {MIT},
month = feb,
title = {{NWICU\_MEDS ETL}},
url = {https://github.com/rvandewater/NWICU_MEDS},
year = {2025}
}
For citing MEDS in general:
@article{mcdermott2026meds,
title={MEDS—An Emerging Data Standard and Ecosystem for Health AI Research},
author={McDermott, Matthew BA and Steinberg, Ethan and Fries, Jason A and van de Water, Robin P and Pang, Chao and Rockenschaub, Patrick and Renc, Pawel and Oh, Jungwoo and Stankevi{\v{c}}i{\=u}t{\.e}, Kamil{\.e} and Xu, Justin and others},
journal={NEJM AI},
volume={3},
number={6},
pages={AIra2501253},
year={2026},
publisher={Massachusetts Medical Society}
}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nwicu_meds-1.0.0.tar.gz.
File metadata
- Download URL: nwicu_meds-1.0.0.tar.gz
- Upload date:
- Size: 72.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d01243dc2c92329cecf4ffed3f126bf57ffb232d17067f86e627aad330df48b
|
|
| MD5 |
372ee2e5be3eefb86daacc08797c54a5
|
|
| BLAKE2b-256 |
3b1099853324c2e2b9c5aa870d86815d1052f16590c5d8ead80efc38fbc2a693
|
Provenance
The following attestation bundles were made for nwicu_meds-1.0.0.tar.gz:
Publisher:
python-build.yaml on rvandewater/NWICU_MEDS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nwicu_meds-1.0.0.tar.gz -
Subject digest:
6d01243dc2c92329cecf4ffed3f126bf57ffb232d17067f86e627aad330df48b - Sigstore transparency entry: 2685545826
- Sigstore integration time:
-
Permalink:
rvandewater/NWICU_MEDS@12f71891ae4a363718ea63d5e7b5bc0d843edc76 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/rvandewater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-build.yaml@12f71891ae4a363718ea63d5e7b5bc0d843edc76 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nwicu_meds-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nwicu_meds-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7397f2f5b415f549eeb9c07df40199563152fbd39643c4f94f7571483b3719d7
|
|
| MD5 |
53ebbd25a7f5bf28f4e805ed62b78b91
|
|
| BLAKE2b-256 |
9e4c6e2de47bed7bbb26bc8f66e56f976d7aeb518ede5fb2e60a82fe093bf739
|
Provenance
The following attestation bundles were made for nwicu_meds-1.0.0-py3-none-any.whl:
Publisher:
python-build.yaml on rvandewater/NWICU_MEDS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nwicu_meds-1.0.0-py3-none-any.whl -
Subject digest:
7397f2f5b415f549eeb9c07df40199563152fbd39643c4f94f7571483b3719d7 - Sigstore transparency entry: 2685546095
- Sigstore integration time:
-
Permalink:
rvandewater/NWICU_MEDS@12f71891ae4a363718ea63d5e7b5bc0d843edc76 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/rvandewater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-build.yaml@12f71891ae4a363718ea63d5e7b5bc0d843edc76 -
Trigger Event:
push
-
Statement type: