Nursing home scheduling supervisor - weighted care-demand staffing-gap calculator, single-file tool - level weights are calibrated by each facility against its own service lists and never pre-filled, the night-shift minimum-staffing floor is a separate absolute-count line that ignores the weighted math, the dementia unit runs as its own group never blended with general floors, gaps grade red and yellow, multi-week runs point to hiring while single weeks deserve only scheduling, and a one-click absence stress test shows which shift breaks first
You are a coding agent building an internal tool for a nursing
home. Build a single-file HTML tool (HTML, CSS, JS fully inline,
no external dependencies, no network requests, opens by
double-click) that tells the scheduling supervisor whether each
shift has enough caregiving hands.
Core idea: do not divide residents by headcount - use weighted
points. Each resident carries a weight by care level; shift
demand is derived from total points and compared against the
roster to yield gaps.
[INPUT AREA 1 - RESIDENT MIX]
- Entry by group: general floors entered as "level x count"
(the facility's level system names itself); the dementia
unit is its own group, same structure, entered separately
- the two groups never merge, each produces its own demand
and its own gaps
- [HARD GATE] No pre-filled level weights. First use enters
"calibration mode": for each level, estimate hours item by
item from this facility's own service list for that level
(bathing, turning, toileting, feeding, rounding frequency
- this facility's list is the only authority), collapsed
into a point value the user confirms and saves. Uncalibrated
levels display "uncalibrated - no output," never an estimate
- Points one caregiver can carry per shift: also calibrated
by this facility (including a sensible allowance for
flexibility and breaks), never pre-filled
[INPUT AREA 2 - SHIFT STRUCTURE]
- Shift windows user-defined (e.g., day / evening / night,
start and end times entered)
- Per shift and per group (general / dementia): caregivers
actually rostered, split into regulars versus borrowed or
covering staff (recorded separately, never blended into
one number)
- Night floor: minimum [ ] on duty (user-entered), set per
group - an absolute headcount line that ignores the
weighted math; however rich the weighted surplus, staffing
never drops below this line
[COMPUTATION AND OUTPUT]
- Demand = (sum of residents x level points) / points one
caregiver carries, rounded up; the formula is displayed
openly in a "method" panel
- Gap table (shift x group): demand / rostered / gap; any
positive gap flags the row yellow; any night-floor breach
flags red - red overrides yellow
- Call-off stress test: one click simulates "one person out
today"; pick the group and shift, and the tool recomputes
only the affected rows and names which shift breaks first
- Weekly archive view: each week's gaps are stored and the
month-end view shows the gap distribution - a single-week
gap tags [SCHEDULING PROBLEM]; the same shift gapped for
[ ] consecutive weeks tags [STRUCTURAL PROBLEM - points to
hiring or a shift-model change]. The two tags are printed
separately and never merged for the user
Hard requirements:
- No external CDN, fonts, or icons; no network requests; data
never leaves the machine
- Resident mix and calibration profiles export and import as
a whole (JSON or equivalent)
- Any input change recalculates live; no "calculate" button
- Print view: gap table plus a field for the recommended
staffing figure for the week, printable as one page
Constraints:
- Level points, per-caregiver capacity, and the night floor
ship with no defaults and cite no "universal staffing
ratios" or "industry-standard ratios" - this facility's
points come from this facility's service lists, and the
floor comes from this facility's own safety decisions and
local requirements
- No built-in "standard nursing-home level system" - levels
are whatever this facility's assessment regime says they
are
- No auto-scheduling or "smart optimization" - the tool
computes gaps and prints structural conclusions; putting
people into slots is the supervisor's judgment
- No "suggest terminating / transferring staff" outputs - the
tool speaks to numbers
Why it is written this way
Every scheduling supervisor gets asked the same question daily: is tonight enough? The most common algorithm - residents divided by heads - is also the most misleading, because staffing calibrated to bed count is permanently short on floors full of level-3 residents and permanently fat on floors of independent ones. Weighted points translate "resident mix" into "hours of demand," turning scheduling from counting heads into matching demand. But the weights themselves must not be pre-filled: service lists, level definitions, even how long a feeding takes differ facility to facility, and a set of invented "universal points" yields gaps that are precisely wrong. Calibration mode makes first use clunky on purpose - every number it produces traces back to this facility's own lists.
The dementia unit as a separate, never-blended group is the second layer. The two populations carry different care physics - dementia load concentrates in wandering prevention, emotional redirection, and nighttime agitation, general floors in physical assistance - and the two staff pools barely interchange in practice (a dementia-unit caregiver needs to know the residents). Blending produces "the facility is fine, the dementia unit is not," an unexecutable conclusion. The night floor is a second, absolute line outside the weighted math: nights are when incident response depends most on raw presence, and some shifts are worth more than any hours-arithmetic - when something happens, someone must be in the room.
The two gap tags - scheduling problem versus structural problem - draw the boundary of the supervisor's job: a single week's gap is absorbed by call-off coverage, lending, and shuffled days off; the same shift gapped for weeks means the resident mix changed and the staffing mix did not, and no scheduling technique fills that. Blended together, supervisors either arm-wrestle structural holes with scheduling tricks forever (that road ends in caregiver burnout) or excuse every scheduling miss as "we're just short-handed." The one-click call-off test is the highest-frequency action made cheapest: after the 6 a.m. phone call, the supervisor needs the blast radius now, not a re-entry session.
Variables
| Variable | Notes |
|---|---|
| Level points | Calibrated from the facility's own service lists per level; a service-list revision (new service items added) triggers recalibration - this is not once-and-done |
| Per-caregiver capacity | Points one caregiver realistically carries per shift, with flexibility and break allowances; new facilities start conservative and adjust after a month of actuals |
| Night floor | Minimum on-duty count per group per night; set with local requirements for overnight staffing in mind and the facility's own response geography - the tool never fills it in |
| Structural-week threshold | Consecutive weeks of the same-shift gap before the [STRUCTURAL PROBLEM] tag; keep it small - structural fixes have long lead times, and a late tag means a late hiring start |