Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Web Interface for Synthea Patient Generator #1499

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

gregorywmorris
Copy link

Pull Request: Add Web Interface for Synthea Patient Generator

Summary:

This pull request introduces a brand-new web interface to the Synthea Patient Generator repository. The web interface allows users to generate Synthea commands via a user-friendly HTML form, eliminating the need to manually enter commands in the terminal.

Additions:

  1. README instructions updated with web interface instructions
    • Fence markup updated formating
  2. Makefile
  3. app.py
  4. index.html

Key Features:

  1. HTML Form-Based Interface:

    • User-Friendly Command Generation:

      • The web interface features an intuitive HTML form that lets users input parameters such as state, city, population size, and various configuration paths.
      • The form automatically constructs the correct Synthea command based on the user’s input, ensuring that all required options are included and properly formatted.
    • Dynamic Input Handling:

      • Input fields for various parameters (e.g., paths, state, and city names) automatically handle cases where spaces might cause issues in command-line execution by wrapping the inputs in double quotes.
      • The form also provides an option for users to specify additional Synthea configurations directly.
    • Preview Command Before Execution:

      • Upon submission, the generated Synthea command is displayed in an alert, allowing users to review and copy the command for execution.
  2. Backend Integration with Flask:

    • A Flask backend is included to facilitate the integration of the web interface with the Synthea engine. This backend processes form submissions and prepares the command for execution.
    • The backend is designed to be lightweight and easy to extend if additional functionality is needed in the future.
  3. Makefile for Easy Setup and Execution:

    • The repository now includes a Makefile to automate the environment setup, including:
      • Creating a Python virtual environment and installing dependencies (e.g., Flask).
      • Serving the HTML frontend via Python’s built-in HTTP server.
      • Running the Flask backend.
    • The Makefile includes targets for setting up the environment (setup), starting the frontend server (serve), running the Flask backend (flask), and executing both servers in parallel (run).

Getting Started:

  • Setup:

    • Clone the repository and navigate to the project directory.
    • Run make to set up the Python environment, install the necessary dependencies, and start both the HTML frontend and Flask backend.
  • Using the Interface:

    • Access the web interface at http://localhost:8000.
    • Fill out the form with your desired parameters, review the generated command, and execute it in your terminal.

Benefits:

  • Ease of Use: Simplifies the process of generating Synthea commands, especially for users who may not be comfortable with command-line interfaces.
  • Consistency: Reduces the likelihood of user error when manually constructing complex commands.
  • Extendibility: The modular structure allows for easy future enhancements, such as adding more configuration options or integrating additional features.

Conclusion:
This new web interface significantly enhances the usability of the Synthea Patient Generator, making it accessible to a broader audience by providing a straightforward way to generate and execute Synthea commands.

@jgsuess
Copy link

jgsuess commented Nov 5, 2024

Any chance this will merge soon? Are there any open issues?

@jawalonoski
Copy link
Member

Any chance this will merge soon? Are there any open issues?

I don't believe any of the maintainers has reviewed this yet. Have you tried it? What did you think of it?

In the past, we've separated UI/UX and other tools from the core engine... For example, see the other repositories within https://github.com/synthetichealth, in particular projects like the module builder and spt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants