Skip to main content

Synthetic patient journey datasets for longitudinal analysis

Project description

tanat-synthea

Synthetic patient journey datasets for longitudinal analysis.

PyPI version CI codecov

Built on Synthea and designed for use with TanaT and FedBioMed. Supports US, French, and UK cohorts out of the box.

Freely reproducible. No registration, no data access agreement.


Installation

pip install tanat-synthea

Single site

from tanat_synthea import PatientJourney

pj = PatientJourney(
    "data/single_site/",
    name="CHU de Lyon",
    country_code="fr",
    state="Auvergne-Rhone-Alpes",
    population=100,
    seed=42,
    age_range="20-80",
)
pj.generate()

# Demographics (one row per patient)
pj.static_data()

# Clinical records (one row per record)
pj.temporal_data(record_types=["encounter", "condition"])

# Raw reference file
pj.load_file("organizations.csv")

Data is generated automatically on first access if it does not exist yet.


Multi-center (federated)

Quickstart - build on demo preset:

from tanat_synthea import FedPatientJourney

# Preset: 3 centers (US / FR / GB), 50 patients each
fpj = FedPatientJourney.demo()
fpj.generate()          # trigger Synthea for all centers

# Per-center access: isolated FL node
for pj in fpj.iter_centers():
    local = pj.temporal_data(record_types=["encounter", "condition"])

Configure each center manually:

fpj = FedPatientJourney([
    # Center 0
    PatientJourney("data/center_0/", name="CHU de Lyon",
                    country_code="fr", state="Auvergne-Rhone-Alpes",
                    population=100, seed=42, age_range="20-80"),
    # Center 1
    PatientJourney("data/center_1/", name="St Thomas' London",
                    country_code="gb", state="Greater London",
                    population=100, seed=123, age_range="40-85"),
    # Center 2
    PatientJourney("data/center_2/", name="Mass General",
                    country_code="us", state="Massachusetts",
                    population=100, seed=777, age_range="20-60"),
])

Or drive the federation from a YAML config:

fpj = FedPatientJourney.from_yaml("configs/demo.yaml")

CLI

# Generate all centers defined in a config file
tanat-synthea --config configs/demo.yaml

# Single center only
tanat-synthea --config configs/demo.yaml --center 0

# Preview Synthea commands without running them
tanat-synthea --config configs/demo.yaml --dry-run

The Synthea JAR (~190 MB) is downloaded automatically on first run if missing. See configs/demo.yaml for full documentation of available options.


License

MIT License

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

tanat_synthea-0.1.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

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

tanat_synthea-0.1.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file tanat_synthea-0.1.0.tar.gz.

File metadata

  • Download URL: tanat_synthea-0.1.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for tanat_synthea-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c30dcfdd75c94da2a05761800c44e2bc3bcc224cc8f3edaa0bb1dd8f5dcb1842
MD5 220da0f69f2c5188e912a36136f12be7
BLAKE2b-256 14c9f9e64f4c0196ba6691a6a64a257f3d54c862b629ff4708a7d84053cce3a2

See more details on using hashes here.

File details

Details for the file tanat_synthea-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tanat_synthea-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for tanat_synthea-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e24a3194de8fe5b6f73188dba1f69387d1a5fe1587e488316bec66c8c835706
MD5 8768490255b90d4cf6b3d983d52ee49a
BLAKE2b-256 48257f5371424d1483fc6811689e9362469caceeb8a8ef70e38e4b100d502ea0

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