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

[!CAUTION] This package is in alpha development. Use at your own risk.

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.0.3.tar.gz (33.9 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.0.3-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fhir2meds-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a82a4531cbb1d88cb91a0cd4c9edb8d9e2f003b686c54b2a4d0cb2c12dd3a060
MD5 fe0108eaf1a970a61753ef90acdd98c3
BLAKE2b-256 cf347eda89bb8ced1fb3e0e63012044dda56537eb0b946eeaf4d0eb2e04a3a05

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir2meds-0.0.3.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.0.3-py3-none-any.whl.

File metadata

  • Download URL: fhir2meds-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 20.3 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.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9af08755f931155815a45b75206d3f9c394ccaa5c3511273b52f64a14917ee26
MD5 56143e7d119346c6d252989dffd13ee6
BLAKE2b-256 b72f79acb861ebd52f3c5ee3261118882a1b4668a0dc34027f82caf030f6aeef

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir2meds-0.0.3-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