@who-growth/core
v0.4.0
Published
WHO Child Growth Standards calculator — z-scores, percentiles, and nutritional classification
Maintainers
Readme
@who-growth/core
WHO Child Growth Standards calculator — z-scores, percentiles, and nutritional classification.
Zero dependencies. Works in Node.js, browsers, and edge runtimes.
Features
- 2 chart sets: WHO standard, Down syndrome (Zemel 2015)
- 6 growth indicators: weight-for-age, length/height-for-age, BMI-for-age, head circumference-for-age, weight-for-length, weight-for-height
- Full age range: 0–19 years (WHO), 0–18 years (Down syndrome)
- Prematurity correction: gestational age adjustment up to 2 years
- Nutritional classification: SISVAN/WHO cutpoints
- i18n: pt-BR, en, es
- LMS data: 26 official tables embedded, lazy-loaded
Chart Sets
| Chart Set | Status | Age Range | Indicators | |-----------|--------|-----------|------------| | WHO Standard | ✅ Complete | 0–19 years | All 6 | | Down Syndrome (Zemel 2015) | ✅ Complete | 0–20 years | WFA (0–18y), LFA (0–18y), BFA (0–18y), HCFA (0–20y) |
Install
npm install @who-growth/coreUsage
import { calculateZScore, calculateAll } from '@who-growth/core';
// Single indicator (WHO standard)
const result = await calculateZScore({
indicator: 'weight-for-age',
sex: 'male',
ageInDays: 365,
measurement: 9.5,
});
// → { indicator: 'weight-for-age', zScore: -0.11, percentile: 45.6 }
// Full assessment (WHO standard)
const assessment = await calculateAll({
sex: 'female',
dateOfBirth: new Date('2024-06-15'),
dateOfMeasurement: new Date('2025-06-15'),
weight: 9.2,
lengthHeight: 74.5,
headCircumference: 45,
gestationalAgeWeeks: 34, // optional — triggers prematurity correction
});
// → { age, results, classifications }
// Down syndrome charts
const dsResult = await calculateAll({
sex: 'male',
dateOfBirth: new Date('2024-01-01'),
dateOfMeasurement: new Date('2025-01-01'),
weight: 8.5,
lengthHeight: 70,
chartSet: 'down-syndrome',
});API
calculateZScore(input): Promise<ZScoreResult | null>
Calculate z-score and percentile for a single indicator.
Options:
chartSet:'who-standard'(default) |'down-syndrome'
calculateAll(input): Promise<AssessmentResult>
Calculate all applicable indicators for a patient, including age calculation, prematurity correction, and nutritional classification.
computeZScore(measurement, lms): number
Low-level z-score calculation from measurement and LMS parameters. Implements the WHO standard formula with L=0 handling and |Z|>3 extrapolation.
classify(result, ageInDays): Classification
Classify a z-score result using SISVAN/WHO cutpoints.
ageInDays(dateOfBirth, dateOfMeasurement): number
Calculate age in days between two dates.
correctedAgeInDays(chronologicalDays, gestationalAgeWeeks?): number
Apply prematurity correction (up to 2 years of age).
Formulas
- Standard:
Z = ((measurement/M)^L - 1) / (L × S) - When L=0:
Z = ln(measurement/M) / S - |Z| > 3: WHO linear extrapolation method
- Percentile: Normal CDF (Abramowitz & Stegun approximation)
Data Sources
- WHO: WHO Anthro (0–5y) + WHO AnthroPlus (5–19y)
- Down Syndrome: Zemel BS, et al. Growth Charts for Children With Down Syndrome in the United States. Pediatrics. 2015;136(5):e1204-e1211.
License
MIT
