2.7 KiB
2.7 KiB
Synthea Disease Module Generator
This package provides Docker and Nextflow integrations for Synthea to:
- Generate disease modules using Claude AI
- Look up existing disease modules by name
- Run both functions in a containerized environment
Prerequisites
- Docker
- Nextflow (will be installed automatically if not present)
- Anthropic API key (Claude)
Setup
-
Clone the repository and navigate to it:
git clone https://github.com/yourusername/synthea-alldiseases.git cd synthea-alldiseases -
Set your Anthropic API key:
Option 1: Environment variable:
export ANTHROPIC_API_KEY=your_api_key_hereOption 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:
- Check if a module already exists for the disease
- Look up the disease in the disease list for ICD-10 codes and other metadata
- If the module exists, copy it to the output directory
- If the module doesn't exist, generate it using Claude AI
- Save the module to the specified output directory
- For new modules, also update the modules directory
Modifying the Docker Configuration
If you need to customize the Docker environment:
- Edit
Dockerfileto add dependencies or change the configuration - 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.