Skip to main content

NWICU MEDS Extraction ETL

PyPI - Version codecov tests code-quality Documentation python license PRs contributors DOI Static Badge

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}
}

Metadata

Release files for NWICU-MEDS 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for NWICU-MEDS 1.0.0
File Size Uploaded
nwicu_meds-1.0.0.tar.gz 72.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for NWICU-MEDS 1.0.0
File Interpreter ABI Platform
nwicu_meds-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 81.2 kB

Release files / nwicu_meds-1.0.0.tar.gz

Download URL nwicu_meds-1.0.0.tar.gz
Size 72.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6d01243dc2c92329cecf4ffed3f126bf57ffb232d17067f86e627aad330df48b
BLAKE2b-256 checksum
How to use checksums
3b1099853324c2e2b9c5aa870d86815d1052f16590c5d8ead80efc38fbc2a693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / nwicu_meds-1.0.0-py3-none-any.whl

Download URL nwicu_meds-1.0.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7397f2f5b415f549eeb9c07df40199563152fbd39643c4f94f7571483b3719d7
BLAKE2b-256 checksum
How to use checksums
9e4c6e2de47bed7bbb26bc8f66e56f976d7aeb518ede5fb2e60a82fe093bf739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.7

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page