Export FHIR Bundles as json files
Project description
FHIR Bundle Exporter
Export Flywheel Subjects as FHIR Bundles in json files.
Overview
Summary
Export Flywheel Subjects as FHIR Bundles in json files. See below for details on the Flywheel Hierarchy to FHIR mapping.
License
License: MIT
Classification
Category: Analysis
Gear Level:
- Project
- Subject
- Session
- Acquisition
- Analysis
Usage
The FHIR Bundle Exporter gear is executed over a single subject or all subjects of a
project. The output is a json
file for each subject as output to both the gear and as
an attachment to the corresponding Flywheel subject container. This json
file is known as a
FHIR Bundle. Each FHIR Bundle is a collection of
resources that can be used to group and transmit resources across API requests.
Each exported FHIR Bundle maps concepts from the Flywheel Hierarchy (e.g. Subjects, Sessions, Acquisitions) to a collection of FHIR Resources (e.g. Patient, Encounter, Imaging Study ) and encoded references to specific file types.
Details of the Flywheel->FHIR Resource mapping are given in the linked FHIR Bundle Contents document.
This gear is intended to be used in conjunction with a project export process within same the project that this gear was/will be run. File paths in the Document Reference resources of the FHIR Bundle are relative to the project export directory.
Requirements
For the FHIR Bundle Exporter gear to produce a sufficiently representative FHIR Bundle, the following requirements should be met.
- A valid Flywheel
subject
birthday OR non-Nullage_days
attribute for each Flywheel session- Creating
age_days
attribute for each session can be performed with a curation script (example) using the hierarchy curator gear.
- Creating
- DICOM Tags are required or need to be de-identified before this gear is run
- To export with references to NIfTI files,
json
sidecars, and other artifacts--with identifiable facial features removed--the following gears are recommended:dcm-qc
dcm2niix
mriqc
pydeface
nifti2dicom
Satisfying the above requirements will ensure that a representative FHIR Bundle is produced with references to the following file types:
- Compressed DICOMs (e.g.
{file_name}.dcm.zip
) - NIfTI Files (e.g.
{file_name}.nii.gz
) - JSON Sidecars (e.g.
{file_name}.json
) - bvec/bval files
For details on how each required Flywheel container attribute or DICOM Tag is encoded into the FHIR Bundle, see the FHIR Bundle Contents document.
Inputs
This gear has no file input. The FHIR Bundle Exporter gear is executed over a single subject or all subjects of a project.
Config
- debug
- Type: boolean
- Description: Log debug messages
- Default: False
- include_encounter_resource
- Type: boolean
- Description: Include Encounter Resources in FHIR Bundle
- Default: False
- include_body_structure_resource
- Type: boolean
- Description: Include BodyStructure Resources in FHIR Bundle
- Default: False
Outputs
The outputs are FHIR Bundles encoded in json
files. There is a FHIR Bundle for each
subject both within the gear output and as an attachment to the corresponding Flywheel
subject container. The resources contained in each FHIR Bundle are described below.
FHIR Bundle Contents
Each Subject-Oriented FHIR Bundle contains the resources listed below. For more details please see the linked documentation.
- Patient Resource
- Encounter Resources
- Imaging Study Resources
- Body Structure Resources
- Device Resources
- Document Reference Resources
Validating FHIR Bundles
The FHIR Bundle Exporter gear does not perform a rigorous validation of the FHIR Bundle. Only a basic validation of the FHIR Bundle structure is performed. Before relying on the FHIR Bundle for any purpose, it is recommended that the FHIR Bundle be validated using available resources, such as the Inferno Resource Validator. Other resources for validating FHIR Bundles can be found at the HL7 FHIR Validating Resources page.
Contributing
For more information about how to get started contributing to that gear, checkout CONTRIBUTING.md.
Disclaimer
Please note that this is an early version of the FHIR Bundle Exporter. It is currently in its initial development phase and as such, may not have all the features fully implemented or may contain bugs. We are actively working on adding more functionality and improving its performance and stability. We appreciate your patience and understanding during this phase. Please use this software with caution and feel free to report any issues or suggestions you may have to help us improve it.
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 Distributions
Built Distribution
File details
Details for the file fw_gear_fhir_bundle_exporter-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: fw_gear_fhir_bundle_exporter-0.1.4-py3-none-any.whl
- Upload date:
- Size: 37.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.8.19 Linux/5.15.154+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4941d704e352b4ffb31b5594da9c6cb65eb58772e6d36093abe52fa8a18093b |
|
MD5 | c0fd7336322136878d71c7d9cffba5aa |
|
BLAKE2b-256 | 84df4e07735505b57c68269a6c2c77db8ee53bc0bbc19b1d2053a5398a2a051e |