The headlines from the opioid epidemic seem to be all about overdoses in public parks, homes, and elsewhere in the community. But the drugs can cause problems even in a setting where patients are under the direct care of doctors and nurses: the hospital.

That's the finding of a new report issued Monday by ECRI Institute, a medical research organization in Plymouth Meeting.

Analysts identified 7,218 adverse events involving the use of opioids at 215 hospitals around the country from January 2014 through November 2016.

Most of those cases did not involve actual harm to the patient, yet all represented at least a potential risk, the authors said.

Incidents ranged from the minor, such as a mislabeled dose that was caught in time by a nurse, to the worst-case scenario. The authors identified 12 near-death events caused by opioids and at least two deaths.

Opioids also may have played a role in a handful of additional deaths where a cause was not identified, such as one described in the report by an unidentified hospital official:

Deviation from dosage for hydromorphone. The event reached the patient; the patient died after the medication was administered. Referred for peer review.

Philly region's drug deaths are soaring faster than ever, new data show

The incident reports were submitted voluntarily by hospitals and likely do not reflect the true scope of the problem, said William M. Marella, one of the report authors.

"These are the tip of the iceberg," said Marella, an executive director of ECRI's patient-safety organization. "These are just the reports that people told us about."

The goal of the report authors was to get a sense of "failure modes" through which the problems arise so they can be addressed, he said.

Among the most common trouble spots:

Administration. These events included cases in which patients were given the wrong type of medication, such as a fast-release drug when the slow-release version was indicated. They also included events with the wrong frequency or dose of a drug, incorrect or omitted documentation, administration of opioids without an order, or inadequate patient assessment at administration.

Diversion. These cases include those in which opioids were "unsecured" or where the amount on the shelf did not match records. They also included removal of opioids without documentation that were given to a patient and the failure to account for disposal of leftover drugs.

Prescribing. Problems included prescribing more than one drug at a time or the wrong dose of a drug, and filling duplicate orders of drugs.

Among the other sources of problems was inadequate monitoring, said Josi Wergin, a risk-management analyst and one of the report authors.

In one such case, an emergency-room patient was given intravenous hydromorphone and then was discharged 23 minutes later, even though the hospital's protocol called for waiting 30 minutes. The patient fell while walking out of the waiting room, Wergin said.

The report authors offered a variety of solutions, some of which already have been implemented in hospitals. They included forming an interdisciplinary team to establish protocols and monitor compliance, and to seek "buy-in" from all levels of leadership and staff.

Patients also can help in several ways, Wergin said.

They should tell their providers the names of any medications they are taking and also disclose any health problems — especially sleep apnea and liver or kidney problems, all of which can put a patient at risk of complications when taking opioids.

Another option: Patients can ask if there are alternatives to the drugs — such as Tylenol — or even request earplugs, which can help a patient sleep, which may mean they better cope with pain, Wergin said.

And if patients are not in great pain, they can decline to take drugs entirely, Wergin said.

The analyst had such an experience when she went to the hospital to get a medical implant. She was given opioids before the procedure but declined them afterward, drawing surprise from the nurses.

"I like to know what's going on with my body," she said. "And they looked at me like,'You should be in more pain. Why are you not taking the pain medication?' "

In her case, it was a good move. Wergin noticed something felt amiss with her implant, a sensation that she said would not have been apparent had she been on pain medication. When she told her clinicians, they examined her and determined that, indeed, the implant needed to be adjusted, she said.

"I'm not saying patients should be feeling pain in the hospital," Wergin said. "The important part of the story is that patients have preferences about pain."