HARRISBURG, Pa. (AP) — An opioid overdose antidote spray was not in stock in most Philadelphia pharmacies during a 2017 survey, and the shortage was greatest in predominantly minority neighborhoods and areas with the most fatal opioid overdoses, according to a study released Friday.

The research published in JAMA Network Open found that naloxone was available in about a third of pharmacies and that a prescription was often required.

Pennsylvania established a statewide standing order in 2015 that allows anyone to obtain naloxone without a prescription.

“Despite the widespread implementation of naloxone access laws and important role of naloxone in preventing potentially fatal opioid overdoses, many barriers to its distribution and use remain,” researchers wrote. “Such barriers are particularly important in communities that have been especially affected by the epidemic and experience high overdose rates, including in Philadelphia.”

Researchers from the University of Illinois at Chicago said many communities are at risk because access to the drug remains a work in progress.

Chain pharmacies were more likely than independent stores to have the drug in stock.

Researchers called 418 pharmacies over six months in 2017, posing as customers. The median out-of-pocket cost without a prescription was $145, and the cost was highest in independent pharmacies and neighborhoods with elevated rates of opioid overdoses.

They examined only the availability of naloxone in spray form because it is widely used and considered to be the most convenient option, particularly for the average person. That could have led to an underestimation of naloxone’s availability, they said.

The head of the state pharmacists’ trade group, which consists largely of independent druggists, said one factor may be the high cost of a medication that can expire on the store shelf. Many pharmacies that did not have naloxone in stock offered to order it, the survey said.

Pat Eppel, the Pennsylvania Pharmacists Association’s chief executive, said the group encourages members to stock and provide naloxone and has provided training.

“If they don’t know about the standing order, then shame on them,” Eppel said. “I’m flabbergasted that the report is as high as it is.”

Since the study was completed, Philadelphia has enacted a city ordinance that requires all pharmacies to have the drug in stock or face a potential $250-a-day fine.

“Now the question is, will the city enforce the law?” said Jenny Guadamuz, a doctoral student involved in the study.

Mayoral spokesman Mike Dunn said Friday that Philadelphia does plan to follow up with pharmacies this summer to check compliance and see if more education is needed.

Philadelphia officials said a 2016 study found 40 percent of pharmacies in areas with the highest rates of heroin possession and distribution stocked naloxone, and fewer than half of surveyed pharmacists knew about the standing order. Pharmacy students also canvassed 85 pharmacies in 2017 to educate pharmacists and encourage them to stock naloxone.

Dunn said the city again checked with pharmacies early last year and found about 75 percent had naloxone in hand.

Ray Barishansky, a deputy health secretary who heads the state’s opioid command center, said the report showed a need to increase awareness of the standing order within pharmacies.

“I don’t think that there’s an easy fix on it, but it is an area we are going to dig in on and concentrate on,” Barishansky said.

Barishansky said the state has worked with Philadelphia to get naloxone into some of the city’s hardest-hit areas.