Files
synthea-alldiseases/DOCKER_README.md

2.7 KiB

Synthea Disease Module Generator

This package provides Docker and Nextflow integrations for Synthea to:

  1. Generate disease modules using Claude AI
  2. Look up existing disease modules by name
  3. Run both functions in a containerized environment

Prerequisites

  • Docker
  • Nextflow (will be installed automatically if not present)
  • Anthropic API key (Claude)

Setup

  1. Clone the repository and navigate to it:

    git clone https://github.com/yourusername/synthea-alldiseases.git
    cd synthea-alldiseases
    
  2. Set your Anthropic API key:

    Option 1: Environment variable:

    export ANTHROPIC_API_KEY=your_api_key_here
    

    Option 2: You'll be prompted to enter it when you run the script if it's not set.

Usage

Running the Module Generator

Use the provided script:

./run_module_generator.sh --disease_name "Disease Name Here"

Additional options:

--modules_dir      Path to modules directory (default: src/main/resources/modules)
--output_dir       Output directory for generated modules (default: output)
--help             Show help information

Examples

Generate a module for Multiple Sclerosis:

./run_module_generator.sh --disease_name "Multiple Sclerosis"

Generate a module and save it to a custom location:

./run_module_generator.sh --disease_name "Parkinson's Disease" --output_dir ./custom_modules

Using Docker Compose (Alternative)

You can also run the entire environment using Docker Compose:

docker-compose up -d
docker-compose exec synthea bash

Once inside the container:

./run_module_generator.sh --disease_name "Disease Name"

How It Works

The pipeline follows these steps:

  1. Check if a module already exists for the disease
  2. Look up the disease in the disease list for ICD-10 codes and other metadata
  3. If the module exists, copy it to the output directory
  4. If the module doesn't exist, generate it using Claude AI
  5. Save the module to the specified output directory
  6. For new modules, also update the modules directory

Modifying the Docker Configuration

If you need to customize the Docker environment:

  1. Edit Dockerfile to add dependencies or change the configuration
  2. Rebuild the Docker image:
    docker build -t synthea-module-generator .
    

Troubleshooting

  • API Key Issues: Ensure your ANTHROPIC_API_KEY is set correctly
  • Docker Permission Issues: You may need to run Docker commands with sudo
  • Memory Issues: For large modules, you may need to increase Docker's memory allocation
  • Pipeline Errors: Check execution_report.html for detailed error information

License

This project is licensed under the same license as Synthea.