Back to home

Case study

Lumen

This project is live right now

A 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.

Lumen's landing page, headed "When the power goes out, some people can't wait." A seam splits it in two. On the dark side, a clinic's call list on the night of a shutoff, with patients not reached, busy or on voicemail. On the lit side, the same patients with Lumen's plan on a map.
The same night twice: phone calls without Lumen, and a plan with it.
The Lumen console at step 2 of 8. The first step, reading the shutoff notice, is checked, and Find who is affected is working, while the shutoff area on the map is dark.
Step 2 of 8: Lumen has read the shutoff notice and is finding who is affected. The notice is simulated.
The map after step 2: dots for the homes of 96 patients who have a treatment while the power is off, and three clinics inside the area marked No power.
Step 2: 96 patients have a treatment during the outage. Every patient in the demo is synthetic.
Blue road routes run from the three closed clinics to clinics with power, each marked with its slots left or Full. The step list reads: 75 move, 17 come in early, 4 need a phone call.
Step 4: road routes to clinics with free slots. 75 patients move, 17 come in early and 4 go to a staff call.
Lumen on a phone. 92 patients have a slot and 4 need a phone call. A green box says the plan was checked and is ready to approve, and lists what to look at, above a Review and approve button and the line Nothing is sent until you approve.
On a phone: the plan is checked, and nothing is sent until staff approve.
The Approve and tell everyone list. Patients are grouped by the clinic they move to, each with a new day and time, a leave home time and a voice note switch. Each clinic has a Tell clinic switch, and one button at the bottom approves the whole list.
One approval. Every patient and clinic has a switch, and one button sends 92 voice notes and tells 7 clinics and 1 hospital. In the demo, the sends are simulated.
What one receiving clinic gets: a list of 14 arriving patients with day and time, ride, hepatitis B test date and language. The map shows only the routes into that clinic.
Each receiving clinic gets a list of who is coming and what it needs to take them.
On a phone, the message one patient gets: a text in Chinese with an English tab, the status Told 9:00 AM and Said yes, and a Play voice note button.
Each patient Lumen places gets a text in their language and a voice note. Replies in the demo are simulated.
On a phone, the step list after a change: staff typed that one patient declined, and Lumen understood that the patient will not come and needs a phone call.
Plans change. Staff type the change in plain words, and Lumen updates the plan for approval.
The done board after the simulated replies: slots 96 of 96 with 4 by phone, 92 patients told with 80 yes and 12 no answer, all 7 clinics and the hospital told and confirmed, and a Needs you now list of who still needs a call, soonest first.
After the simulated replies, before the change above: 80 of 92 said yes, and 16 people still need a call.

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.

One shutoff notice, from reading it to the plan staff approveA static web app on AWS Amplify talks to one Python function on AWS Lambda, the whole API. The model reads and explains, the rules decide, and people approve: every plan version is stored in Amazon S3, and the voice notes come from Amazon Polly.Shutoff noticeStatic web appon AWS AmplifyOne Lambdafunctionthe whole API:11 routesLanguage modelon Amazon Bedrock:reads the notice,rewords the plan checkRules deciderank patients, pickslots, check capacity,find every problemAmazon S3every plan version,with a conditional writeStaff approveAmazon Pollyvoice notes in English,Spanish and Chinesenew versionOne shutoff notice, from reading it to the plan staff approveA static web app on AWS Amplify talks to one Python function on AWS Lambda, the whole API. The model reads and explains, the rules decide, and people approve: every plan version is stored in Amazon S3, and the voice notes come from Amazon Polly.Shutoff noticeStatic web appon AWS AmplifyOne Lambda functionthe whole API: 11 routesLanguagemodelon AmazonBedrock: reads thenotice, rewords theplan checkRules deciderank patients, pick slots,check capacity, find everyproblemAmazon S3every plan version, witha conditional writeStaff approveAmazon Pollyvoice notes inEnglish, Spanishand Chinesenew version
One shutoff notice, from reading it to the plan staff approveDashed box: an AI model or agent
  1. A shutoff notice comes into the static web app on AWS Amplify.
  2. The app talks to one Python function on AWS Lambda. That function is the whole API: 11 routes.
  3. A language model on Amazon Bedrock reads the notice and rewords the plan check into plain sentences. Patient names never reach the model.
  4. The rules decide: code ranks patients, picks slots, checks capacity and finds every problem.
  5. Each plan change is saved as a new version in Amazon S3 with a conditional write.
  6. 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.