Convert HL7 FHIR (v4/v5) Observation resources to MEDS sharded Parquet format.
Project description
MEDS on FHIR
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 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a82a4531cbb1d88cb91a0cd4c9edb8d9e2f003b686c54b2a4d0cb2c12dd3a060
|
|
| MD5 |
fe0108eaf1a970a61753ef90acdd98c3
|
|
| BLAKE2b-256 |
cf347eda89bb8ced1fb3e0e63012044dda56537eb0b946eeaf4d0eb2e04a3a05
|
Provenance
The following attestation bundles were made for fhir2meds-0.0.3.tar.gz:
Publisher:
python-build.yaml on rvandewater/FHIR_MEDS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fhir2meds-0.0.3.tar.gz -
Subject digest:
a82a4531cbb1d88cb91a0cd4c9edb8d9e2f003b686c54b2a4d0cb2c12dd3a060 - Sigstore transparency entry: 298100020
- Sigstore integration time:
-
Permalink:
rvandewater/FHIR_MEDS@78e4cec1bbdb6aef507ac2ac000959466b27b621 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/rvandewater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-build.yaml@78e4cec1bbdb6aef507ac2ac000959466b27b621 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9af08755f931155815a45b75206d3f9c394ccaa5c3511273b52f64a14917ee26
|
|
| MD5 |
56143e7d119346c6d252989dffd13ee6
|
|
| BLAKE2b-256 |
b72f79acb861ebd52f3c5ee3261118882a1b4668a0dc34027f82caf030f6aeef
|
Provenance
The following attestation bundles were made for fhir2meds-0.0.3-py3-none-any.whl:
Publisher:
python-build.yaml on rvandewater/FHIR_MEDS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fhir2meds-0.0.3-py3-none-any.whl -
Subject digest:
9af08755f931155815a45b75206d3f9c394ccaa5c3511273b52f64a14917ee26 - Sigstore transparency entry: 298100031
- Sigstore integration time:
-
Permalink:
rvandewater/FHIR_MEDS@78e4cec1bbdb6aef507ac2ac000959466b27b621 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/rvandewater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-build.yaml@78e4cec1bbdb6aef507ac2ac000959466b27b621 -
Trigger Event:
push
-
Statement type: