Skip to main content

Convert HL7 FHIR (v4/v5) Observation resources to MEDS sharded Parquet format.

Project description

MEDS Logo

MEDS on FHIR

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

Overview

MEDS on FHIR is a Python package for converting HL7 FHIR (v4/v5) resources into the MEDS sharded Parquet format. It supports scalable, schema-validated event extraction and is designed for research and interoperability projects. This project is in its early stages and has been tested mainly with the MIMIC-IV FHIR demo.

Features

  • Parses and processes all MEDS-compatible FHIR resource types (v4/v5) (tested with MIMIC-IV FHIR demo)
  • Robust mapping from FHIR Observation to MEDS event schema
  • Handles patient ID resolution and vocabulary mapping
  • Outputs sharded Parquet files, validated against the MEDS schema
  • Extensible: add mapping for new FHIR resource types easily
  • Comprehensive test suite for FHIR resource parsing

Installation

pip install fhir2meds
# or for local development
pip install -e .

Usage

fhir2meds raw_input_dir=mimic-fhir root_output_dir=example_output ++overwrite=true ++verbose=true
  • raw_input_dir: Directory containing FHIR .ndjson/.json files (e.g., MIMIC-IV FHIR demo)
  • output_dir: Output directory for MEDS Parquet shards
  • max_observations: (Optional) Limit number of observations for debugging
  • overwrite: (Optional) Overwrite existing output directory
  • verbose: (Optional) Enable verbose logging
  • do_download: (Optional) Download MIMIC-IV FHIR demo dataset automatically (to be tested)

Testing

Run the test suite (requires pytest):

PYTHONPATH=src pytest tests/

References


License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

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

fhir2meds-0.1.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

fhir2meds-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file fhir2meds-0.1.0.tar.gz.

File metadata

  • Download URL: fhir2meds-0.1.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fhir2meds-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d15e2136e5a600be1fce1319c2230b7aaa18526a633b05a78f43020b4288008
MD5 07886193c982a08ea75e0d16ada7e86f
BLAKE2b-256 9621071a746206c6e10168269a8ea5e3513c457114dd9c89d7dea9935c17fabc

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir2meds-0.1.0.tar.gz:

Publisher: python-build.yaml on rvandewater/FHIR_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 fhir2meds-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fhir2meds-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fhir2meds-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cbc28b7ed13eb3700fd3ae637a1b67ffb1599bf2b86c13421bbf21b330ae168
MD5 6d5ae645f670ac34d522e3990290eab9
BLAKE2b-256 28ee0c50dfd4856a21818abd5b0361369cee49a2a8aff7435ed1bd33430608a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir2meds-0.1.0-py3-none-any.whl:

Publisher: python-build.yaml on rvandewater/FHIR_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