UNC Hospitals is taking part in a study to help doctors determine the best medications for patients with diabetes.