Case study
Lumen
This project is live right nowA web app that helps a dialysis clinic move every patient's treatment before a planned power shutoff, and sends nothing until staff approve.
96 synthetic dialysis patients planned in the live demo: 92 get a new slot and a message, 4 a staff call
Who had the problem#
People on dialysis can't skip treatment. A missed session is dangerous, and the risk grows every day without care. After Hurricane Sandy, patients who got dialysis early had 28% lower odds of dying within 30 days.
In fire weather, PG&E turns off power on purpose with a Public Safety Power Shutoff. The warning comes about two days ahead, and the outage can last days. When a dialysis clinic is inside the area, its staff must find every patient another chair before the power goes off. Today they do it by phone, one patient and one clinic at a time.
The receiving clinic needs records, too. In one study after Sandy, 92% of hospitals reported missing dialysis records for patients from other clinics.
What I built#
I led a team of 4 at SpartHill Hacks 2026, in the AWS track, to build Lumen. A clinic manager starts from the shutoff notice the clinic already gets. Lumen finds every patient with a treatment while the power is off, puts the most urgent first, and finds each one a slot: an earlier session at their own clinic, or the nearest clinic with power and a free chair at their usual time. When nothing fits, the patient goes on a hospital's list for a staff phone call.
Each patient Lumen places gets a short message in their language with the day, time, clinic and ride pickup. Lumen then checks its own plan and explains each problem in a plain sentence, such as a patient with no recent hepatitis B test. Nothing is sent until staff press Approve and tell everyone. That one press sends a voice note to each of the 92 patients Lumen placed and gives each receiving clinic a list of who is coming, with ride, language and hepatitis B test date.
Plans change, so staff can type a change in plain words, such as a patient who declined, and Lumen updates the plan. Changed patients go back on the list to approve. In the demo the patients are synthetic and every send is simulated.
I wrote the team's plan and the API contract, set up AWS, and built slot matching, the plan check, approvals and voice notes. On the second day I rebuilt the whole console: the step-by-step panel, the map with live road routes, the review list, the landing page and the replay that anyone can run without an access key.










How it works#
Lumen is a static web app on AWS Amplify that talks to one Python function on AWS Lambda. That function is the whole API: 11 routes, from reading the notice to planning, checking, approving and sending. Clinics, patients, every plan version and the voice notes are stored in Amazon S3. The diagram follows one shutoff notice, from reading it to the plan staff approve.
- A shutoff notice comes into the static web app on AWS Amplify.
- The app talks to one Python function on AWS Lambda. That function is the whole API: 11 routes.
- A language model on Amazon Bedrock reads the notice and rewords the plan check into plain sentences. Patient names never reach the model.
- The rules decide: code ranks patients, picks slots, checks capacity and finds every problem.
- Each plan change is saved as a new version in Amazon S3 with a conditional write.
- Staff approve the plan, and the voice notes come from Amazon Polly.
The design rule is: the model reads and explains, the rules decide, and people approve. A language model on Amazon Bedrock reads the notice, rewords the plan check into plain sentences and turns a typed change into edits. Code does the rest: it ranks patients, picks slots, checks capacity and finds every problem, and it checks every edit before applying it. Patient names never reach the model.
Matching walks the ranked list. Each patient gets an earlier session at their own clinic when there is time, then the nearest clinic with power and a free slot at their usual time, then a hospital's list and a staff phone call. A chair is never given twice, rows that staff pinned or confirmed keep their slots when the plan runs again, and pickup time is the slot start minus the drive and 20 minutes. Each plan change is saved as a new version in S3 with a conditional write, so two edits on the same version can't both win.
The map uses MapLibre with Amazon Location Service tiles, and the browser traces real road routes with Amazon Location. Drive times inside the plan are estimates from straight-line distance. Voice notes come from Amazon Polly in English, Spanish and Chinese. For a Vietnamese-speaking patient, the message is in Vietnamese and the voice note plays in English. Each browser tab gets its own session, so one visitor's reset doesn't erase another's plan. The clinics are real, from public Medicare (CMS) data, and their open slots are simulated.
The hardest part#
The hardest part was keeping every rule while matching 96 patients at once to the clinics' open chairs. An early session must fall on a later day than the usual session before the one it replaces, and end before the outage starts. A paratransit ride must be booked the day before and can't pick up before 6:30 AM. A patient with hepatitis B can only move to a clinic with an isolation station.
I wrote the plan check apart from the matching, so it doesn't trust the plan's own numbers. It reads only who goes where and when, then works out each drive, each pickup time and the gap before the patient's next usual session from the clinic and patient records, and counts the chairs again. Each problem becomes a plain sentence, such as a patient who would wait too long for the next usual session. A serious problem holds back the voice note of each patient it affects and their line on the receiving clinic's list. In the recorded run, the check found 21 warnings and no serious problems.
Plans also change after the first run, and one change shouldn't reshuffle everyone. So I built re-planning to lock every patient whose chair the change doesn't touch and match only the rest. In the recorded run, a change entered in plain words said one clinic could take only 4 of the 18 patients the plan had sent there. 7 of its patients moved to other clinics, 7 went to a staff call, and no other patient changed. Lumen lists every change to each patient's clinic, slot, pickup time and status, and the new plan version adds a dated entry to the audit log.
Results in numbers#
The live demo plans a shutoff that cuts power to 3 clinics for about 42 hours. All 96 synthetic patients with a treatment in that window get a plan: 17 come in early, 75 move to 7 other clinics, and 4 go on the staff call list. 60 of the 75 moves are within an estimated 10-minute drive, and the longest is 19 minutes.
92 patients get a message in their own language (English, Spanish, Chinese or Vietnamese), and the plan lists the 14 paratransit rides to book that day. In the recorded live run, the planning step for all 96 patients took 162 ms.
Behind it: 11 API routes in one Lambda function, 9 JSON schemas written first so each teammate built against the same contract, and 657 backend tests that pass. Lumen has no real users yet. It is a hackathon prototype, and its planning rules are demo assumptions, not clinical guidance.
What's next#
The team's backlog holds the next two steps: voice notes sent at a set time before each new slot with Amazon EventBridge Scheduler, and a short-notice mode for a shutoff that comes with only hours of warning, where staff calls go first.
Then more people. Dialysis is the first group. People on home oxygen or ventilators, people with power wheelchairs and people whose medicine must stay cold depend on power too, and Lumen doesn't serve them yet.