FAILURE MAP
← Case archive

FA-64376 / Clinical triage scoring / Open access

Sepsis screen from inflammatory criteria and bedside score: white cell criterion · case 01

Band forms above 10% never count toward the criteria.

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

ROOT CAUSE

The white cell criterion omits the immature band clause.

THE FAILURE

The white cell criterion omits the immature band clause.

Unsuccessful approach: Restoring bands but dropping leukopenia misses a low white count.

Case contract

Input {temp (1 dp), hr, rr, paco2 (or null), wbc, bands_pct, sbp, gcs, suspected_infection}. Toy inflammatory criteria (count): temp > 38.0 or < 36.0; hr > 90; rr > 20 or paco2 < 32 when measured; wbc > 12 or < 4 or bands > 10%. Bedside score: rr >= 22, sbp <= 100, gcs < 15. Without suspected infection the alert is NONE; otherwise SEPSIS_ALERT when the bedside score >= 2, else SIRS_ALERT when criteria >= 2, else NONE. Return {sirs, qsofa, alert}.

Why this case matters

Screening rules count criteria with open and closed thresholds and combine two scores with precedence; each is a separable defect.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
    t = Fraction(str(x['temp'])) * 10
    w = Fraction(str(x['wbc']))
    rr = x['rr']
    s = 0
    s += 1 if t > 380 or t < 360 else 0
    s += 1 if x['hr'] > 90 else 0
    s += 1 if rr > 20 or (x['paco2'] is not None and x['paco2'] < 32) else 0
    s += 1 if w > 12 or w < 4 else 0
    q = 0
    q += 1 if rr >= 22 else 0
    q += 1 if x['sbp'] <= 100 else 0
    q += 1 if x['gcs'] < 15 else 0
    if not x['suspected_infection']:
        alert = 'NONE'
    elif q >= 2:
        alert = 'SEPSIS_ALERT'
    elif s >= 2:
        alert = 'SIRS_ALERT'
    else:
        alert = 'NONE'
    return {'sirs': s, 'qsofa': q, 'alert': alert}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('hypothermia counts',
   {'temp': '35.5',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 96,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 93,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 29,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.5',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.1',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 12,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 97,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 91,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 89,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.6',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 97,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 94,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 30,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.6',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.2',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 13,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 98,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 1, 'alert': 'NONE'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 92,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 90,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.7',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 98,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 28,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.7',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.3',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 14,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 99,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 93,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 91,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.8',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 96,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 29,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.8',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.4',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 15,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 1, 'alert': 'NONE'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 94,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 92,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.9',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 100,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 97,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 30,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.9',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.5',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 16,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 101,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 1, 'alert': 'NONE'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 95,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 93,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})]]
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
hypothermia counts{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Passed
temperature exactly 38.0 not counted{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}Passed
missing blood gas not counted{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}Passed
low carbon dioxide with normal rate{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Passed
leukopenia counts{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Passed
band forms count{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Failed
respiratory rate exactly 22{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}Passed
rate 21 only meets inflammatory criterion{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}Passed
bedside positive without inflammatory criteria{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 0}{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 0}Passed
both scores positive{'alert': 'SEPSIS_ALERT', 'qsofa': 3, 'sirs': 4}{'alert': 'SEPSIS_ALERT', 'qsofa': 3, 'sirs': 4}Passed
no suspected infection{'alert': 'NONE', 'qsofa': 3, 'sirs': 4}{'alert': 'NONE', 'qsofa': 3, 'sirs': 4}Passed

SHA-256 / 4b9df82da9704ad54f3931ad098a814452bb493b98bc29d0381dc93d685e6701

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
    t = Fraction(str(x['temp'])) * 10
    w = Fraction(str(x['wbc']))
    rr = x['rr']
    s = 0
    s += 1 if t > 380 or t < 360 else 0
    s += 1 if x['hr'] > 90 else 0
    s += 1 if rr > 20 or (x['paco2'] is not None and x['paco2'] < 32) else 0
    s += 1 if w > 12 or x['bands_pct'] > 10 else 0
    q = 0
    q += 1 if rr >= 22 else 0
    q += 1 if x['sbp'] <= 100 else 0
    q += 1 if x['gcs'] < 15 else 0
    if not x['suspected_infection']:
        alert = 'NONE'
    elif q >= 2:
        alert = 'SEPSIS_ALERT'
    elif s >= 2:
        alert = 'SIRS_ALERT'
    else:
        alert = 'NONE'
    return {'sirs': s, 'qsofa': q, 'alert': alert}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('hypothermia counts',
   {'temp': '35.5',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 96,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 93,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 29,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.5',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.1',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 12,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 97,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 91,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 89,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.6',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 97,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 94,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 30,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.6',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.2',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 13,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 98,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 1, 'alert': 'NONE'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 92,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 90,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.7',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 98,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 28,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.7',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.3',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 14,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 99,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 93,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 91,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.8',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 96,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 29,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.8',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.4',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 15,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 1, 'alert': 'NONE'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 94,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 92,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})],
 [('hypothermia counts',
   {'temp': '35.9',
    'hr': 95,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('temperature exactly 38.0 not counted',
   {'temp': '38.0',
    'hr': 100,
    'rr': 18,
    'paco2': None,
    'wbc': '8',
    'bands_pct': 2,
    'sbp': 120,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('missing blood gas not counted',
   {'temp': '37.0',
    'hr': 97,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 0, 'alert': 'NONE'}),
  ('low carbon dioxide with normal rate',
   {'temp': '37.0',
    'hr': 80,
    'rr': 16,
    'paco2': 30,
    'wbc': '13',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('leukopenia counts',
   {'temp': '38.9',
    'hr': 80,
    'rr': 16,
    'paco2': None,
    'wbc': '3.5',
    'bands_pct': 0,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('band forms count',
   {'temp': '37.0',
    'hr': 99,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 16,
    'sbp': 125,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 2, 'qsofa': 0, 'alert': 'SIRS_ALERT'}),
  ('respiratory rate exactly 22',
   {'temp': '37.0',
    'hr': 80,
    'rr': 22,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 101,
    'gcs': 15,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 1, 'alert': 'NONE'}),
  ('rate 21 only meets inflammatory criterion',
   {'temp': '37.0',
    'hr': 80,
    'rr': 21,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 100,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 1, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('bedside positive without inflammatory criteria',
   {'temp': '37.0',
    'hr': 80,
    'rr': 18,
    'paco2': None,
    'wbc': '9',
    'bands_pct': 0,
    'sbp': 95,
    'gcs': 13,
    'suspected_infection': True},
   {'sirs': 0, 'qsofa': 2, 'alert': 'SEPSIS_ALERT'}),
  ('both scores positive',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 88,
    'gcs': 14,
    'suspected_infection': True},
   {'sirs': 4, 'qsofa': 3, 'alert': 'SEPSIS_ALERT'}),
  ('no suspected infection',
   {'temp': '38.9',
    'hr': 120,
    'rr': 26,
    'paco2': None,
    'wbc': '15',
    'bands_pct': 0,
    'sbp': 93,
    'gcs': 14,
    'suspected_infection': False},
   {'sirs': 4, 'qsofa': 3, 'alert': 'NONE'})]]
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
hypothermia counts{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Passed
temperature exactly 38.0 not counted{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}Passed
missing blood gas not counted{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}Passed
low carbon dioxide with normal rate{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Passed
leukopenia counts{'alert': 'NONE', 'qsofa': 0, 'sirs': 1}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Failed
band forms count{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}{'alert': 'SIRS_ALERT', 'qsofa': 0, 'sirs': 2}Passed
respiratory rate exactly 22{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}Passed
rate 21 only meets inflammatory criterion{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 1}Passed
bedside positive without inflammatory criteria{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 0}{'alert': 'SEPSIS_ALERT', 'qsofa': 2, 'sirs': 0}Passed
both scores positive{'alert': 'SEPSIS_ALERT', 'qsofa': 3, 'sirs': 4}{'alert': 'SEPSIS_ALERT', 'qsofa': 3, 'sirs': 4}Passed
no suspected infection{'alert': 'NONE', 'qsofa': 3, 'sirs': 4}{'alert': 'NONE', 'qsofa': 3, 'sirs': 4}Passed

SHA-256 / feb2eab26a821eb24188df617cc6e6a0401e1564f969b700d37f84ea248299ac

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:23.979896+00:00.

Case digest / 2bde2b75f90f6398bef3ce93cdba1c109f3c0abc8a09c3f6d6428f3625982773