Diabetes mellitus type 2 state may occur; however, ketoacidosis is uncommon. Type 2 diabetes primarily occurs as a result of obesity and lack of exercise. Some people are more genetically at risk than others. Type 2 diabetes makes up about 90% of cases of diabetes, with the other 10% due primarily to diabetes mellitus type 1 and gestational diabetes. In diabetes mellitus type 1 there is a lower total level of insulin to control blood glucose, due to an autoimmune induced loss of insulin-producing beta cells in the pancreas. Diagnosis of diabetes is by blood tests such as fasting plasma glucose, oral glucose tolerance
Diabetes mellitus type 2 glargine and detemir are equally safe and effective, and do not appear much better than neutral protamine Hagedorn (NPH) insulin, but as they are significantly more expensive, they are not cost effective as of 2010. In those who are pregnant insulin is generally the treatment of choice. Vitamin D supplementation to people with type 2 diabetes may improve markers of insulin resistance and HbA1c. Weight loss surgery in those who are obese is an effective measure to treat diabetes. Many are able to maintain normal blood sugar levels with little or no medication following surgery and long-term mortality is decreased.