Skip to content

Commit

Permalink
Nutrition dose per kcal and per protein demand
Browse files Browse the repository at this point in the history
  • Loading branch information
radioxoma committed Feb 17, 2020
1 parent 31788f3 commit 72ba9f9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion heval/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def eval(self, event=None):
if self.var_rbtm_calc_method.get() == 0: # By kcal
info += "{}\n".format(self.human_model.nutrition.describe_nutrition())
elif self.var_rbtm_calc_method.get() == 1: # By UUN
info += "{}\n".format(self.human_model.nutrition.describe_nitrogen_balance())
info += "{}\n".format(self.human_model.nutrition.describe_nutrition(by_protein=True))
self.TxtView.set_text(info)


Expand Down
41 changes: 22 additions & 19 deletions heval/nutrition.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
gucose/fat caloric proportions, add unsaturated fatty acids etc.
"""

import textwrap

"""Nutriflex 48/150 lipid https://www.rlsnet.ru/tn_index_id_36361.htm
рН 5,0-6,0
Expand Down Expand Up @@ -185,7 +187,16 @@ def __init__(self, human_model):
self.fluid_multipler = 30 # ml/kg RBW
self.kcal_multipler = 25 # ml/kg RBW
self.uurea = None # Total urine urea, mmol
# self.protein_24h = 1.5 * self.human_model.weight
# self.protein_24h = None # 1.5 * self.human_model.weight

def __str__(self):
return textwrap.dedent("""\
Generic approximation by body mass
==================================
Start point:
* Fluid demand {:.0f} ml/24h ({:.0f} ml/kg/24h)
* Energy demand {:.0f} kcal/24h ({:.0f} kcal/kg/24h)""".format(
self.fluid_24h, self.fluid_multipler, self.kcal_24h, self.kcal_multipler))

@property
def fluid_24h(self):
Expand Down Expand Up @@ -218,18 +229,17 @@ def uurea_prot_24h_reverse(self, protein_req):
def describe_nutrition(self, by_protein=False):
"""Trying to find a compromise between fluids, electrolytes and energy.
"""

info = "Generic approximation by body mass\n==================================\n"
info += "Start point:\n * Fluid demand {:.0f} ml/24h ({:.0f} ml/kg/24h)\n * Energy demand {:.0f} kcal/24h ({:.0f} kcal/kg/24h)\n\n".format(self.fluid_24h, self.fluid_multipler, self.kcal_24h, self.kcal_multipler)

info = ""
if self.human_model.debug:
info += "{}\n".format(self.describe_nitrogen_balance())
# Total enteral nutrition
info += "Enteral nutrition\n-----------------\n"
if self.human_model.debug:
info += "Always prefer enteral nutrition. Enteral mixtures contains proteins, fat, glucose. Plus vitamins and electrolytes - all that human craves. For an adult give 1500-2000 kcal, add water to meet daily requirements and call it a day.\n"
NForm = NutritionFormula(enteral_nutricomp_standard, self.human_model)
info += "{}\n".format(str(NForm))
if by_protein:
full_enteral_nutrition = NForm.dose_by_protein(self.kcal_24h)
full_enteral_nutrition = NForm.dose_by_protein(self.uurea_prot_24h)
else:
full_enteral_nutrition = NForm.dose_by_kcal(self.kcal_24h)
full_enteral_fluid = self.fluid_24h - full_enteral_nutrition
Expand All @@ -246,7 +256,7 @@ def describe_nutrition(self, by_protein=False):
NForm = NutritionFormula(parenteral_nutriflex_48_150, self.human_model)
info += "{}\n".format(str(NForm))
if by_protein:
full_parenteral_nutrition = NForm.dose_by_protein(self.kcal_24h)
full_parenteral_nutrition = NForm.dose_by_protein(self.uurea_prot_24h)
else:
full_parenteral_nutrition = NForm.dose_by_kcal(self.kcal_24h)
full_parenteral_fluid = self.fluid_24h - full_parenteral_nutrition
Expand All @@ -261,7 +271,7 @@ def describe_nutrition(self, by_protein=False):
NForm = NutritionFormula(parenteral_kabiven_perif, self.human_model)
info += "{}\n".format(str(NForm))
if by_protein:
full_parenteral_nutrition = NForm.dose_by_protein(self.kcal_24h)
full_parenteral_nutrition = NForm.dose_by_protein(self.uurea_prot_24h)
else:
full_parenteral_nutrition = NForm.dose_by_kcal(self.kcal_24h)
full_parenteral_fluid = self.fluid_24h - full_parenteral_nutrition
Expand Down Expand Up @@ -320,24 +330,17 @@ def dose_by_kcal(self, kcal_24h):
"""
return kcal_24h / self.c_kcal

# def dose_by_kcal_total(self, kcal_24h):
# """Dose by non-protein kcal_24h.
# """
# return kcal_24h / self.c_kcal

def dose_by_protein(self, protein_24h):
"""Dose by required protein in 24 h.
Mathod can returm volume exceeding maximal recommended daily dose.
protein, g
:param float protein_24h: Required protein for 24h, grams
"""
return protein_24h / self.c_prt

def dose_max_ml(self):
"""Maximal 24h parenteral nutrition volume, recommended by manufacturer.
Nutriflex 48/150.
"""Maximal recommended by manufacturer dose per 24 hours.
"""
if self.human_model.sex in ('male', 'female'): # 2-5 years and adults,
daily_volume = 40 # Top ml/kg/24h, same as 40 kcal/kg/24h
Expand All @@ -346,10 +349,10 @@ def dose_max_ml(self):
return self.human_model.weight * daily_volume

def dose_max_kcal(self):
"""How many kcal provides maximal daily dose.
"""Maximal recommended by manufacturer dose per 24 hours.
"""
return self.dose_max_ml() * self.c_kcal

def describe_dose(self, vol_24h):
"""Info about given volime content.
Expand Down

0 comments on commit 72ba9f9

Please sign in to comment.