Skip to main content

MIMIC-IV MEDS Extraction ETL

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

This pipeline extracts the MIMIC-IV dataset (from physionet) into the MEDS format.

Usage:

pip install MIMIC_IV_MEDS
export DATASET_DOWNLOAD_USERNAME=$PHYSIONET_USERNAME
export DATASET_DOWNLOAD_PASSWORD=$PHYSIONET_PASSWORD
MEDS_extract-MIMIC_IV root_output_dir=$ROOT_OUTPUT_DIR

When you run this, the program will:

  1. Download the needed raw MIMIC files for the currently supported version into $ROOT_OUTPUT_DIR/raw_input.
  2. Perform initial, pre-MEDS processing on the raw MIMIC files, saving the results in $ROOT_OUTPUT_DIR/pre_MEDS.
  3. Construct the final MEDS cohort, and save it to $ROOT_OUTPUT_DIR/MEDS_cohort.

You can also specify the target directories more directly, with

export DATASET_DOWNLOAD_USERNAME=$PHYSIONET_USERNAME
export DATASET_DOWNLOAD_PASSWORD=$PHYSIONET_PASSWORD
MEDS_extract-MIMIC_IV raw_input_dir=$RAW_INPUT_DIR pre_MEDS_dir=$PRE_MEDS_DIR MEDS_cohort_dir=$MEDS_COHORT_DIR

Examples and More Info:

You can run MEDS_extract-MIMIC_IV --help for more information on the arguments and options. You can also run

MEDS_extract-MIMIC_IV root_output_dir=$ROOT_OUTPUT_DIR do_demo=True

to run the entire pipeline over the publicly available, fully open MIMIC-IV demo dataset.

Expected runtime and compute needs

This pipeline can be successfully run over the full MIMIC-IV on a 5-core machine leveraging around 165GB of memory in approximately 7 hours (note this time includes the time to download all of the MIMIC-IV files as well, and this test was run on a machine with poor network transfer speeds and without any parallelization applied to the transformation steps, so these speeds can likely be greatly increased). The output folder of data is 9.8 GB. This can be reduced significantly as well as intermediate files not necessary for the final MEDS dataset are retained in additional folders. See this github issue for tracking on ensuring these directories are automatically cleaned up in the future.

📚 Citing this work

If you use this software in your research, please cite it! You can use the "Cite this repository" button on GitHub.

The citation information is maintained in the CITATION.cff file in this repository.

🔧 Common Issues / FAQ

❓ Issue: FileNotFoundError or pipeline errors during the pre_MEDS step on Ubuntu (symlinks not recognized)

Problem:

Some users running the pipeline encounter errors during the pre_MEDS step, where the scripts attempt to create symlinks but later fails to recognize or access them — even though the symlinks appear to exist in the file system.

Solution:

A do_copy=True option is available in the CLI that allows the pipeline to copy files instead of symlinking, avoiding this issue entirely (at the cost of additional disk usage). You can enable this by adding do_copy=True to your command:

MEDS_extract-MIMIC_IV root_output_dir=$ROOT_OUTPUT_DIR do_copy=True

Download files

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

Source Distribution

mimic_iv_meds-0.1.1.1.tar.gz (91.2 kB view details)

Uploaded Source

Built Distribution

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

mimic_iv_meds-0.1.1.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file mimic_iv_meds-0.1.1.1.tar.gz.

File metadata

  • Download URL: mimic_iv_meds-0.1.1.1.tar.gz
  • Upload date:
  • Size: 91.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mimic_iv_meds-0.1.1.1.tar.gz
Algorithm Hash digest
SHA256 fee584c17522b502073aa05a67bb6e68c8ef430d07d512ed4143ad668a261734
MD5 6817bbb21f10f80b3cd207cc8a250732
BLAKE2b-256 654e215efcd7335c35c97f8a28070a91bc5423b2335e1d8cb5914f6593d9e34b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mimic_iv_meds-0.1.1.1.tar.gz:

Publisher: python-build.yaml on Medical-Event-Data-Standard/MIMIC_IV_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 mimic_iv_meds-0.1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mimic_iv_meds-0.1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1344fa6d8179d8f487492082f09ea43481a3a01a7d74792c9e434050ba9ba65c
MD5 db3d2c15b81d7008e58db7b4a8b19481
BLAKE2b-256 0339e44b0ed68ffc4fa7a015a65fccd695219217c13b9c0ae645c787ea41e1c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mimic_iv_meds-0.1.1.1-py3-none-any.whl:

Publisher: python-build.yaml on Medical-Event-Data-Standard/MIMIC_IV_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

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1.1 This release

2 files

0.1.1

2 files

0.1.0.1

2 files

0.1.0

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4.1

2 files

0.0.4

2 files

0.0.3.1

2 files

0.0.3

2 files

0.0.2.1

2 files

0.0.2

2 files

0.0.1.1

2 files

0.0.1

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