A new study from the University of Southern California showed that opioid prescriptions very rarely come from emergency rooms, but are almost entirely written in doctor’s offices.

The study published Tuesday comes amidst a national opioid crisis in which lawmakers are looking for ways to curb opioid abuse.

The study, published in the medical journal Annals of Emergency Medicine, showed that between 1996 and 2012, opioid prescriptions written in a physician’s office increased from 71 percent to 83 percent for all prescriptions written. Opioid prescriptions written in the emergency room decreased from 7.4 percent to 4.4 percent.

“One hypothesis has been that the emergency room is a recurrent site of care and that patients could be going from emergency room to emergency room to obtain multiple prescriptions to support their addiction,” said Sarah Axeen, an assistant professor of emergency medicine who led the study in a statement. “But our analysis shows that emergency rooms account for a very small share of all prescribed opioids. In fact, doctor's offices are the source of many more of these drugs.”

The study also showed that high-risk opioid users, the ones who consume the most drugs, get 87.8 percent of their drugs from doctor’s offices.

Michael Menchine, an associate professor of clinical emergency medicine who co-authored the study, said it holds a mirror up to doctors.

“From the 1990s to at least 2013, we had convinced ourselves that prescribing opioids was a fine thing to do" for patients in chronic pain,” said Menchine in a statement. “It is hard to look in the mirror years later and say 2 million people might be dependent on opioids because of this sort of practice.”

42,000 people died in the U.S. last year from opioid abuse, according to the Centers for Disease Control and Prevention and at least 40 percent of them involved prescription drugs — often more than one. As the U.S. grapples with the opioid epidemic researchers suggest that regulators focus on doctor’s offices and not the already highly regulated emergency rooms.

“We are not saying these policies are bad,” said study coauthor Seth Seabury in a statement. “What our findings suggest is that they should really be focusing these policies on other places in the system.”