transfer FHIR pipeline to branch#1155
Open
jhnwu3 wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive support for FHIR (Fast Healthcare Interoperability Resources) datasets in PyHealth, including a generic, YAML-configurable FHIR ingest engine, a pre-configured MIMIC-IV-on-FHIR dataset, and a full clinical prediction pipeline using new tasks and models. The documentation is significantly expanded to cover these new features, and an end-to-end example is provided for users. Key changes are grouped below:
FHIR Dataset Support and Documentation:
FHIRDataset, a generic, YAML-configurable dataset for ingesting HL7 FHIR NDJSON exports, along with detailed documentation and usage instructions. This engine supports flexible configuration of resource flattening and event schema via YAML, with caching and validation. (docs/api/datasets/pyhealth.datasets.FHIRDataset.rst[1]pyhealth/datasets/fhir/__init__.py[2]MIMIC4FHIR, a subclass ofFHIRDatasetpre-configured for the PhysioNet MIMIC-IV-on-FHIR export, including documentation and resource coverage details. (docs/api/datasets/pyhealth.datasets.MIMIC4FHIR.rstdocs/api/datasets/pyhealth.datasets.MIMIC4FHIR.rstR1-R78)FHIRDatasetandMIMIC4FHIRin the main datasets API and documentation. (docs/api/datasets.rst[1]pyhealth/datasets/__init__.py[2]New Task and Model for FHIR-based Clinical Prediction:
MPFClinicalPredictionTask, supporting multitask prompted fine-tuning (MPF) style binary clinical prediction on FHIR token timelines, with documentation. (docs/api/tasks/pyhealth.tasks.mpf_clinical_prediction.rst[1]docs/api/tasks.rst[2]EHRMambaCEHR, a model combining CEHR-style embeddings and Mamba blocks for FHIR token streams, with API documentation and registration. (docs/api/models/pyhealth.models.EHRMambaCEHR.rst[1]docs/api/models.rst[2]Example and Usability Improvements:
examples/mimic4fhir_mpf_ehrmamba.py) demonstrating the full pipeline: dataset loading, task setup, model instantiation, training, and evaluation on the MIMIC-IV FHIR demo dataset.Internal Improvements:
BaseDatasetto tolerate stream-writer finalizers and avoid errors during cache cleanup. (pyhealth/datasets/base_dataset.pypyhealth/datasets/base_dataset.pyL423-R432)These changes make PyHealth a first-class tool for working with FHIR data, enabling both out-of-the-box use with MIMIC-IV and easy adaptation to other FHIR exports.