Example #1
0
        private static string MessageFormater(double rawDosage, double roundedDosage, string originalMessage, InsulinCalculationFactors factors)
        {

            StringBuilder output = new StringBuilder();
            output.AppendFormat("Recieved: {0}", originalMessage);
            output.AppendLine();
            output.AppendFormat("Calculated Dosages:  {0:0.##} rounded: {1:0.0}", rawDosage, roundedDosage);
            output.AppendLine();
            output.AppendFormat("Based on: ICHO {0} Target BS {1} CF {2}", factors.insulinToCarbRatio, factors.targetBloodSugar, factors.correctionFactor);
            return output.ToString();
        }
Example #2
0
 public InsulinCalculationFactors this[DateTime hourIndex]
 {
     get
     {
         var hour = hourIndex.Hour;
         InsulinCalculationFactors rtn = factorsDictionary[MealsEnum.Lunch];
         if (hour > 5 && hour < 10)
         {
             rtn = factorsDictionary[MealsEnum.Breakfast];
         }
         //lunch and dinner are the same, only breakfast differs
         return(rtn);
     }
     set
     {
         throw new NotImplementedException();
     }
 }
Example #3
0
        private static string MessageFormater(double rawDosage, double roundedDosage, string originalMessage, InsulinCalculationFactors factors)
        {
            StringBuilder output = new StringBuilder();

            output.AppendFormat("Recieved: {0}", originalMessage);
            output.AppendLine();
            output.AppendFormat("Calculated Dosages:  {0:0.##} rounded: {1:0.0}", rawDosage, roundedDosage);
            output.AppendLine();
            output.AppendFormat("Based on: ICHO {0} Target BS {1} CF {2}", factors.insulinToCarbRatio, factors.targetBloodSugar, factors.correctionFactor);
            return(output.ToString());
        }