FhirSheets is a command-line tool that reads an Excel file in FHIR cohort format and generates FHIR bundle JSON files from it. Each row in the template Excel file is used to create an individual JSON file, outputting them to a specified folder.
Project description
FHIRSheets
FhirSheets is a command-line tool that reads an Excel file in FHIR cohort format and generates FHIR bundle JSON files from it. Each row in the template Excel file is used to create an individual JSON file, outputting them to a specified folder.
Table of Contents
Features
- Reads an Excel file following the FHIR cohort import template.
- Converts each row in the Excel file to a FHIR bundle JSON file.
- Exports generated JSON files to a specified output folder.
Requirements
- Python 3.x
- Required Python packages (see
requirements.txt)
Installation
- Clone this repository:
git clone https://github.com/CDCgov/synthetic-data.git cd fhir-python-cohort-generation
- Install the required packages:
pip install -r requirements.txt
Or use poetrypoetry build
Usage
-
Fill Out the Template:
- Open the template file
src/resources/Fhir_Cohort_Import_Template.xlsx. - Fill out each row with the relevant data.
- Open the template file
-
Run the Tool:
- Use the
python -m src.cli.fhirsheetsmodule script with the required arguments:--input-file: The path to the input Excel file.--output-folder: The path to the output folder where the JSON files will be saved.
python -m src.fhir_sheets.cli.main --input_file src/resources/Fhir_Cohort_Import_Template.xlsx --output_folder /path/to/output/folder
- Use the
-
The tool will generate one FHIR bundle JSON file for each row defined in the template.
Example
python -m src.fhir_sheets.cli.main --input_file src/resources/Fhir_Cohort_Import_Template.xlsx --output_folder ./output_bundles
In this example, each row in the `Fhir_Cohort_Import_Template.xlsx` file will be processed, and a corresponding JSON file will be generated in the `output_bundles` folder.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fhir_sheets-2.1.4.tar.gz.
File metadata
- Download URL: fhir_sheets-2.1.4.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fdb341b4d93509048e0320e86a4d8306d6c158538a67cf796b9df5d6e20581a
|
|
| MD5 |
828c8b9f1aa477de7e647c4585d26c28
|
|
| BLAKE2b-256 |
89eed753ff3b5e71fdbd369d632c2995d10b8225c9a0f8670c3395c7b3c8871a
|
File details
Details for the file fhir_sheets-2.1.4-py3-none-any.whl.
File metadata
- Download URL: fhir_sheets-2.1.4-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39f4d026e7015e5532205c6df4bd7794989b3a9ab117630493408701401c0199
|
|
| MD5 |
1a6db007ccb06b0df1d610c5cb7d6e56
|
|
| BLAKE2b-256 |
a7662eb7756c22bc0bc722def1a24b8efcc027aaa8d91c9a9aa1cd52c644d90f
|