A Python command-line tool that transforms FHIR resources and collection bundles conforming to the BBMRI.de/GBA Implementation Guide into resources conforming to the MIABIS on FHIR Implementation Guide.
Developed as part of BBMRI-ERIC interoperability work.
| BBMRI.de Resource | MIABIS on FHIR Profile |
|---|---|
| Specimen | miabis-sample |
| Patient | miabis-sample-donor |
| Condition | miabis-condition |
| Biobank (Organization) | miabis-biobank |
| Collection (Organization) | miabis-collection-organization |
| Observations (BMI, BodyHeight, BodyWeight, TobaccoUse, CauseOfDeath) | miabis-observation |
Code mappings handled:
- Material type – BBMRI.de
SampleMaterialType→ MIABISmiabis-material-type-CS - Storage temperature – BBMRI.de
StorageTemperature→ MIABISmiabis-storage-temperature-cs - Sample diagnosis – BBMRI.de
OtherSampleDiagnosis→ MIABISmiabis-sample-diagnosis-cs - Profile URLs – all BBMRI.de
StructureDefinitionreferences remapped to MIABIS equivalents - Extension URLs – StorageTemperature, SampleDiagnosis, and Custodian extensions remapped
- Python 3.8+
- No external dependencies (standard library only)
# Transform a single FHIR JSON file
python bbmri_de_to_miabis.py input.json output.json
# Transform all JSON files in a directory
python bbmri_de_to_miabis.py input_dir/ output_dir/
# Print a mapping summary
python bbmri_de_to_miabis.py --summary
# Verbose / debug output
python bbmri_de_to_miabis.py input.json output.json --verboseIf no output path is given for a single file, the result is written to <input_basename>_miabis.json.
If no output directory is given for a directory, results go to <input_dir>_miabis/.
de2Miabis/
├── bbmri_de_to_miabis.py # Main transformer script
├── test_bbmri_de_bundle.json # Example BBMRI.de input bundle
├── test_miabis_output.json # Example MIABIS on FHIR output bundle
└── README.md
- BBMRI.de FHIR IG: https://fhir.bbmri.de
- MIABIS on FHIR IG: https://fhir.bbmri-eric.eu
- BBMRI-ERIC: https://www.bbmri-eric.eu
- GitHub: https://github.com/sthanke
This project is developed within BBMRI-ERIC. Please check with the project maintainers for licensing details.