Skip to content

Repository files navigation

CI

hospitopt-rs

Rust-based optimization project that uses constraint programming to maximize the number of lives saved in emergency and healthcare scenarios. It models hospitals, diseases, available beds, ambulance positions and capacities, and patient needs, then computes optimized resource allocations to improve medical response and outcomes.

Vision

  • Capture hospitals, treatments, bed capacity, ambulance fleets, and patient demand in a unified Rust model.
  • Explore Google OR-Tools CP-SAT (via the cp_sat bindings) to optimize triage, routing, and resource allocation.

Getting started

  1. Start you dotenv file

    cp .env.example .env
  2. Start PostgreSQL locally with Docker Compose (runs on localhost:5432)

    docker compose up -d postgres
  3. Apply database migrations

    sea-orm-cli migrate up

    Need a clean slate? Use sea-orm-cli migrate refresh.

  4. Run the tests or binaries as usual

    cargo test
    cargo run
  5. Seed curated reference data (optional)

    cargo run -p scripts

    This command clears the existing hospitals and hospital_specialities tables and inserts a curated dataset covering eight flagship hospitals across Lisbon. It uses coordinates sourced from the public GeoJSON dataset at dados.gov.pt and fills in illustrative bed capacities plus Manchester triage wait targets so you can experiment with the optimizer immediately.

    Need to add more synthetic patients without wiping the previous ones? Set the mode to append when running the script:

    PATIENT_SEED_MODE=append cargo run -p scripts

    The default mode is reset, which keeps the deterministic hospital snapshot while refreshing patients on every run.

When you're done developing, stop the database container with docker compose down (add -v to prune the named volume).

About

Rust-based optimization project that uses constraint programming to maximize the number of lives saved in emergency and healthcare scenarios. It models hospitals, diseases, available beds, ambulance positions and capacities, and patient needs, then computes optimized resource allocations to improve medical response and outcomes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages