A system and method for monitoring and treating diabetic patients are provided. The system can be used to treat type I & II diabetes. The system includes a continuous glucose monitoring device for measuring glucose concentration in patient. The measured glucose concentration and a set of parameters are provided to a processor. The processor further includes a glucose-insulin-glucagon soft sensor, a soft sensor calibration module and a control module to generate a patient parameters. The soft sensor incorporates a physiologically based pharmacokinetics and pharmacodynamics model which takes into account effects of meal, physical activity, and medications on blood glucose. These parameters are used to control the operation of a glucagon insulin delivery pump specific to the patient. An embodiment of the invention also provides a method to treat the diabetic patient. Another embodiment also provides a method to recalibrate the system in order to enhance accuracy of the system.