Skip to main content

MIMIC-IV MEDS Extraction ETL

PyPI - Version Documentation Status codecov tests code-quality python license PRs contributors

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.

🔧 Common Issues / FAQ

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

Metadata

Release files for MIMIC-IV-MEDS 0.0.6

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

Source distribution (sdist)

Source distribution for MIMIC-IV-MEDS 0.0.6
File Size Uploaded Provenance Actions
mimic_iv_meds-0.0.6.tar.gz 21.2 kB With provenance Details for mimic_iv_meds-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for MIMIC-IV-MEDS 0.0.6
File Interpreter ABI Platform Actions
mimic_iv_meds-0.0.6-py3-none-any.whl Python 3 none any Details for mimic_iv_meds-0.0.6-py3-none-any.whl

Total release size: 38.3 kB

Release files / mimic_iv_meds-0.0.6.tar.gz

Download URL mimic_iv_meds-0.0.6.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ef560a84cf61b8bab089fe478b94f2c4f07c89f19041f63337a2b6ea883d2945
BLAKE2b-256 checksum
How to use checksums
e055ff28133ced4e5ec03a91a0dfce76bdb95a49ab0734b668bc5445d6e488ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 May 13, 2025.

Transparency log

Release files / mimic_iv_meds-0.0.6-py3-none-any.whl

Download URL mimic_iv_meds-0.0.6-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5d2e4c774f2c5c24938a17b818bcfb61b1df33737c063ffa8fb254231eb9be7
BLAKE2b-256 checksum
How to use checksums
f43cf5e0210f4759fd8650be9bbcfbd03e011eaeab254d5e5879f8da2a72086c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 May 13, 2025.

Transparency log

Security for MIMIC-IV-MEDS 0.0.6

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mimic_iv_meds-0.0.6.tar.gz

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 May 13, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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