BEVERLY — The woman behind what is believed to be the largest theft of prescription opiates from a health care facility in Massachusetts in at least a decade admitted to a charge of obtaining drugs by fraud on Tuesday. 

But when Lisa Tillman learned the judge wanted to send her to jail, she changed her mind and took it back. 

"It's just very difficult for me to wrap my head around the idea that this was for personal use," Salem District Court Judge Emily Karstetter told Tillman, a former Beverly Hospital pharmacy technician, and her lawyer during a hearing Tuesday morning. "That she would use some of the pills and flush the rest, it's hard for me to believe that." 

The judge said the "most logical or most obvious" inference she can draw is that Tillman intended to sell the pills, though a prosecutor acknowledged that state police failed to turn up evidence of that during their investigation. 

Tillman, 50, of Salem, was charged last fall with stealing approximately 18,000 pills, most of them opiates such as Percocet, OxyContin and the generic versions of those drugs; hydrocodone (generic Vicodin), and six vials of fentanyl, along with the stimulant drug Adderall. 

Earlier this year, state records obtained by the Times' sister newspaper, The Salem News, in response to a public records request showed that the theft was the largest drug diversion by a health care worker in at least a decade; the next largest was a report of 16,000 pills taken by two nurses at Massachusetts General Hospital back in 2013.

Under the law, hospitals and other health care facilities are required to report the theft of all controlled drugs — those that are on a list of medications with a potential for abuse. 

But the newspaper also learned that there is no comprehensive system to track such thefts, making it hard to quantify the extent of the problem. 

Overrode computer

Prosecutors allege — and Tillman admitted to investigators — that she repeatedly overrode the computer that controlled access to medication cabinets at Beverly Hospital and several satellite locations in Danvers, Gloucester and Lynn, to mark medications that were stored inside the cabinet as expired. Then she would remove them. 

Medications marked as expired are supposed to be returned to a hospital safe, so that a distributor can pick them up. Instead, an audit by the hospital discovered that the pills, which were not actually expired, disappeared. 

The Pyxis system, prosecutor Peter Brostowin told the judge, was actually installed to prevent employee medication thefts. But on 79 occasions, some of them when she was not working, Tillman entered Pyxis cabinets and withdrew pills, frequently 120 at a time, said the prosecutor. 

Brostowin said Tillman told state troopers who questioned her last year that she had used some of the pills herself, then flushed the rest. 

Brostowin told the judge that the investigators were "skeptical" — an assessment he shared. 

"This is not a person grabbing a bottle of pills and taking off," said Brostowin, who was urging the judge to impose a guilty finding and at least 18 months in jail. 

"I don't necessarily credit Ms. Tillman's assertion that this was simply her personal addiction," said Brostowin, noting that she had been taking an average of 120 pills at a time. "I don't think that's consistent with personal use." A conservative street value of the drugs, said the prosecutor, is $180,000.

But Tillman's attorney said her client maintains that she accidentally discovered a way to access large amounts of pills by changing the computer to show that the medications had expired. 

Lawyer Meghan Somers Taylor told the judge that Tillman began to take larger quantities than she needed because she wasn't sure when she would again have the ability to get the drugs. 

Taylor said Tillman maintains that she was an addict who began using the medications to help get her through a period of feeling isolated and depressed as a single mother, then weaned herself off the drugs without treatment. 

"She cleaned up on her own," said Taylor. 

"This is an unfortunate situation where she fell into the addiction so many people are dealing with," said Taylor, who was asking the judge to continue the case without a finding because it is believed to be Tillman's first offense. Taylor also told the judge that Tillman had surrendered her pharmacy tech license. 

"I don't think she is somebody who needs to be on a long term of probation," said Taylor, telling the judge that Tillman has passed all of the drug tests she has been required to take while awaiting trial.

She also said Tillman would be willing to take part in a program such as Narcotics Anonymous if given probation in the case. It was not clear whether Tillman has participated in any 12-step or other treatment programs since being charged last year. 

Judge is skeptical

Karstetter, the judge, questioned why Tillman would flush the drugs down the toilet rather than just use them. 

"The most logical or most obvious reason for theft is there was at least some intent to make some money. That seems to me to be the most obvious reason," Karstetter continued. 

"I do think a guilty finding here is appropriate," the judge continued. "It is a felony." 

And the fact that most of the drugs were opiates, the type of drug that has devastated New England, leading to hundreds of overdose deaths, was also a concern to the judge. 

Karstetter said she believes some period of incarceration is necessary. She stopped short of saying how much time she would impose.

"Need I continue?" she asked Taylor, who, after briefly speaking with Tillman, told the judge that Tillman was withdrawing her guilty plea and asking for a trial. That is something that is allowed under Massachusetts law. 

Tillman is due back in court Aug. 13 for a hearing where she will let the court know whether she wants a jury trial or a trial before a judge. The fact that she entered and then withdrew a plea on Tuesday will not be shared with a jury or a judge hearing the case. 

At the end of Tuesday's hearing, Karstetter asked a probation officer whether her department had done an interstate record check on Tillman, a native of Pennsylvania, to see whether she had a criminal record elsewhere. 

When the officer told her that had not been done, the judge ordered her to conduct one. 

Courts reporter Julie Manganis can be reached at 978-338-2521, or on Twitter at @SNJulieManganis.