Functional Weave
Code in Rust

health.news2@1.0.1

README.md

5,566 bytes · view raw

# health.news2

Status: needs review and sign-off by a qualified clinician before it is published. Not a medical device; for decision support only; always follow local clinical guidelines.

The National Early Warning Score 2 for one set of adult observations. Each of
the six physiological parameters is scored from the Royal College of
Physicians' chart 1, 2 is added when the patient needs supplemental oxygen,
and the sum is the aggregate NEW score. The clinical risk band comes from
chart 2:

| NEW score | Clinical risk |
|---|---|
| aggregate 0-4 | low |
| a score of 3 in any single parameter (a "red score") | low-medium |
| aggregate 5-6 | medium |
| aggregate 7 or more | high |

The bands are checked in the order high, medium, red score, low: a red score
raises a low aggregate to low-medium, but an aggregate of 5 or more already
outranks it. `redScore` is returned separately because the RCP asks for an
urgent ward-based review for any red score, whatever the band. The oxygen
weighting (2) can never be a red score on its own.

## The scoring (RCP chart 1)

| Parameter | 3 | 2 | 1 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|---|---|
| Respiration rate /min | ≤8 | | 9-11 | 12-20 | | 21-24 | ≥25 |
| SpO2 scale 1 % | ≤91 | 92-93 | 94-95 | ≥96 | | | |
| SpO2 scale 2 % | ≤83 | 84-85 | 86-87 | 88-92, or ≥93 on air | 93-94 on oxygen | 95-96 on oxygen | ≥97 on oxygen |
| Air or oxygen | | oxygen | | air | | | |
| Systolic BP mmHg | ≤90 | 91-100 | 101-110 | 111-219 | | | ≥220 |
| Pulse /min | ≤40 | | 41-50 | 51-90 | 91-110 | 111-130 | ≥131 |
| Consciousness | | | | alert | | | new confusion, voice, pain, unresponsive |
| Temperature °C | ≤35.0 | | 35.1-36.0 | 36.1-38.0 | 38.1-39.0 | ≥39.1 | |

## Things a caller must get right

- **SpO2 scale 2 is only for patients with confirmed hypercapnic (type 2)
  respiratory failure, on the direction of a competent clinical decision
  maker** (RCP report, paragraphs 25-26). On scale 2 a high saturation while
  on oxygen scores up to 3, because over-oxygenation is the danger; on air it
  scores 0. Scoring such a patient on scale 1 under-scores them.
- **NEWS2 is for adults aged 16 or over and not in pregnancy** (RCP report,
  paragraph 2). This function cannot see age or pregnancy; the caller must
  not use it for children or pregnant women.
- **New confusion** (`confusion`, the C of ACVPU) means new-onset confusion,
  disorientation or delirium, and scores 3 like voice, pain or unresponsive.
- **Temperature** is compared "at or below" each chart row, so a value
  between two one-decimal rows (35.05) scores with the higher row (35.1-36.0,
  score 1). Thermometers record one decimal place.
- The other observations are whole numbers, as charted.

## Input guard rails (not from the RCP)

Out-of-range values are errors, never clamped, so a unit or typing mistake
(98.6 for a Celsius temperature, a pulse of 700) cannot quietly produce a
score. The ranges are the implementation's own and need clinical sign-off:
respiration rate 1-80 /min, SpO2 1-100 %, systolic BP 20-300 mmHg, pulse
1-300 /min, temperature 25.0-45.0 °C, SpO2 scale 1 or 2, consciousness one of
`alert`, `confusion`, `voice`, `pain`, `unresponsive`.

## Source

Royal College of Physicians. *National Early Warning Score (NEWS) 2:
Standardising the assessment of acute-illness severity in the NHS.* Updated
report of a working party. London: RCP, 2017. Chart 1 "The NEWS scoring
system" and chart 2 "NEWS thresholds and triggers",
https://www.rcp.ac.uk/improving-care/resources/national-early-warning-score-news-2/
. The vectors were worked out by hand from those two charts; the RCP
publishes no numeric worked examples.

## Before you rely on this

**Not professional advice.** This capability calculates health figures from published rules. It is a software component for developers, not medical advice. Rules change and every rate here has an effective date. Check that the dates cover your case. Verify results against the official sources listed above, and have an acute-care clinician review how you use it, before anyone relies on the output. Provided "as is" under its licence, without warranty.

**Not a medical device.** It is not intended to diagnose, treat or support clinical decisions about any individual. Anyone building it into clinical software is responsible for that software's regulatory status, and must validate it under their own clinical governance.

**Not for clinical use; regulatory review pending.** Whether publishing this capability makes it a medical device is under regulatory review. Until that is settled it is a developer library only.

**Unreviewed.** This capability's implementations agree in every language and pass its published test vectors, which were worked out from the official sources cited. But no qualified acute-care clinician has yet checked those vectors, or confirmed that the capability covers the cases it claims. Treat it as a draft. Do not use it for real people, money or decisions without your own expert review. Once a qualified reviewer signs off, this notice is replaced with their name, qualification and the date. Each new version needs fresh sign-off.

## Notices

Reproduced from: Royal College of Physicians. National Early Warning Score
(NEWS) 2: Standardising the assessment of acute-illness severity in the NHS.
Updated report of a working party. London: RCP, 2017.

1.0.1 marks it unreviewed (not for clinical use; regulatory review pending) and adds its attribution notices (NOTICE). The code and the tests are unchanged.