With much of the United States outraged over the National Security Agency’s collection of citizens’ cellphone information, it may come as some relief that a federal judge in Portland, Ore., has denied the U.S. Drug Enforcement Administration (DEA) the right to access the state’s prescription drug monitoring program without a warrant.

Prescription drug monitoring programs are tasked with collecting, monitoring, and analyzing “electronically transmitted prescribing and dispensing data submitted by pharmacies and dispensing practitioners,” according to the Alliance of States with Prescription Monitoring Programs. In doing this, many of them are able to see if drugs are being abused or sold, and formulate methods for prevention, while maintaining anonymity.

But the DEA sought to use these records for their drug investigations, citing their right to see the information through a federal law known as an administrative subpoena, which doesn’t require the government to show probable cause or a judge’s involvement. Specifically, they issued the subpoena to obtain prescription records of a patient, which was then followed by another one six days later asking for a summary of drugs prescribed by two doctors.

They were met with a lawsuit from four patients and a physician, as well as the American Civil Liberties Union (ACLU). U.S. District Judge Ancer Haggerty ruled in their favor, writing in a 16-page opinion: “Although there is not an absolute right to privacy in prescription information, as patients must expect that physicians, pharmacists, and other medical personnel can and must access their records, it is more than reasonable for patients to believe that law enforcement agencies will not have unfettered access to their records. …The prescription information maintained by (Oregon) is intensely private as it connects a person’s identity information with the prescription drugs they use,” according to The Associated Press.

Prescription drug overdoses are one of the most pressing drug problems in the U.S. today. About 100 people die from overdoses every day, with rates more than tripling since 1990. The most common cause being opioid painkillers like OxyContin and Vicodin, according to the Centers for Disease Control and Prevention (CDC). So, although the DEA made an effort to put a stop to this, Haggerty clearly saw that gaining access to these records was overstepping their boundaries — the DEA has no involvement with the administration of any of these programs. “The court rightly rejected the government’s extreme argument that patients give up their privacy rights by receiving medical treatment from doctors and pharmacists,” ACLU attorney Nathan Freed Wessler said in a statement, according to the AP.

Drug monitoring programs are already tasked with seeing who is prescribed a drug and how often, as well as who is prescribing the drug and whether it’s necessary. An October report from the Trust for America’s Health, however, found that while 49 states have these programs, problems with funding, use, and capability vary so much that their effectiveness is questionable — only 16 states require medical providers to use them, for example. Perhaps, boosting efficiency is one part of the solution to curbing prescription drug abuse.