Python tools for generating and validating FHIR R4 transaction bundles conforming to the MIABIS on FHIR Implementation Guide developed by BBMRI-ERIC.
This project provides two scripts:
generate-miabis-bundle.py— generates synthetic biobank datasets for testing, development, and validation of MIABIS on FHIR endpoints.validate-miabis.py— validates generated bundles against the latest MIABIS on FHIR IG using the HL7 FHIR Validator.
Generated bundles include the full MIABIS resource hierarchy — from juristic persons and biobanks down to individual donor specimens and observations.
| FHIR Resource | MIABIS Concept |
|---|---|
Organization (Juristic Person) |
Parent legal entity |
Organization (Biobank) |
Biobank facility |
Organization (Network Organization) |
Network coordinating entity |
Group (Network) |
Biobank network membership |
Organization (Collection Organization) |
Collection metadata |
Group (Collection) |
Sample collection with characteristics |
Patient |
Sample donor |
Condition |
ICD-10 diagnosis |
Specimen |
Biological sample |
DiagnosticReport |
Pathology report |
Observation |
Sample-level diagnosis |
- Python 3.8+ (no external dependencies needed for generation)
- For validation: Java 17+, Git, Node.js 18+ (details in VALIDATION-GUIDE.md)
git clone https://github.com/sthanke/MiabisonFHIR_Generator.git
cd MiabisonFHIR_Generator# 1. Generate a bundle (saved to bundles/ by default)
python generate-miabis-bundle.py --donors 10
# 2. Validate it
python validate-miabis.pypython generate-miabis-bundle.py --donors 10
python generate-miabis-bundle.py --donors 50 --biobanks 3 --collections 5
python generate-miabis-bundle.py --donors 100 --output my-bundle.json --seed 42Generated files are saved to the bundles/ folder by default. Use --output to write to a custom path instead.
| Argument | Required | Default | Description |
|---|---|---|---|
--donors |
Yes | — | Number of sample donors to generate |
--biobanks |
No | 1 |
Number of biobanks |
--collections |
No | 1 |
Number of collections |
--output |
No | bundles/miabis-bundle-<N>donors.json |
Output file path |
--seed |
No | random | Random seed for reproducibility |
See VALIDATION-GUIDE.md for prerequisites, usage, output format, and troubleshooting.
MiabisonFHIR_Generator/
generate-miabis-bundle.py # Bundle generator
validate-miabis.py # Batch validation script
bundles/ # Generated bundles (default output)
miabis-validation/ # Created by validator (IG clone, reports)
VALIDATION-GUIDE.md # Detailed validation documentation
README.md
LICENSE
This project is released under the MIT License.
Developed by Sten Hanke for BBMRI-ERIC.