August 19, 2016 : Approach to Kaup Index
© 安岡喜晴 (JoyShine)

I added Kaup Index to the Medical Calculator. In pediatrics it is used for growth assessment of infants.

Kaup Index is just BMI applied to infants, and the formula is identical to the adult BMI.
What differs is that the same number means something different depending on the age in months.

Five zones, four boundaries, and a different set of numbers for every age band.
The thresholds fall as the child gets older.

static inline const wchar_t* kaup_zone(double k, int age_months) {
    double t1, t2, t3, t4;
    if      (age_months < 12) { t1 = 14.5; t2 = 16.0; t3 = 18.0; t4 = 20.0; }
    else if (age_months < 18) { t1 = 14.5; t2 = 15.5; t3 = 17.5; t4 = 19.5; }
    else if (age_months < 24) { t1 = 14.0; t2 = 15.0; t3 = 17.0; t4 = 19.0; }
    else if (age_months < 36) { t1 = 13.5; t2 = 15.0; t3 = 17.0; t4 = 18.5; }
    else                      { t1 = 13.0; t2 = 14.5; t3 = 16.5; t4 = 18.5; }
    if      (k < t1) return L"underweight";
    else if (k < t2) return L"slightly thin";
    else if (k < t3) return L"normal";
    else if (k < t4) return L"slightly overweight";
    else             return L"overweight";
}
static const CalcInput KAUP_CM_KG_INPUTS[] = {
    { L"Enter Height (centimeters)", INPUT_NUMBER, NULL },
    { L"Enter Weight (kilograms)",   INPUT_NUMBER, NULL },
    { L"Enter Age (months, 3-60)",   INPUT_NUMBER, NULL },
};
inline void calc_kaup_cm_kg(const double* in,
                             wchar_t* disp, size_t dsz,
                             wchar_t* pri,  size_t psz,
                             wchar_t* det,  size_t esz) {
    double h = in[0], w = in[1];
    int age_m;
    if (!val_pos(h) || !val_pos(w)) {
        calc_err(disp, dsz, pri, psz, det, esz,
            L"Height (cm) and weight (kg) must both be > 0.");
        return;
    }
    if (!val_int_range(in[2], 3, 60, &age_m)) {
        calc_err(disp, dsz, pri, psz, det, esz,
            L"Age must be a whole number of months 3-60 (Kaup index covers 3 months to 5 years).");
        return;
    }
    double kaup = w * 10000.0 / (h * h);
    const wchar_t* z = kaup_zone(kaup, age_m);
    wchar_t b[32];
    fmt_g(b, 32, kaup);
    swprintf(disp, dsz, L"%ls", b);
    swprintf(pri, psz, L"Kaup Index : %ls  (%ls - pediatric, age %d mo)", b, z, age_m);
    (void)esz; det[0] = 0;
}

Home  |  Profile  |  Software  |  Medicine  |  Diary  |  Photos  |  Contact