diff --git a/heval/__main__.py b/heval/__main__.py index c2c9f3b..824fbf6 100755 --- a/heval/__main__.py +++ b/heval/__main__.py @@ -419,11 +419,11 @@ def __init__(self, parent, human_model): self.TxtView = TextView(self) self.TxtView.pack(expand=True, fill=BOTH) - self.TxtView.set_text( - "Got lost? Select \"Help\" in menu, or just press F1 key.\n\n" - "Не знаете с чего начать? Выберите \"Help\" в меню, чтобы " - "вызвать краткую справку на русском языке. Или просто " - "нажмите клавишу F1.") + self.TxtView.set_text(textwrap.dedent("""\ + Just set sex and height - that's enough. Select \"Help\" in menu, or press F1 key. + + Не знаете с чего начать? Выберите \"Help\" в меню, чтобы вызвать краткую справку на русском языке. Или просто нажмите клавишу F1. + """)) def eval(self, event=None): """Calculate and print some evaluated data.""" @@ -543,11 +543,13 @@ def __init__(self, parent, human_model): self.set_input_protein_defaults() self.set_nutr_gui_state() self.TxtView.set_text(textwrap.dedent("""\ - Dosage of nutrition mixtures can be estimated in two ways: - * Daily caloric goal by weight (kcal/kg/24h) - * Daily protein goal by urine nitrogen loss (mmol/24h) or expected protein demand (g/kg/24h) + Just set sex and height - that's enough. + + Nutrition mixtures dosage can be estimated in two ways: + * As daily caloric goal by weight (kcal/kg/24h) + * As daily protein goal by urine nitrogen loss (mmol/24h) or expected protein demand (g/kg/24h) - Heval will suggest additional fluid if nutrition mixture doesn't contain 24h volume. + Heval will suggest additional fluid if nutrition mixture doesn't contain full 24h volume. """)) def set_input_fluid_defaults(self, event=None): diff --git a/heval/human.py b/heval/human.py index 15d0eaf..f256ae5 100644 --- a/heval/human.py +++ b/heval/human.py @@ -763,26 +763,28 @@ def parcland_volume(weight, burned_surface): return volume_ml -def fluid_req_holidaysegar_mod(rbm): +def fluid_req_holidaysegar_mod(rbw): """Daily fluid requirement for children. Looks like Holliday-Segar method, but modified for infants with body weight <3 kg. References ---------- - The maintenance need for water in parenteral fluid therapy, Pediatrics 1957. Holliday Segar - Курек 2013, стр. 121 или 418. По идее, дложен соответствовать таблице с 121, но для >20 кг это не так. + [1] The maintenance need for water in parenteral fluid therapy, Pediatrics 1957. Holliday Segar + https://www.ncbi.nlm.nih.gov/pubmed/13431307 - :param float rbm: Real body mass, kg + [2] Курек 2013, стр. 121 или 418. По идее, дложен соответствовать таблице с 121, но для >20 кг это не так. + + :param float rbw: Real body mass, kg """ - if rbm < 2: # Kurek modification? - return 150 * rbm - elif 2 <= rbm < 10: # 100 ml/kg for the 1st 10 kg of wt - return 100 * rbm - elif 10 <= rbm < 20: # 50 ml/kg for the 2nd 10 kg of wt - return 1000 + 50 * (rbm - 10) + if rbw < 2: # Kurek modification? + return 150 * rbw + elif 2 <= rbw < 10: # 100 ml/kg for the 1st 10 kg of wt + return 100 * rbw + elif 10 <= rbw < 20: # 50 ml/kg for the 2nd 10 kg of wt + return 1000 + 50 * (rbw - 10) else: # 20 kg and up - return 1500 + 20 * (rbm - 20) + return 1500 + 20 * (rbw - 20) def wetflag(age=None, weight=None): diff --git a/heval/nutrition.py b/heval/nutrition.py index 4e19b5a..f533081 100644 --- a/heval/nutrition.py +++ b/heval/nutrition.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +""" +Heval autimatically estimates required kcal and fluid volume by RBW. +User can switch from default kcal estimation to protein estimation +(measured nitrogen balance). + +Heval will calculate additional fluid to calculated nitrotional mixture to fit daily requirement. + +There is no evidence-based gold standard in quality and quantity of +nutrition composition. Pre-made commercial mixtures considered as +containing all required components in suitable propotions. +End user shouldn't mess with protein/nonprotein caloric proportions, +gucose/fat caloric proportions, add unsaturated fatty acids etc. +""" + """Nutriflex 48/150 lipid https://www.rlsnet.ru/tn_index_id_36361.htm рН 5,0-6,0 @@ -161,6 +176,9 @@ class HumanNutritionModel(object): + """ + ESPEN https://www.ncbi.nlm.nih.gov/pubmed/19464090 + """ def __init__(self, human_model): super(HumanNutritionModel, self).__init__() self.human_model = human_model @@ -208,7 +226,7 @@ def describe_nutrition(self, by_protein=False): 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) + 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) @@ -225,7 +243,7 @@ def describe_nutrition(self, by_protein=False): info += "Total parenteral nutrition\n--------------------------\n" if self.human_model.debug: info += "Parenteral mixtures contains proteins, fat, glucose and minimal electrolytes to not strain the vein. Add vitamins, fluid, electrolytes to meet daily requirement (total parenteral nutrition criteria).\n" - NForm = NutritionFormula(parenteral_nutriflex_48_150, self) + 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) @@ -240,7 +258,7 @@ def describe_nutrition(self, by_protein=False): info += "Partial periferal + enteral nutrition\n-------------------------------------\n" if self.human_model.debug: info += "Using periferal vein is possible for <900 mOsm/kg mixtures, but needs simultanious enteral feeding to meet daily requirement.\n" - NForm = NutritionFormula(parenteral_kabiven_perif, self) + 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) @@ -259,20 +277,22 @@ def describe_nitrogen_balance(self): class NutritionFormula(object): - def __init__(self, preparation, parent): + """Calculate pre-made mixture volume by protein or caloric demand. + """ + def __init__(self, preparation, human_model): """ :param dict preparation: Specific dict with an nutrition preparation. - :param class parent: HumanModel class instance. + :param class human_model: HumanModel class instance. """ - self.parent = parent + self.human_model = human_model for k, v in preparation.items(): setattr(self, k, v) def __str__(self): return self.name - def estimete_calories(self): - """Test caloric content. + def theoretical_kcal(self): + """Test caloric content. Use if not provides by manufacturer specification. """ prt = 4 # 4.1 lip = 9 @@ -286,6 +306,13 @@ def estimete_calories(self): info += "Manufacturer states: {:.1f} kcal/ml".format(self.c_kcal) return info + # def theoretical_osmolality(self): + # """Returns garbage, because electrolytes not included. + + # :return: Theoretical osmolality, mOsm/kg + # """ + # return self.c_glu * 5000 + self.c_prt * 10000 + def dose_by_kcal(self, kcal_24h): """Dose by non-protein kcal_24h. @@ -312,11 +339,11 @@ def dose_max_ml(self): Nutriflex 48/150. """ - if self.parent.human_model.sex in ('male', 'female'): # 2-5 years and adults, + 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 - elif self.parent.human_model.sex == 'child': # 5-14 years + elif self.human_model.sex == 'child': # 5-14 years daily_volume = 25 # Top ml/kg/24h - return self.parent.human_model.weight * daily_volume + return self.human_model.weight * daily_volume def dose_max_kcal(self): """How many kcal provides maximal daily dose. @@ -328,16 +355,15 @@ def describe_dose(self, vol_24h): :param float vol_24h: Dose, ml """ - weight = self.parent.human_model.weight kcal_24h = vol_24h * self.c_kcal info = "" if self.type == 'parenteral': rate_1h = vol_24h / 24 - top_rate_1h = self.max_1h_rate * weight + top_rate_1h = self.max_1h_rate * self.human_model.weight info += "Daily dose {:.0f} ml/24h ({:.0f} kcal/24h) at rate {:.0f}-{:.0f} ml/h:\n".format(vol_24h, kcal_24h, rate_1h, top_rate_1h) - info += " * Proteins {:>5.1f} g/24h ({:>4.2f}-{:>4.2f} g/kg/h)\n".format(self.c_prt * vol_24h, self.c_prt * rate_1h / weight, self.c_prt * top_rate_1h / weight) - info += " * Lipids {:>5.1f} g/24h ({:>4.2f}-{:>4.2f} g/kg/h)\n".format(self.c_lip * vol_24h, self.c_lip * rate_1h / weight, self.c_lip * top_rate_1h / weight) - info += " * Glusose {:>5.1f} g/24h ({:>4.2f}-{:>4.2f} g/kg/h)\n".format(self.c_glu * vol_24h, self.c_glu * rate_1h / weight, self.c_glu * top_rate_1h / weight) + info += " * Proteins {:>5.1f} g/24h ({:>4.2f}-{:>4.2f} g/kg/h)\n".format(self.c_prt * vol_24h, self.c_prt * rate_1h / self.human_model.weight, self.c_prt * top_rate_1h / self.human_model.weight) + info += " * Lipids {:>5.1f} g/24h ({:>4.2f}-{:>4.2f} g/kg/h)\n".format(self.c_lip * vol_24h, self.c_lip * rate_1h / self.human_model.weight, self.c_lip * top_rate_1h / self.human_model.weight) + info += " * Glusose {:>5.1f} g/24h ({:>4.2f}-{:>4.2f} g/kg/h)\n".format(self.c_glu * vol_24h, self.c_glu * rate_1h / self.human_model.weight, self.c_glu * top_rate_1h / self.human_model.weight) else: info += "Daily dose {:.0f} ml/24h ({:.0f} kcal/24h)\n".format(vol_24h, kcal_24h) info += " * Proteins {:>5.1f} g/24h\n".format(self.c_prt * vol_24h)