From 43791b795605a255033e0e1eb81c491c79c78148 Mon Sep 17 00:00:00 2001 From: Eugene Dvoretsky Date: Mon, 17 Feb 2020 19:17:37 +0300 Subject: [PATCH] Better docs and labels text --- heval/__main__.py | 18 +++++++++--------- heval/nutrition.py | 23 +++++++++++++---------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/heval/__main__.py b/heval/__main__.py index a194006..d7c26ec 100755 --- a/heval/__main__.py +++ b/heval/__main__.py @@ -463,7 +463,7 @@ def __init__(self, parent, human_model): format='%1.0f', increment=1, command=self.set_model_fluid_multipler) self.ctl_sbx_fluid_mul.bind("", self.set_model_fluid_multipler) self.ctl_sbx_fluid_mul.grid(row=1, column=1) - CreateToolTip(self.ctl_sbx_fluid_mul, "24 hours fluid intake requirement.\nTypical 30-35 ml/kg") + CreateToolTip(self.ctl_sbx_fluid_mul, "24 hours fluid demand.\nTypical 30-35 ml/kg.") Label(fr_fluid_entry, text="ml/24h").grid(row=2, column=0) self.lbl_fluid_24h = Label(fr_fluid_entry) @@ -473,7 +473,7 @@ def __init__(self, parent, human_model): # Label(fr_fluid_entry).grid(row=3, column=1) # Placeholder # Kcal input - self.fr_kcal_entry = LabelFrame(fr_entry, text="By caloric demand") + self.fr_kcal_entry = LabelFrame(fr_entry, text="By calorie demand") self.fr_kcal_entry.pack(side=LEFT, anchor=N, expand=True, fill=BOTH) ctl_btn_kcal = Button(self.fr_kcal_entry, text="Reset", command=self.set_input_kcal_defaults) @@ -484,7 +484,7 @@ def __init__(self, parent, human_model): self.fr_kcal_entry, text=None, variable=self.var_rbtm_calc_method, value=0, command=self.set_nutr_gui_state) ctl_rbtn0_method.grid(row=0, column=1) - CreateToolTip(ctl_rbtn0_method, "Calculate daily nutrition dose by caloric (not protein) requirement") + CreateToolTip(ctl_rbtn0_method, "Calculate daily nutrition dose by calorie (not protein) requirement") Label(self.fr_kcal_entry, text="kcal/kg/24h").grid(row=1, column=0) self.ctl_sbx_kcal_mul = Spinbox( @@ -492,7 +492,7 @@ def __init__(self, parent, human_model): format='%1.0f', increment=1, command=self.set_model_kcal_multipler) self.ctl_sbx_kcal_mul.bind("", self.set_model_kcal_multipler) self.ctl_sbx_kcal_mul.grid(row=1, column=1) - CreateToolTip(self.ctl_sbx_kcal_mul, "24 hours energy intake requirement.\nTypical 25-30 kcal/kg") + CreateToolTip(self.ctl_sbx_kcal_mul, "24 hours energy demand.\nTypical 25-30 kcal/kg.") Label(self.fr_kcal_entry, text="kcal/24h").grid(row=2, column=0) self.lbl_kcal_24h = Label(self.fr_kcal_entry) @@ -515,7 +515,7 @@ def __init__(self, parent, human_model): self.fr_nitrogen_entry, text=None, variable=self.var_rbtm_calc_method, value=1, command=self.set_nutr_gui_state) ctl_rbtn1_method.grid(row=0, column=1) - CreateToolTip(ctl_rbtn1_method, "Calculate daily nutrition dose by measured protein (not caloric) requirement") + CreateToolTip(ctl_rbtn1_method, "Calculate daily nutrition dose by measured protein (not calorie) requirement") Label(self.fr_nitrogen_entry, text="Urine urea, mmol/24h").grid(row=1, column=0) self.ctl_sbx_uurea = Spinbox( @@ -523,7 +523,7 @@ def __init__(self, parent, human_model): format='%.0f', increment=10, command=self.set_model_uurea) self.ctl_sbx_uurea.bind("", self.set_model_uurea) self.ctl_sbx_uurea.grid(row=1, column=1) - CreateToolTip(self.ctl_sbx_uurea, "Total urea in whole 24h urine") + CreateToolTip(self.ctl_sbx_uurea, "Urine urea excreted during 24h (equals to total urea nitrogen, when measured in mmol/24h)") Label(self.fr_nitrogen_entry, text="Protein g/24h").grid(row=2, column=0) self.lbl_prot_24h = Label(self.fr_nitrogen_entry) @@ -550,10 +550,10 @@ def __init__(self, parent, human_model): Just set sex and height. 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) + * As daily calorie goal by weight (kcal/kg/24h) + * As daily protein goal by nitrogen balance (urea nitrogen loss mmol/24h) or expected protein demand (g/kg/24h) which are dependent on each other - Heval will suggest additional fluid if nutrition mixture doesn't contain full 24h volume. + Heval will suggest additional fluid if nutrition mixture doesn't contain full 24h volume. Negative value means fluid excess. """)) def set_input_fluid_defaults(self, event=None): diff --git a/heval/nutrition.py b/heval/nutrition.py index 0ef6ebf..68efdc8 100644 --- a/heval/nutrition.py +++ b/heval/nutrition.py @@ -234,7 +234,8 @@ def describe_nutrition(self, by_protein=False): info += "{}\n".format(self.describe_nitrogen_balance()) # Total enteral nutrition - info += "Enteral nutrition\n-----------------\n" + info += "Enteral nutrition\n" + info += "-----------------\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) @@ -246,14 +247,15 @@ def describe_nutrition(self, by_protein=False): full_enteral_fluid = self.fluid_24h - full_enteral_nutrition info += "Give {:.0f} ml + water {:.0f} ml. ".format(full_enteral_nutrition, full_enteral_fluid) # full_enteral_nutrition and self.fluid_24h in ml, so they reduce each other - info += "Resulting osmolality is {:.1f} mOsm/kg\n".format( + info += "Mixture osmolality is {:.0f} mOsm/kg\n".format( (full_enteral_nutrition * NForm.osmolality) / self.fluid_24h) info += "{}\n".format(NForm.describe_dose(full_enteral_nutrition)) # Total parenteral nutrition - info += "Total parenteral nutrition\n--------------------------\n" + info += "Total parenteral nutrition\n" + info += "--------------------------\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" + info += "Parenteral mixtures contains proteins, fat, glucose and minimal electrolytes to not strain the vein. Add vitamins, fluid, electrolytes to meet daily requirements (total parenteral nutrition criteria).\n" NForm = NutritionFormula(parenteral_nutriflex_48_150, self.human_model) info += "{}\n".format(str(NForm)) if by_protein: @@ -263,14 +265,15 @@ def describe_nutrition(self, by_protein=False): full_parenteral_fluid = self.fluid_24h - full_parenteral_nutrition info += "Give {:.0f} ml + isotonic fluid {:.0f} ml\n".format(full_parenteral_nutrition, full_parenteral_fluid) info += "{}\n".format(NForm.describe_dose(full_parenteral_nutrition)) - if self.kcal_24h > NForm.dose_max_kcal(): - info += "REACHED MAXIMAL RECOMMENDED DOSE. DAILY NUTRITION REQUIREMENT NOT SATISFIED.\n" + if full_parenteral_nutrition > NForm.dose_max_ml(): + info += "REACHED MAXIMAL RECOMMENDED DOSE, BUT DAILY NUTRITION REQUIREMENTS NOT SATISFIED. Consider enteral nutrition, whenever possible.\n" info += "Maximal {}\n".format(NForm.describe_dose(NForm.dose_max_ml())) # Mixed parenteral with enteral - info += "Partial peripheral + enteral nutrition\n-------------------------------------\n" + info += "Total parenteral peripheral nutrition\n" + info += "-------------------------------------\n" if self.human_model.debug: - info += "Using peripheral vein is possible for <900 mOsm/kg mixtures, but needs simultaneous enteral feeding to meet daily requirement. Peripheral nutrition diluted, so additional fluid not required.\n" + info += "Using peripheral vein is possible for <900 mOsm/kg mixtures, but needs simultaneous enteral feeding to meet daily requirements. Peripheral nutrition diluted, so additional fluid not required.\n" NForm = NutritionFormula(parenteral_kabiven_perif, self.human_model) info += "{}\n".format(str(NForm)) if by_protein: @@ -280,8 +283,8 @@ def describe_nutrition(self, by_protein=False): full_parenteral_fluid = self.fluid_24h - full_parenteral_nutrition info += "Give {:.0f} ml + isotonic fluid {:.0f} ml.\n".format(full_parenteral_nutrition, full_parenteral_fluid) info += "{}\n".format(NForm.describe_dose(full_parenteral_nutrition)) - if self.kcal_24h > NForm.dose_max_kcal(): - info += "REACHED MAXIMAL RECOMMENDED DOSE. DAILY NUTRITION REQUIREMENT NOT SATISFIED.\n" + if full_parenteral_nutrition > NForm.dose_max_ml(): + info += "REACHED MAXIMAL RECOMMENDED DOSE, BUT DAILY NUTRITION REQUIREMENTS NOT SATISFIED. Consider enteral nutrition, whenever possible.\n" info += "Maximal {}\n".format(NForm.describe_dose(NForm.dose_max_ml())) return info