Skip to main content

An ETL pipeline to extract INSPIRE data into the MEDS format.

Project description

INSPIRE-MEDS

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

This pipeline extracts the INSPIRE dataset (from physionet, https://physionet.org/content/inspire/) into the MEDS format.

Usage:

pip install INSPIRE_MEDS
export DATASET_DOWNLOAD_USERNAME=$PHYSIONET_USERNAME
export DATASET_DOWNLOAD_PASSWORD=$PHYSIONET_PASSWORD
MEDS_extract-INSPIRE root_output_dir=$ROOT_OUTPUT_DIR

When you run this, the program will:

  1. Download the needed raw INSPIRE files for the currently supported version into $ROOT_OUTPUT_DIR/raw_input.
  2. Perform initial, pre-MEDS processing on the raw INSPIRE 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-INSPIRE 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-INSPIRE --help for more information on the arguments and options. You can also run

MEDS_extract-INSPIRE root_output_dir=$ROOT_OUTPUT_DIR

to run the entire pipeline.

MEDS-transforms settings

If you want to convert a large dataset, you can use parallelization with MEDS-transforms (the MEDS-transformation step that takes the longest).

Using local parallelization with the hydra-joblib-launcher package, you can set the number of workers:

pip install hydra-joblib-launcher --upgrade

Then, you can set the number of workers as environment variable:

export N_WORKERS=8

Moreover, you can set the number of subjects per shard to balance the parallelization overhead based on how many subjects you have in your dataset:

export N_SUBJECTS_PER_SHARD=100000

The MIMIC-IV OMOP Dataset

We use the demo dataset for MIMIC-IV in the OMOP format, which is a subset of the MIMIC-IV dataset. This dataset downloaded from Physionet does not include the standard dictionary linking definitions but should otherwise be functional

Particularities

  • Care site is added to the visit as text
  • Add support for care_site table (visit_detail)

Project details


Download files

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

Source Distribution

inspire_meds-0.0.12.tar.gz (132.1 kB view details)

Uploaded Source

Built Distribution

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

inspire_meds-0.0.12-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file inspire_meds-0.0.12.tar.gz.

File metadata

  • Download URL: inspire_meds-0.0.12.tar.gz
  • Upload date:
  • Size: 132.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for inspire_meds-0.0.12.tar.gz
Algorithm Hash digest
SHA256 25018e602c863d7a2fee8bf366b40e1e8c980e87cab77531094dce05d7fd5990
MD5 7bc8fe20cac77a7870559dfc8ffbef58
BLAKE2b-256 27cf95c645e455e72d0d679de2e1579a51ea8a10ac233272f3a215ae23333091

See more details on using hashes here.

Provenance

The following attestation bundles were made for inspire_meds-0.0.12.tar.gz:

Publisher: python-build.yaml on rvandewater/INSPIRE_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 inspire_meds-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: inspire_meds-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for inspire_meds-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 620dead7bda5b1e13788b025fd6ee5427d294576a547d1fad9655b1bf117704d
MD5 351bdbf183764f1a41115b2c74ac78fc
BLAKE2b-256 12ba94ca113b46ae61047275ab2e81008c6bdb63228c86b2ee227bec30240915

See more details on using hashes here.

Provenance

The following attestation bundles were made for inspire_meds-0.0.12-py3-none-any.whl:

Publisher: python-build.yaml on rvandewater/INSPIRE_MEDS

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page