Skip to content

Synthea

Bell Eapen edited this page Jan 17, 2026 · 1 revision

Synthea in DHTI

DHTI integrates Synthea to generate realistic patient data for testing and development. This allows you to populate your FHIR server with diverse patient cohorts without handling sensitive real-world data.

Usage

npx dhti-cli synthea SUBCOMMAND [FLAGS]

Subcommands

  • install: Install the Synthea jar file (required first step).
  • generate: Run the generation process.
  • upload: Upload generated FHIR resources to the DHTI FHIR server.
  • delete: Delete generated files.
  • download: Download pre-generated datasets (e.g., COVID-19, sample data).

Common Tasks

1. Generate a Specific Cohort

Generate 50 patients, focusing on pediatric data (age 0-18):

npx dhti-cli synthea generate -p 50 -a 0-18

Generate 100 fake patients from New York:

npx dhti-cli synthea generate -p 100 --state "New York"

2. Upload to FHIR Server

After generation, push the data to your local HAPI FHIR server:

npx dhti-cli synthea upload

Note: Default endpoint is http://fhir:8005/baseR4. Use -e to specify a different URL.

3. Download Existing Datasets

You can quickly download large pre-generated datasets instead of running generation:

# Download COVID-19 dataset (10k patients)
npx dhti-cli synthea download --covid19_10k

Flags Reference

  • -p, --population: Number of patients (default: 1).
  • -a, --age: Age range (e.g., "0-18").
  • -g, --gender: Gender (M/F).
  • --state: State name.
  • --city: City name.
  • -s, --seed: Random seed for reproducibility.
  • -e, --endpoint: FHIR server URL for upload.
  • --dry-run: Preview command actions.

Clone this wiki locally