Experts say too many patients are being prescribed opioid painkillers by emergency room doctors, and a program created by Obamacare could be enabling the problem.

A new study released this week found 17 percent of nearly 20,000 patients were discharged from emergency rooms with an opioid prescription. Experts and lawmakers say a push under Obamacare for hospitals to get good patient satisfaction scores is one cause of the problem.

America is in the midst of an opioid "epidemic," according to the Centers for Disease Control and Prevention. Painkillers killed more than 16,000 people in 2013. A huge part of the problem is the prescribing of painkillers, which quadrupled from 1999 to 2013.

Emergency room prescriptions are part of this trend, but data are lacking on the reasons opioids are given out, according to the study published in the Annals of Emergency Medicine.

Patients with back pain got the most opioids, followed by those with abdominal pain. "The majority of prescriptions had small pill counts and almost exclusively immediate-release formulations," according to the study.

Oxycodone, the active ingredient in Oxycontin, was the most prescribed, with 52 percent.

Doctors may feel pressured by hospital administrators to prescribe opioids because it may lead to a better score on a patient satisfaction survey, experts said.

A program created by Obamacare tied extra funding to high scores on the survey.

"Their reimbursement and quality ratings are linked to ways patients rate them on categories," said Dr. Andrew Kolodny, president of the doctor advocacy group Physicians for Responsible Opioid Prescribing.

The survey has three questions about pain, including whether the physician adequately treated pain.

While it sounds like a benign question, "it forces physicians and surgeons to not only ask about pain but be sure they are prescribing appropriate medication," said Dr. David St. Peter, a hospitalist with Saratoga Hospital in New York. St. Peter works to admit patients to the hospital if they need further treatment after the emergency room.

The Centers for Medicare and Medicaid Services recently announced publication of a five-star rating system for hospitals based in part on satisfaction survey scores.

This practice hasn't gone unnoticed by Congress.

Sens. Chuck Grassley, R-Iowa, and Dianne Feinstein, D-Calif., wrote to CMS last year that the surveys could impact opioid prescribing. The senators cited news reports of doctors in South Carolina admitting to prescribing more opioids in response to patient survey scores.

"One hospital with low satisfaction scores even went so far as to offer Vicodin 'goody bags' to patients discharged from its emergency room in an effort to improve its scores," the letter from the senators reads.

Emergency doctors face other challenges.

For instance, opioid addicts will sometimes injure themselves just to get access to a small amount of painkillers, said Kolodny.

It can be hard to tell whether the patient is actually hurt or an opioid addict, said St. Peter, who is also vice president of medical affairs for Pacira Pharmaceuticals, which markets a non-opioid painkiller for surgeries.

He said that state databases that log prescriptions could help. For instance, a patient could get 90 Oxycontins from a primary doctor and arrive in the emergency room asking for painkillers a few days later.

"That is a red flag," he said.

Some emergency room doctors are starting to incorporate addiction treatment into their practice.

For instance, a recent clinical trial involved 329 opioid addicts treated in the emergency room at a teaching hospital from 2009-13. Doctors assigned 215 of the patients to counseling or an intervention group, and the rest prescribed buprenorphine which helps treat opioid addiction.

The group that got buprenorphine was more likely to reduce opioid use than the others, according to the study published last week in the Journal of the American Medical Association.