Clinical values: where every medical number lives
Every number that makes a medical judgement (a vital-sign band, a probability cut-off, a symptom-to-condition mapping) lives in one of three places:
- In code, because it is a published standard. These are copied exactly from the source and must not be tuned.
- In
config/, as a tunable parameter. Each is marked[ASSUMPTION],[EVIDENCE …]or[NEEDS CLINICAL VALIDATION]next to its value. - In code, as a clinical mapping that is not a number (which concept is a red flag, which group a symptom belongs to). These are listed below for clinical review.
tests/test_clinical_values.py makes sure no loose probability cut-off creeps back into triage, policy or dispatch. It also checks that the legacy views keep no vital-sign thresholds of their own.
For values that are simulated or estimated on screen (vitals from the patient simulator, estimated hospital readiness), see What is simulated.
1. Published standards (in code, do not tune)
| Where | Standard | Values |
|---|---|---|
backend/app/vitals/news2.py | NEWS2, Royal College of Physicians 2017, SpO2 Scale 1 | Per-parameter bands RESP, SPO2_SCALE1, SYS_BP, PULSE, TEMP; response bands MEDIUM_TOTAL 5, HIGH_TOTAL 7; red component 3 |
backend/app/vitals/rts.py | Revised Trauma Score (Champion et al., 1989); Glasgow Coma Scale | Weights 0.9368 / 0.7326 / 0.2908; coding of GCS, SBP and RR to 0–4; GCS 3–15 (eye 1–4, verbal 1–5, motor 1–6) |
The server publishes these through GET /api/config → news2 (medium, high, red_component, and bands keyed by resp_rate / spo2 / sbp / hr / temp). No web view keeps its own copy:
- The live views use the incident's server-computed NEWS2.
- The legacy views (
/legacy*) colour a vital red withnews2Red(key, value)fromfrontend/src/platform/clientConfig.js. "Red" means the vital scores the NEWS2 red component on the served bands.
Known gap: SpO2 Scale 2 (patients with hypercapnic respiratory failure, such as COPD) is not implemented, so those patients are over-scored on SpO2.
2. Tunable clinical parameters (in config/)
config/policy.yaml (safety policy, safety/policy.py)
| Key | Value | Meaning |
|---|---|---|
concept_presence | 0.5 | Probability at which a verified finding counts as present. One value for triage findings (triage/pipeline.py), condition groups and the paediatric check (triage/conditions.py::present), the call-taker checklist (ops/calltaker.py), and dispatch: hospital needs, in-extremis and medico-legal checks (dispatch/risk.py) |
red_flag_presence / red_flag_doubt | 0.5 / 0.2 | When a red flag is asserted, and below that, when it is doubtful enough to ask a human |
critical_floor_mass | 0.8 | P(critical) after a red-flag floor |
als_mandate_p_critical | 0.5 | R9: P(critical) at which ALS becomes mandatory |
provisional_dispatch_p_critical | 0.15 | T_prov, derived from the cost ratio (see the comments in the file) |
split_vote_mass, max_rejected_share, red_flag_action_min_support, low-confidence band | — | Review triggers |
config/dispatch.yaml (risk engine, dispatch/risk.py)
| Key | Value | Meaning |
|---|---|---|
hazard_per_min, monitor_hazard_per_min, monitor_treated_factor | per class | Deterioration rates used by the objective and by the patient simulator |
bundle_min_p_critical | 0.05 | P(critical) + P(unknown) above which first-responder+ALS and dual-ambulance bundles are scored |
als_hard_min_mass | 0.2 | The policy's ALS mandate stays a hard constraint only when condition groups where ALS changes outcomes (destination.yaml als_hard) hold at least this belief |
parameter_sources in the same file gives the prior, range and source of each objective number.
config/destination.yaml (condition model and hospital choice)
door_to_treatment_sec(600).- Per condition group:
kappa, the effect of early care (e.g. cardiac arrest CPR 0.42, CPR+AED 0.62)needs,als_hard,in_extremisconcepts, time windows
- In-extremis vital limits (
vitals/extremis.py): SBP < 90, shock index > 1.0, SpO2 < 90 on oxygen, AVPU V/P/U, GCS ≤ 8.
The file carries its own [NEEDS CLINICAL VALIDATION] markers.
Other files
config/escalation_phrases.yaml: the escalation-only phrase list. It can raise urgency, never rule anything out.config/priority.yamlandconfig/calltaker.yaml: the call-taker protocol slots.config/er_prep.yaml: ER preparation checklists.
3. Clinical mappings in code (need clinical review)
These are not thresholds but medical judgements. They are written by engineers, not taken from a published protocol:
| Where | What | Used by |
|---|---|---|
triage/ontology.py CONCEPTS | The 29 concepts, the crew capability each implies, and the six red flags: not_breathing, unconscious, drowning, stroke_signs, severe_bleeding, pregnancy_bleeding. chest_pain is not a red flag | Safety policy floors, required capabilities |
triage/conditions.py CONCEPT_GROUP | Concept → condition group (e.g. unconscious → cardiac arrest, fall → major trauma). Marked [NEEDS CLINICAL VALIDATION] in the file | Dispatch condition model, hospital choice |
dispatch/risk.py CAP_NEED, TIME_CRITICAL | Crew capability → hospital service; which services are time-critical | Hospital choice |
triage/incident_type.py CATEGORIES, SUGGESTED, PAEDIATRIC_AGE (18) | Incident type precedence, services the ER usually wants (draft), paediatric age cut-off | Display and ER board only; dispatch never reads them |
triage/engine.py SEVERITY_VALUE | 10 / 6 / 3 / 2 numeric scale for the severity mean and variance | Uncertainty summary |
4. The patient simulator (vitals/physiology.py)
The simulator's baseline and decompensated vitals are written in code:
- Baseline: HR 88, RR 18, SpO2 96, SBP 128, T 37.0
- Decompensated: HR 148, RR 32, SpO2 82, SBP 84, T 37.4
- AVPU drops at decompensation 0.75 / 0.9, and oxygen starts below SpO2 92.
They only describe a simulated patient, but its readings drive real NEWS2 escalations and re-routing (S5 in What is simulated). Turn the simulator off with simulation.vitals: false or VAAZHVU_SIM_VITALS=0.
Changing a value
- A
config/value: edit the YAML and restart the api (docker compose up -d api, ormake voiceagain). The policy config is cached per process. - A published standard: change it only to follow a new revision of that standard, and cite the revision in the module docstring.
- A clinical mapping: get clinical sign-off. Record the reviewer and date in the module docstring and in this file.
- Dispatch objective terms:
services/dispatch-scorer(Go) must match the Python engine. The cut-offs above (concept_presence,bundle_min_p_critical,als_hard_min_mass,als_mandate_p_critical) are applied in Python before scoring, so the Go scorer has no copy of them.