September 11, 2016 : Body Surface Area Estimation
© 安岡喜晴 (JoyShine)

I added body surface area estimation functions (Boyd, Du Bois, Gehan-George, Haycock, and Mosteller formulas with a mean value) to the Medical Calculator.

Body surface area is hard to measure directly on a living person.
So there are five formulas, each fitted to different data, and they give slightly different answers for the same person.

The calculator computes all five and returns the average.
It does not pick one of them as the right answer.



static const CalcInput BSA_CM_KG_INPUTS[] = {
    { L"Enter Height (centimeters)", INPUT_NUMBER, NULL },
    { L"Enter Weight (kilograms)",   INPUT_NUMBER, NULL },
};
inline void calc_bsa_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];
    if (h <= 0 || w <= 0) {
        swprintf(disp, dsz, L"Error");
        swprintf(pri, psz, L"Height (cm) and weight (kg) must be > 0 (Boyd formula uses log10(weight)).");
        det[0] = 0; (void)esz; return;
    }
    double boyd  = 0.03330 * pow(w, (0.6157 - 0.0188 * log10(w))) * pow(h, 0.3);
    double gehan = 0.0235   * pow(h, 0.42246) * pow(w, 0.51456);
    double hay   = 0.024265 * pow(h, 0.3964)  * pow(w, 0.5378);
    double dub   = 0.20247  * pow(h / 100.0, 0.725) * pow(w, 0.425);
    double most  = sqrt(h * w / 3600.0);
    double mean  = (boyd + gehan + hay + dub + most) / 5.0;
    wchar_t b[32];
    fmt_g(b, 32, mean);
    swprintf(disp, dsz, L"%ls", b);
    swprintf(pri, psz,
        L"Body Surface Area : %ls square meters\r\n"
        L"(mean of Boyd, Gehan-George, Haycock, Du Bois, Mosteller)\r\n"
        L"Used for drug dosing, cardiac index, body water estimation.",
        b);
    (void)esz; det[0] = 0;
}

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