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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nwicu_meds-1.0.0.tar.gz (72.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nwicu_meds-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

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

Hashes for nwicu_meds-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6d01243dc2c92329cecf4ffed3f126bf57ffb232d17067f86e627aad330df48b
MD5 372ee2e5be3eefb86daacc08797c54a5
BLAKE2b-256 3b1099853324c2e2b9c5aa870d86815d1052f16590c5d8ead80efc38fbc2a693

See more details on using hashes here.

Provenance

The following attestation bundles were made for nwicu_meds-1.0.0.tar.gz:

Publisher: python-build.yaml on rvandewater/NWICU_MEDS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for nwicu_meds-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7397f2f5b415f549eeb9c07df40199563152fbd39643c4f94f7571483b3719d7
MD5 53ebbd25a7f5bf28f4e805ed62b78b91
BLAKE2b-256 9e4c6e2de47bed7bbb26bc8f66e56f976d7aeb518ede5fb2e60a82fe093bf739

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.0.13

2 files

0.0.11

2 files

0.0.10

2 files

0.0.7

2 files

0.0.4

2 files

0.0.3

2 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