In a unanimous ruling, the Arizona Supreme Court said Tucson Medical Center cannot sue CVS over the pharmacy's filling of opioid prescriptions.
The case is part of a larger actionfiled in 2018 by TMC against opioid makers and distributors.
TMC wanted to make CVS at least partially liable for unpaid care for patients with opioid addictions or injuries related to the prescription painkillers.
The justices on the Arizona Supreme Court said state law does not allow the hospital to sue the company. Instead, the justices wrote that it must go after the patients that didn't pay their bills.
"Arizona, however, prohibits assignment of personal injury claims. And TMC cannot circumvent this rule by asserting a direct claim for uncompensated care against a third party it contends cause personal injury to patients," Justice Clint Bolick wrote in the opinion.
TMC said in its filings that CVS should not have prescribed opioids to people who could be addicted to the drugs.
The ruling also said the federal Controlled Substances Act (CSA) and the Arizona Uniform Controlled Substances Act (AUCSA) cannot be used by TMC as a reason the pharmacy chain could be liable.
"The CSA (and the AUCSA be extension) protect 'individual members of the public from falling victim to drug misuse and abuse," Bolick wrote. "But TMC is a hospital. And a hospital cannot suffer from addiction, overdose, and death, and thus does not fall with the class of persons meant to be protected."
The portion of the case against CVS is dismissed by the ruling.