semantics-for-personal-health / heals-notebook

0 stars 0 forks source link

Create guideline input file #3

Open oshanis opened 2 years ago

oshanis commented 2 years ago

Create guideline input file:

o Parameters for guidelines currently not exposed to the user currently, move them into an externally editable file

o Allow user to define the location of the guideline file in the API

stouffers commented 2 years ago

Below are the existing guidelines from kbqa source. We will want to use the same structure for the guidelines in this file.

Note that this is currently in python, and not valid json

In the notebook, pass the guidelines in the API call under the param name guidelines (this will be incorporated in the API changes for #4).

GUIDELINE_DIRECTIVES = {

# T1
'T1': {'carbohydrates' :
    {'unit': 'g',
     'meal' :
       {'type': 'range',
       'lower' : '5',
       'upper': '30'},
    'daily total' : '30'}
    },

# DG 11
# provide 1,200–1,500 ∼kcal/day
'DG11': {'calories' :
    {'unit': 'calories',
     'meal' :
       {'type': 'range',
       'lower' : '1200',
       'upper': '1500'},
    'daily total' : '1500'}
    },

# DG 12
# provide 1,500–1,800 ∼kcal/day
'DG12': {'calories' :
    {'unit': 'calories',
     'meal' :
       {'type': 'range',
       'lower' : '1500',
       'upper': '1800'},
    'daily total' : '1800'}
    },

# DG 17
# low carbohydrate eating plans = carbs are 45% of calories (S1), or 20% of the diet (S2)
'DG17': {'carbohydrates':
      {'percentage': 'calories',
      'multiplier': 4,
      'type': 'range',
      'meal': {
          'lower': '0',
          'upper': '45'}
      }
  },

# DG 25
'DG25': {'total fat':
      {'percentage': 'calories',
      'multiplier': 9,
      'type': 'range',
      'meal': {
          'lower': '20',
          'upper': '35'}
      }
  },

# DG 29
'DG29': {'refined carbohydrates' :
    {'unit': 'g',
     'meal' :
       {'type': 'range',
       'lower' : '0',
       'upper': '0'},
    'daily total' : '0'}
    }
}