A former Utah nurse who is facing federal charges for allegedly stealing hospital painkillers and exposing patients to hepatitis C narrowly avoided being sent to jail Thursday for violating her pretrial release conditions.

Elet Neilson was allowed to remain free after she was charged in July 2017 with more than a dozen crimes in federal court because she had agreed to a number of conditions set by U.S. Magistrate Judge Paul Warner.

But she admitted Thursday she violated the conditions when she was charged several weeks ago in state court with driving under the influence and electronic harassment. While she did not admit that she was guilty of those charges, she did agree in a federal courtroom Thursday that being charged at all was a violation of her pretrial release.

Warner told Neilson he normally jails any defendant who violates the conditions of their release — and he thinks judges who allow defendants multiple chances when they break the rules “give our system a bad name.”

But he thought about her case a lot, the judge told Neilson, more than he usually does when a violation like this comes before him.

He read the federal indictment, which accuses her of injecting herself with painkillers before administering the drugs to patients in northern Utah hospitals.

He read the recent police reports, which detailed how she allegedly drove drunk on a flat tire in Layton on Nov. 11, days after she was charged with harassing her stepdaughter.

Even as he rode the elevator down to the courtroom Thursday, Warner said he contemplated whether to throw Neilson behind bars.

But he didn’t.

“I am going to be that judge that I so greatly disdain,” he told Neilson.

Instead, the judge gave her more restrictions she must follow until her case goes to trial. Not a drop of alcohol, he told a crying Neilson. No wine, no beer, no Nyquil.

“You will be sober,” he said. “Drug free. Alcohol free.”

She’ll be tested twice a day to make sure she is not drinking, Warner ordered. He also told her she should have no contact with her stepdaughter.

Warner said he only allowed Neilson to remain free in the first place because she had a son with disabilities to care for. It was a decision he said was a “moment of compassion” from him that’s “rarely seen.”

And Thursday’s decision, too, was for her son.

“I’m not doing this for you,” Warner said. “I’m doing this for your son. It’s about time you think about his welfare over your own.”

But the judge warned Neilson that if she messed up again, he won’t hesitate to incarcerate her — even during the holiday season.

“I like to put people in jail for the holidays,” he said. “You know why? Because they typically deserve it.”

Neilson is expected to go to trial in January on eight counts of tampering with a consumer product and another eight counts of fraudulently obtaining a controlled substance. But a prosecutor said Thursday that it’s possible the trial could be delayed because of how complicated the case is.

Prosecutors allege that Neilson, who also goes by the name Elet Hamblin, diverted morphine and the narcotic dilaudid while working as a nurse. As a result, seven people were infected with a rare strain of hepatitis C, which Neilson has, according to charging records.

Health officials believe Neilson may have exposed as many as 7,200 patients to the hepatitis C genotype B strain. Of those patients, roughly 4,800 were treated at Ogden's McKay-Dee Hospital — where Neilson worked from June 2013 to November 2014 — and 2,369 were at Davis Hospital and Medical Center, in Layton, where Neilson worked between 2012 and 2014.

All seven who contracted the disease were treated at McKay-Dee Hospital, according to federal prosecutors.

If convicted as charged, Neilson faces a potential penalty of 20 years in federal prison for each count of tampering, and four years for each charge of obtaining a fraudulent prescription.

Neilson has admitted to taking drugs from her employer while working at both hospitals, according to Utah Division of Occupational and Professional Licensing records. She surrendered her nursing license in November 2015, a month after health officials began offering free testing to the thousands of patients who came into contact with her at the two hospitals and were given certain medications.

This is the first time federal prosecutors in Utah have taken on a case like Neilson’s. Similar cases have been reported nationwide, including a case of a traveling radiology technician who infected 30 people with the virus in a multistate outbreak.