FAILURE MAP
← Case archive

FA-64766 / Clinical triage scoring / Open access

Inpatient fall risk score: gait weighting · case 01

A weak gait scores the same 20 points as an impaired gait.

Verified by executionVariant 1 · 11 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Weak and impaired gait share one weight.

THE FAILURE

Weak and impaired gait share one weight.

Unsuccessful approach: Scoring both at 10 under-weights impaired gait.

Case contract

Input {last_fall_days (or null), secondary_dx, aid, iv, gait, mental}. Toy points: a fall within the last 90 days (inclusive) 25; secondary diagnosis 15; aid none/bedrest/nurse 0, crutches/cane/walker 15, furniture 30; IV access 20; gait normal/bedrest/immobile 0, weak 10, impaired 20; mental status "forgets" or "overestimates" (overestimates own ability) 15, "oriented" 0. Risk: 0-24 LOW, 25-44 MODERATE, >= 45 HIGH. Return {score, risk}.

Why this case matters

Nursing risk scores map categorical observations to weighted points; recency windows, category tables and band edges fail independently.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    d = x['last_fall_days']
    fell = d is not None and d <= 90
    s = 25 if fell else 0
    s += 15 if x['secondary_dx'] else 0
    aid = x['aid']
    s += 30 if aid == 'furniture' else 15 if aid in ('crutches', 'cane', 'walker') else 0
    s += 20 if x['iv'] else 0
    g = x['gait']
    s += 20 if g in ('impaired', 'weak') else 0
    s += 15 if x['mental'] in ('forgets', 'overestimates') else 0
    risk = 'HIGH' if s >= 45 else 'MODERATE' if s >= 25 else 'LOW'
    return {'score': s, 'risk': risk}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 301,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'forgets'},
   {'score': 45, 'risk': 'HIGH'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 10,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'cane',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('score exactly 25',
   {'last_fall_days': 31,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 6,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'bedrest',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 302,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 20,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 50, 'risk': 'HIGH'}),
  ('score exactly 25',
   {'last_fall_days': 32,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 7,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'immobile',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 303,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'forgets'},
   {'score': 45, 'risk': 'HIGH'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 30,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'crutches',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('score exactly 25',
   {'last_fall_days': 33,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 8,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 304,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 40,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'cane',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 50, 'risk': 'HIGH'}),
  ('score exactly 25',
   {'last_fall_days': 34,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 9,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'bedrest',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 305,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'forgets'},
   {'score': 45, 'risk': 'HIGH'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 50,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('score exactly 25',
   {'last_fall_days': 35,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 10,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
no risk factors{'risk': 'LOW', 'score': 0}{'risk': 'LOW', 'score': 0}Passed
fall exactly 90 days ago{'risk': 'MODERATE', 'score': 40}{'risk': 'MODERATE', 'score': 40}Passed
fall a year ago{'risk': 'LOW', 'score': 20}{'risk': 'LOW', 'score': 20}Passed
furniture walking{'risk': 'HIGH', 'score': 50}{'risk': 'MODERATE', 'score': 40}Failed
walker user{'risk': 'HIGH', 'score': 45}{'risk': 'HIGH', 'score': 45}Passed
weak gait{'risk': 'HIGH', 'score': 55}{'risk': 'HIGH', 'score': 45}Failed
impaired gait{'risk': 'HIGH', 'score': 60}{'risk': 'HIGH', 'score': 60}Passed
score exactly 40{'risk': 'HIGH', 'score': 50}{'risk': 'MODERATE', 'score': 40}Failed
overestimates own ability{'risk': 'MODERATE', 'score': 30}{'risk': 'MODERATE', 'score': 30}Passed
score exactly 25{'risk': 'MODERATE', 'score': 25}{'risk': 'MODERATE', 'score': 25}Passed
score exactly 45{'risk': 'HIGH', 'score': 45}{'risk': 'HIGH', 'score': 45}Passed

SHA-256 / 5dded7b928fd65a748daf064167c8f55ac1fb317ff543a1f2a8a77abfc0f17f6

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    d = x['last_fall_days']
    fell = d is not None and d <= 90
    s = 25 if fell else 0
    s += 15 if x['secondary_dx'] else 0
    aid = x['aid']
    s += 30 if aid == 'furniture' else 15 if aid in ('crutches', 'cane', 'walker') else 0
    s += 20 if x['iv'] else 0
    g = x['gait']
    s += 10 if g in ('impaired', 'weak') else 0
    s += 15 if x['mental'] in ('forgets', 'overestimates') else 0
    risk = 'HIGH' if s >= 45 else 'MODERATE' if s >= 25 else 'LOW'
    return {'score': s, 'risk': risk}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 301,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'forgets'},
   {'score': 45, 'risk': 'HIGH'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 10,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'cane',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('score exactly 25',
   {'last_fall_days': 31,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 6,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'bedrest',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 302,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 20,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 50, 'risk': 'HIGH'}),
  ('score exactly 25',
   {'last_fall_days': 32,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 7,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'immobile',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 303,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'forgets'},
   {'score': 45, 'risk': 'HIGH'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 30,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'crutches',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('score exactly 25',
   {'last_fall_days': 33,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 8,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 304,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 40,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'cane',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 50, 'risk': 'HIGH'}),
  ('score exactly 25',
   {'last_fall_days': 34,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 9,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})],
 [('no risk factors',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'bedrest',
    'mental': 'oriented'},
   {'score': 0, 'risk': 'LOW'}),
  ('fall exactly 90 days ago',
   {'last_fall_days': 90,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('fall a year ago',
   {'last_fall_days': 305,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 20, 'risk': 'LOW'}),
  ('furniture walking',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'furniture',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('walker user',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'normal',
    'mental': 'forgets'},
   {'score': 45, 'risk': 'HIGH'}),
  ('weak gait',
   {'last_fall_days': None,
    'secondary_dx': False,
    'aid': 'cane',
    'iv': True,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'}),
  ('impaired gait',
   {'last_fall_days': 50,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'impaired',
    'mental': 'oriented'},
   {'score': 60, 'risk': 'HIGH'}),
  ('score exactly 40',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'walker',
    'iv': False,
    'gait': 'weak',
    'mental': 'oriented'},
   {'score': 40, 'risk': 'MODERATE'}),
  ('overestimates own ability',
   {'last_fall_days': None,
    'secondary_dx': True,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'overestimates'},
   {'score': 30, 'risk': 'MODERATE'}),
  ('score exactly 25',
   {'last_fall_days': 35,
    'secondary_dx': False,
    'aid': 'none',
    'iv': False,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 25, 'risk': 'MODERATE'}),
  ('score exactly 45',
   {'last_fall_days': 10,
    'secondary_dx': False,
    'aid': 'none',
    'iv': True,
    'gait': 'normal',
    'mental': 'oriented'},
   {'score': 45, 'risk': 'HIGH'})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
no risk factors{'risk': 'LOW', 'score': 0}{'risk': 'LOW', 'score': 0}Passed
fall exactly 90 days ago{'risk': 'MODERATE', 'score': 40}{'risk': 'MODERATE', 'score': 40}Passed
fall a year ago{'risk': 'LOW', 'score': 20}{'risk': 'LOW', 'score': 20}Passed
furniture walking{'risk': 'MODERATE', 'score': 40}{'risk': 'MODERATE', 'score': 40}Passed
walker user{'risk': 'HIGH', 'score': 45}{'risk': 'HIGH', 'score': 45}Passed
weak gait{'risk': 'HIGH', 'score': 45}{'risk': 'HIGH', 'score': 45}Passed
impaired gait{'risk': 'HIGH', 'score': 50}{'risk': 'HIGH', 'score': 60}Failed
score exactly 40{'risk': 'MODERATE', 'score': 40}{'risk': 'MODERATE', 'score': 40}Passed
overestimates own ability{'risk': 'MODERATE', 'score': 30}{'risk': 'MODERATE', 'score': 30}Passed
score exactly 25{'risk': 'MODERATE', 'score': 25}{'risk': 'MODERATE', 'score': 25}Passed
score exactly 45{'risk': 'HIGH', 'score': 45}{'risk': 'HIGH', 'score': 45}Passed

SHA-256 / 0585739e447b4f74d33cd888e67c946c400fe32fceee284e587beb9277cfee9d

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 11 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic toy software model with explicitly stipulated thresholds and formulas; it is not clinical guidance, not a validated medical calculator, and makes no claim of conformance to any published protocol. Numbered variants vary patient and order inputs. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:47:27.891132+00:00.

Case digest / 1692c3142589223c12ab91d937e314afb3af1aa9bacb47b6d60b3999cec95bcb