DSC Capstone  ·  UC San Diego  ·  2025–2026

Simulating Patient Flow Across UC San Diego Health

A data-driven simulation of UCSD Health's three-hospital network — built to give hospital operations teams a safe way to test smarter patient transfer policies before changing anything in the real world.

Nadine Orriss & Kayanne Tran  ·  Mentored by Dr. Karandeep Singh & Aaron Boussina

Read the Report View on GitHub
2.1M ADT Events
150K+ Patient Trajectories
3 Hospital Campuses
12 Simulated States

The Problem

When the Emergency Department Becomes a Waiting Room

Imagine you've just been admitted to the hospital, but there are no inpatient beds available yet. Instead of moving to the right unit to start your care, you wait — in the emergency department — sometimes for many hours. This is called ED boarding, and it's a widespread problem in American hospitals. It leads to longer wait times for everyone in the ER, lower quality of care for admitted patients, and enormous stress on frontline staff.

Why is this so hard to fix? The ED is just one piece of a much larger system. Patients don't leave the ER until there's a bed for them upstairs — but those beds are occupied by other patients who can't be discharged until they're recovered. It's a chain reaction that no single department can solve on its own.

UCSD Health operates three hospital campuses — La Jolla, Hillcrest, and East Campus — that collectively see hundreds of patients every day. In theory, a patient who can't get a bed at one campus could be transferred to another with available capacity. In practice, health systems have no safe way to experiment: you can't reroute hundreds of real patients just to see if a policy might work better.

Who This Is For

This tool is designed for hospital operations leaders and health system planners at UCSD Health — people responsible for capacity management, patient throughput, and inter-campus coordination. Rather than relying on gut instinct or historical averages, they can use this simulation to pressure-test transfer policies in a risk-free virtual environment before committing to any real change in operations.

Our Approach: A Virtual Replica of UCSD Health

We built a discrete event simulation (DES) — a computer model that recreates patient flow across all three UCSD Health campuses simultaneously. Think of it as a flight simulator for hospital operations: instead of risking real patients, administrators can test different transfer policies in the model, see what happens, and make smarter decisions before ever changing anything in the real world.

What makes our simulation unusual is that instead of inventing fictional patient paths, each virtual patient follows an actual historical journey drawn from a library of 150,337 real UCSD Health encounters — making it as faithful a replica of the real system as the data allows.

Scope & boundaries: This is a research and planning tool, not a clinical deployment. It models bed capacity and patient flow only — it does not make treatment recommendations, account for clinical contraindications, patient consent, or staffing constraints. All simulation results are comparative (policy A vs. policy B vs. baseline); absolute numbers should be interpreted as directional signals, not operational mandates. Transfer policies were each tested in isolation — simultaneous multi-campus transfer logic is a direction for future work.

The Data

One Year of Real Patient Journeys

Our simulation is built on Admit-Discharge-Transfer (ADT) event data from UC San Diego Health — a de-identified record of every time a patient was admitted, moved between units, or discharged during a one-year observation period. Each event is timestamped and linked to a specific patient encounter, department, care tier, and campus.

The raw dataset contains 2.1 million events across 985,000 patient encounters. After filtering to patients who physically occupied hospital beds, we retained 150,337 complete patient trajectories suitable for simulation. For the length-of-stay prediction model, we held out 20% of encounters as a test set, with the remaining 80% used for training — ensuring the predictor was never evaluated on data it had seen before.

La Jolla

Jacobs Medical Center & Sulpizio Cardiovascular Center · 418 posted beds · Highest patient volume

Hillcrest

Hillcrest Medical Center · 381 posted beds · Most available slack capacity

East Campus

East Campus Medical Center · 302 posted beds · Smallest campus, critically constrained ICU

Patient arrivals vary meaningfully between weekdays and weekends — La Jolla averages 198 arrivals per weekday but only 149 per weekend day, a ~25% drop driven by fewer elective admissions. Our simulation models these patterns separately to reproduce the real rhythms of the health system.

Technical detail — Data preprocessing pipeline

The raw ADT data required a four-step cleaning pipeline before it was simulation-ready:

Step 1 — Filter to bed-occupying patients. We identified 11 patient classes that physically occupy beds and removed 22 outpatient classes, reducing the dataset from 2.19M to 1.15M rows.

Step 2 — Drop single-event encounters. 1,720 encounters (1.1%) had only one event and were dropped.

Step 3 — Tier mapping. Raw department labels were collapsed into four care tiers: ED, Floor, ICU, and Boarding. ED events required special handling because the department group field was never populated for emergency departments in the source data.

Step 4 — Timestamp-based ordering. We reordered all events by timestamp to handle sequence numbering inconsistencies in the source data.

Methods

Building a Virtual Hospital System

The simulation models each patient as a sequence of states — ED → Floor → ICU → Discharge — across any of the three campuses. We added a fourth care state, Boarding, to explicitly model patients who have been admitted as inpatients but are physically stuck in the ED waiting for a bed upstairs. This gives us 12 active states in total (4 tiers × 3 campuses), plus discharge.

Rather than assigning patients synthetic paths, each arriving patient is assigned an actual historical trajectory randomly sampled from the 150,337-encounter library. Bed capacity for each of the 12 states was calibrated from the data itself by observing steady-state occupancy in an unconstrained simulation run.

What We Built vs. What We Used

🔨 Built from scratch

  • Multi-campus DES architecture (12-state model)
  • Trajectory library from 150K+ real patient paths
  • Weekday/weekend arrival rate modeling
  • Capacity calibration from empirical occupancy
  • LOS quantile regression predictor (3 features)
  • Transfer trigger & stochastic rerouting logic
  • Threshold sensitivity analysis (3 × 3 experiments)
  • Interactive simulation animation

📦 Built on top of

  • SimPy — Python discrete event simulation engine
  • vidigi — event logging & resource tracking
  • scikit-learn — quantile regression modeling
  • pandas / NumPy — data processing
  • matplotlib — result visualization
  • ADT data provided by UC San Diego Health

Predicting Who Needs a Long Stay

To enable smarter transfer decisions, we trained a length-of-stay (LOS) predictor using quantile regression. At the moment a patient is admitted from the ED, the model predicts whether their stay is likely to be long — using three features available at that moment: how long they've already been in the ED, how many times they've been admitted in the past 90 days, and which campus they're at.

We predict the 75th percentile of expected LOS rather than the average, because hospital LOS distributions are heavily skewed by a small number of very long stays. Patients whose predicted LOS exceeds a threshold are flagged for possible transfer to a less congested campus before they occupy a scarce inpatient bed.

How the Project Evolved

Several design decisions changed significantly after we saw early results:

Technical detail — LOS predictor and transfer logic

Three quantile regression models were trained (q = 0.25, 0.50, 0.75) with log-transformed LOS as the response variable. Features: time in ED before admission, number of prior admissions in 90 days, and admitting campus (one-hot encoded). An 80/20 train/test split was used; residuals were evaluated on held-out data only.

When a transfer is triggered, the patient's remaining historical trajectory is discarded and a new path is constructed by iteratively sampling the next state from an empirical transition probability matrix, with durations drawn from fitted per-state LOS distributions (lognormal for floor/ICU, exponential for boarding).

Each source campus was tested independently at three thresholds: 3, 8, and 12 hours, over a 4,328-hour (~6 month) simulation window with a fixed random seed of 42.

Results & Impact

What the Simulation Reveals

After a 25–30 day warm-up period, bed utilization stabilizes into realistic steady-state patterns. The results are striking: two of the three campuses are chronically operating near or above capacity, with serious consequences for patient wait times.

See It in Action

The animation below shows a 30-second snippet of the simulation running the recommended transfer policy — routing long-stay patients out of La Jolla at a 12-hour LOS threshold. Each figure represents a patient moving through the system in real time across all three campuses.

Animated simulation showing patient figures moving through ED, boarding, floor, and ICU queues at La Jolla, East Campus, and Hillcrest simultaneously.

How to explore the full interactive animation:

  1. Click the button below to open the simulation in a new tab.
  2. Use the play/pause control at the bottom to start the animation.
  3. Hover over any patient figure to see their current state and wait time.
  4. Watch how the queue lengths at each campus change over time.

30-second preview · La Jolla 12-hour transfer policy

Explore the Full Interactive Animation →

Where Is the System Breaking Down?

Line chart of La Jolla bed utilization over 175 days.

La Jolla — average daily bed utilization over the 6-month baseline simulation.

Line chart of East Campus bed utilization over 175 days.

East Campus — average daily bed utilization over the 6-month baseline simulation.

Bar chart showing proportion of simulation time each resource spent above 80% utilization.

Proportion of simulation time each resource spent above 80% utilization. La Jolla and East Campus are the most chronically constrained. ED resources across all campuses are near zero — the bottleneck is inpatient capacity, not the ED itself.

Bar chart of average wait time per resource in hours. ICU East Campus is by far the tallest bar.

Average wait time per resource (hours) among all queue events in the baseline simulation. East Campus ICU stands out dramatically — patients waiting for one of only 8 beds face severe delays once that resource fills.

Transfer Policies: What Actually Helps?

We tested whether routing long-stay patients away from their admitting campus at the moment of ED admission could reduce these bottlenecks. The answer depends critically on which campus the transfers originate from.

Two line charts for La Jolla boarding unit and ICU showing baseline vs. 3hr, 8hr, and 12hr transfer thresholds.

La Jolla boarding unit and ICU utilization under three LOS-based transfer thresholds vs. baseline. All three thresholds eliminate boarding congestion and meaningfully reduce ICU pressure.

Two line charts showing mean wait time vs. LOS threshold at La Jolla boarding and East Campus ICU, with separate lines per source campus.

Sensitivity of mean wait time to LOS transfer threshold, by source campus. Transferring from La Jolla reliably reduces system-wide congestion. Transferring from Hillcrest can overwhelm East Campus ICU under aggressive thresholds — a non-obvious load-shifting effect that shows why transfer policy design requires system-wide thinking.

Key finding: Transferring long-stay patients out of La Jolla using an 8- or 12-hour LOS threshold is the most promising near-term operational intervention. It eliminates boarding congestion at La Jolla without degrading conditions at receiving campuses. Transfers from Hillcrest or East Campus require careful threshold selection — aggressive rerouting can introduce new bottlenecks, particularly at East Campus's small 8-bed ICU.

How to Interpret These Results

The utilization percentages and wait times here are simulation outputs, not live measurements from UCSD Health operations. The most meaningful signal is comparative: how does a transfer policy perform relative to the no-transfer baseline, and does that pattern hold across multiple threshold conditions? Consistent patterns across thresholds are more robust findings than any single number.

Limitations

What Comes Next

Three directions stand out for future work: enriching the LOS predictor with clinical features available at admission; modeling simultaneous multi-campus transfer logic to capture system-wide interaction effects; and incorporating real-time capacity checks into the transfer trigger so that transfers are only authorized when the receiving campus has available beds.

The Team

About Us

This project was conducted through the Joan & Irwin Jacobs Center for Health Innovation at UC San Diego as part of the DSC 180B Capstone sequence. Data was provided by UC San Diego Health. Simulation was implemented in Python using SimPy and vidigi.

NO

Nadine Orriss

B.S. Data Science · UC San Diego, 2026

KT

Kayanne Tran

B.S. Data Science · UC San Diego, 2026

KS

Dr. Karandeep Singh, MD, MMSc

Chief Health AI Officer · UC San Diego Health

AB

Aaron Boussina, PhD

Assistant Adjunct Professor, Medicine · UC San Diego

Prior Work & Acknowledgements

This project builds on a body of prior DES research in hospital operations. Key works that informed our design and methodology: