infant-nutrition-calculator

1.0.3 • Public • Published

infant-nutrition-calculator

Calculator of infants nutrition based on WHO standards.

Installation

npm install infant-nutrition-calculator --save

Basic Usage

let nutritionCalculator = new (require('infant-nutrition-calculator'))('LANGUAGE')

OR

let infantNutritionCalculator = require('infant-nutrition-calculator')
let nutritionCalculator = new infantNutritionCalculator('LANGUAGE')

LANGUAGE is a variable passed to the contructor that can take 3 different values: 'EN' (English), 'FR' (French) or 'ES' (Spanish). Results would be returned in the language selected. Default language is English

Basic Usage

nutritionCalculator.calculateNutrition(months, gender, weight, height)

Where:

  • months: A int from 24 to 60. (From 2 years old until 5 years old)
  • gender: Either "M" (Male) or "F" (Female)
  • weight: The weight of the infant. A number variable that can take any number of decimals.
  • height: The height of th infant. A number variable that can take any number of decimals.

Example response

{
  months: 36,
  gender: 'M',
  weight: 14.5,
  height: 96,
  WFA: {
    ID: 'M36',
    Sexo: 'M',
    Meses: '36',
    L: '-0.0689',
    M: '14.3429',
    S: '0.12116',
    zWFA: 0.08987715419006534,
    risk: 'Correcta'
  },
  HFA: {
    ID: 'M36',
    Sexo: 'M',
    Meses: '36',
    L: '1',
    M: '96.0835',
    S: '0.03858',
    zHFA: -0.02252555175172329,
    risk: 'Correcta'
  },
  WFH: {
    ID: 'M96',
    Sexo: 'M',
    'Talla(cm)': '96.0',
    L: '-0.3521',
    M: '14.3037',
    S: '0.08083',
    zWFH: 0.16822650832354302,
    risk: 'Correcta'
  },
  recommendedAction: 'Infant is healthy. No further action needed.'
}

Additional calculations

You can call each of the internal functions separately, in case you are only interested in one of the indicators:

nutritionCalculator.calculateWFA(months, gender, weight)
nutritionCalculator.calculateHFA(months, gender, height)
nutritionCalculator.calculateWFH(gender, weight, height)

Formulas

Formula

Links

Package Sidebar

Install

npm i infant-nutrition-calculator

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

151 kB

Total Files

16

Last publish

Collaborators

  • datos-solidarios