This repository provides a tool to convert FHIR data into MIP schema data models, transforming features and outcomes, adjusting field names, and ensuring proper handling of categorical and numerical variables.
- Converts FHIR JSON data to MIP schema format.
- Transforms boolean fields and handles numeric min/max values.
- Logs rejected features and outcomes based on validation.
- Dynamically set input/output file paths using
argparse
.
-
Install dependencies using Poetry:
poetry install
-
Run the conversion script:
poetry run python converter/fhir2mip.py <input_path> <output_path> <rejected_file_path>
Example:
poetry run python converter/fhir2mip.py data/minimal_fhir.json transformed_data.json rejected_codes.txt
Run the tests using pytest
:
poetry run pytest
- converter.py: Main script to handle the transformation from FHIR to MIP schema.
- tests/: Contains unit tests for validation of the transformation logic.