A device for preventing hypoglycemia comprising: at least one module adapted for receiving a target blood glucose level corresponding to a desired level of glucose in a patient's body during a predetermined period; at least one module adapted for receiving a beginning blood glucose level corresponding to the level of glucose in the patient's body substantially at the beginning of the predetermined period; at least one module adapted for receiving a first set of parameters comprising the patient's insulin sensitivity, the patient's carbohydrate to insulin ratio and the patient's residual insulin, said RI corresponding to the level of residual insulin in the patient's body substantially at the beginning of the predetermined period; at least one module adapted for determining a therapeutic course of action based on the levels of the TBG, BBG and the first set of parameters; and, at least one module adapted for administering the therapeutic course of action to the patient, characterized in that the predetermined period is a fasting time period and that the therapeutic course of action includes: (a) advising the patient to consume a calculated amount of carbohydrates, with the calculated amount of carbohydrates being calculated in one of the following ways: (i) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG>TBG and RI>(BBG-TBG)/IS; (ii) CC = (CIR ∗ (TBG-BBG))/IS if BBG<TBG and the RI is substantially negligible; and (iii) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG<TBG and the RI>0; or (b) advising the patient to administer a correction bolus if BBG>TBG and there is either substantially no RI or RI<CB, where CB = (BBG-TBG)/IS - RI. at least one module adapted for receiving a target blood glucose level corresponding to a desired level of glucose in a patient's body during a predetermined period; at least one module adapted for receiving a beginning blood glucose level corresponding to the level of glucose in the patient's body substantially at the beginning of the predetermined period; at least one module adapted for receiving a first set of parameters comprising the patient's insulin sensitivity, the patient's carbohydrate to insulin ratio and the patient's residual insulin, said RI corresponding to the level of residual insulin in the patient's body substantially at the beginning of the predetermined period; at least one module adapted for determining a therapeutic course of action based on the levels of the TBG, BBG and the first set of parameters; and, at least one module adapted for administering the therapeutic course of action to the patient, characterized in that the predetermined period is a fasting time period and that the therapeutic course of action includes: (a) advising the patient to consume a calculated amount of carbohydrates, with the calculated amount of carbohydrates being calculated in one of the following ways: (i) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG>TBG and RI>(BBG-TBG)/IS; (ii) CC = (CIR ∗ (TBG-BBG))/IS if BBG<TBG and the RI is substantially negligible; and (iii) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG<TBG and the RI>0; or (b) advising the patient to administer a correction bolus if BBG>TBG and there is either substantially no RI or RI<CB, where CB = (BBG-TBG)/IS - RI. (a) advising the patient to consume a calculated amount of carbohydrates, with the calculated amount of carbohydrates being calculated in one of the following ways: (i) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG>TBG and RI>(BBG-TBG)/IS; (ii) CC = (CIR ∗ (TBG-BBG))/IS if BBG<TBG and the RI is substantially negligible; and (iii) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG<TBG and the RI>0; or (i) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG>TBG and RI>(BBG-TBG)/IS; (ii) CC = (CIR ∗ (TBG-BBG))/IS if BBG<TBG and the RI is substantially negligible; and (iii) CC = CIR ∗ (RI + ((TBG-BBG)/IS)) if BBG<TBG and the RI>0; or (b) advising the patient to administer a correction bolus if BBG>TBG and there is either substantially no RI or RI<CB, where CB = (BBG-TBG)/IS - RI.