Skip to main content

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

  1. Clone this repository:
    git clone https://github.com/CDCgov/synthetic-data.git
    cd fhir-python-cohort-generation
    
  2. Install the required packages:
    pip install -r requirements.txt
    
    Or use poetry
    poetry build
    

Usage

  1. Fill Out the Template:

    • Open the template file src/resources/Fhir_Cohort_Import_Template.xlsx.
    • Fill out each row with the relevant data.
  2. Run the Tool:

    • Use the python -m src.cli.fhirsheets module 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
    
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fhir_sheets-2.4.2.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fhir_sheets-2.4.2-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file fhir_sheets-2.4.2.tar.gz.

File metadata

  • Download URL: fhir_sheets-2.4.2.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for fhir_sheets-2.4.2.tar.gz
Algorithm Hash digest
SHA256 18c81e07b20d4ed7edcbdd3275c6004862d0c695e4588c5c6a89b062faf97ce4
MD5 81a280c1f2e75afe59c005d21e547279
BLAKE2b-256 0c7e45ec4ab5dce8569ce88cd11db05b0095751852c60655142c1a001e3be5c9

See more details on using hashes here.

File details

Details for the file fhir_sheets-2.4.2-py3-none-any.whl.

File metadata

  • Download URL: fhir_sheets-2.4.2-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for fhir_sheets-2.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff2a5ce45df2c46ffbb08ad0fb068e9c2afa17706190eb82c5582ab8c3fbd58
MD5 3e8afa149a5e31905c3e43064c8e89d8
BLAKE2b-256 6666f13051fc4beec1afe7bef32aa5e2de37a4abc3538cf52ebf481643b6f3e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page