Inspiration

One of us read that ambulance crews in some cities spend over an hour waiting at the ER to hand over a patient. The ambulance is stuck at the hospital until the ER takes the patient, so it can't answer the next 911 call. We wanted to see how often this happens in New York, and what it would cost to fix.

What it does

SIREN looks at one Friday night of real 911 calls around three ERs in central Brooklyn, which we call Hospitals A, B and C. It replays the night in a simulation, tries different fixes, and recommends the cheapest one that gets ambulances back on the road sooner.

On a typical Friday, 26 of the 79 urgent patients waited more than 10 minutes for an ambulance. Crews spent a median of 47 minutes at the hospital per patient, and 113 hours in total across the night.

With a $900 budget, SIREN suggests five 2-hour offload nurse shifts, mostly at Hospital B, which was the busiest. In the simulation that gives ambulances 33 hours back and gets about 5 more urgent patients reached within 10 minutes. On the page, measured numbers are tagged REAL and simulated ones SIM.

How we built it

We pulled Friday-night Brooklyn calls from NYC's EMS Incident Dispatch dataset on NYC Open Data. In Databricks we cleaned them, kept the 11 zip codes within 2.5 km of the three ERs, saved the result as a Delta table, and used Spark SQL to get the numbers we wanted the simulation to match.

The simulation is written in Python with SimPy. Each real call comes in at its real time, an ambulance drives to it, takes the patient to the nearest ER, and waits at the door. We tuned it until a replay with no changes came within 10% of the real night. Then we tried 4,048 nurse schedules plus a few extra-ambulance options, five runs each, and for each budget picked the plan that freed up the most ambulance time.

The website is React with a MapLibre map. You can watch the night replay, see the queue at each ER door with and without the plan, change the budget, and print a shift schedule. There's also a chat where you can ask what-ifs, like "what if Hospital B is short-staffed?". Claude answers by running the simulation, not by guessing.

Challenges

The NYC data says when an ambulance arrived at a hospital and when the crew was cleared, but not which hospital or how long the handover took. We used arrival-to-clear time as the time at the hospital and assigned each call to the nearest ER. That's an approximation, and we say so.

Getting the simulation to match reality took most of the night. It matched the typical Friday well. It didn't match the holiday and summer nights as closely, so we demo the typical one.

We also decided not to claim lives saved. Three ERs don't see enough cardiac arrests in a night to measure that honestly, so we stuck to minutes and patients reached in time.

What we learned

We assumed more ambulances would be the answer. In our simulation they weren't: even with $5,000 to spend, SIREN stops at six nurse shifts ($1,080), because a nurse at the busiest door frees up more time than another ambulance does.

We also expected holiday weekends to be much worse. On average they were only a little busier than normal Fridays.

What's next

More fixes

  • Send patients to a less busy ER
  • Move ambulances closer to where calls are about to come in
  • Start nurse shifts at different times

Better data

  • Which hospital each patient went to, and how long the handover took (NYC's public data has neither, so we estimated both)
  • How full each ER is
  • Every night of the week and all five boroughs
  • Weather and events, so SIREN can plan for the coming Friday instead of replaying an old one

How we used Databricks

  • Data: pulled about 140 Friday nights of Brooklyn 911 calls from NYC Open Data, cleaned them, and saved them as one Delta table.
  • Analysis: used Spark SQL to find where delays build up. It's mostly one ER, late at night.
  • Simulation: the real numbers from Databricks were the targets our simulation had to match before we trusted it.
  • Next: refresh the data weekly with a scheduled job, and train a model to predict next Friday's busy hours.

Built With

Share this project:

Updates

Submission history