Diabetes management goal of diabetes care, although recent research suggests that the complications of diabetes may be caused by genetic factors or, in type 1 diabetics, by the continuing effects of the autoimmune disease which first caused the pancreas to lose its insulin-producing ability. Because blood sugar levels fluctuate throughout the day and glucose records are imperfect indicators of these changes, the percentage of hemoglobin which is glycosylated is used as a proxy measure of long-term glycemic control in research trials and clinical care of people with diabetes. This test, the hemoglobin A1c or glycosylated hemoglobin reflects average glucoses over the preceding
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.