Functional Weave
Code in TypeScript

health.bmi@1.0.0

README.md

2,736 bytes · view raw

# health.bmi

Body mass index for an **adult**: weight in kilograms divided by the square of
height in metres, rounded half away from zero to one decimal place, with the
weight category it falls in.

**Adults only.** These bands do not apply to children and young people, whose
BMI is read against age- and sex-specific centile charts (UK-WHO / UK90). Do
not call this for anyone under 18.

## Categories

| category          | BMI (kg/m²)  |
|-------------------|--------------|
| `underweight`     | below 18.5   |
| `healthy-weight`  | 18.5 to 24.9 |
| `overweight`      | 25 to 29.9   |
| `obesity-class-1` | 30 to 34.9   |
| `obesity-class-2` | 35 to 39.9   |
| `obesity-class-3` | 40 or more   |

The bands are published to one decimal place, so the category is read from
the rounded index. 99.9 kg at 200 cm is 24.975, reported as 25.0, and is
overweight; a classifier that compares the raw 24.975 with `< 25` says
healthy weight, which disagrees with the number it prints.

## What it deliberately does not do

- **Lower thresholds for some ethnic backgrounds.** NICE recommends lower
  thresholds (overweight 23 to 27.4, obesity 27.5 or more) for people with a
  South Asian, Chinese, other Asian, Middle Eastern, Black African or
  African-Caribbean family background. This function returns the general
  bands only; apply the lower thresholds to `value` where they are relevant.
- **Interpretation.** BMI does not measure body fat or central adiposity; NICE
  asks for clinical judgement, particularly in the healthy-weight band, and a
  measure of central adiposity alongside it.

## Inputs

Weight is 10 to 650 kg and height 50 to 272 cm. Anything outside is refused,
not clamped: in practice it is a unit slip, such as height in metres (1.75) or
weight in pounds. The ranges are wide enough to include every recorded adult.
The arithmetic is plain division and multiplication, which is correctly
rounded in every language, and the rounding is `math.round-float`, so the
three implementations return the same double (`floats exact`).

## Sources

- NICE guideline NG246, *Overweight and obesity management*,
  recommendations 1.9.10 (the bands above, adults) and 1.9.11 (lower
  thresholds for some ethnic backgrounds):
  https://www.nice.org.uk/guidance/ng246/chapter/Identifying-and-assessing-overweight-obesity-and-central-adiposity
- The cut-offs are those of the World Health Organization's adult
  classification (WHO, *Obesity: preventing and managing the global
  epidemic*, Technical Report Series 894, 2000). `underweight` (below 18.5) is WHO's;
  NICE's list starts at healthy weight, 18.5. (The WHO report itself was not
  retrieved when this was written; every cut-off here was checked against
  NICE NG246.)