The study tracked about 375,000 Medicare patients with a similar range of complaints in several thousand hospital emergency rooms from 2008 to 2011, as well as the frequency of opioid prescriptions written by the doctors who treated them.