MEDS on FHIR
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 shardsmax_observations: (Optional) Limit number of observations for debuggingoverwrite: (Optional) Overwrite existing output directoryverbose: (Optional) Enable verbose loggingdo_download: (Optional) Download MIMIC-IV FHIR demo dataset automatically (to be tested)
Testing
Run the test suite (requires pytest):
PYTHONPATH=src pytest tests/
References
- HL7 FHIR Resource List
- MIMIC-IV FHIR Demo
- MEDS Format & Schema
- ETL_MEDS_Template R4 Resource List: https://hl7.org/fhir/R4/resourcelist.html
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.
Metadata
Release files for fhir2meds 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fhir2meds-0.1.0.tar.gz | 17.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fhir2meds-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.7 kB
Release files / fhir2meds-0.1.0.tar.gz
| Download URL | fhir2meds-0.1.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d15e2136e5a600be1fce1319c2230b7aaa18526a633b05a78f43020b4288008
|
|
BLAKE2b-256 checksum How to use checksums |
9621071a746206c6e10168269a8ea5e3513c457114dd9c89d7dea9935c17fabc
|
| 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 Jul 21, 2025.
Transparency logRelease files / fhir2meds-0.1.0-py3-none-any.whl
| Download URL | fhir2meds-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cbc28b7ed13eb3700fd3ae637a1b67ffb1599bf2b86c13421bbf21b330ae168
|
|
BLAKE2b-256 checksum How to use checksums |
28ee0c50dfd4856a21818abd5b0361369cee49a2a8aff7435ed1bd33430608a6
|
| 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 Jul 21, 2025.
Transparency logSecurity for fhir2meds 0.1.0
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for fhir2meds-0.1.0.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 Jul 21, 2025.
Transparency logA 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.