BUFFALO, N.Y. -- Pain management specialist Dr. Eugene Gosy can resume seeing patients at his Williamsville practice after a bail hearing Monday in federal court.

Magistrate Judge Kenneth Schroeder said something had to be done to address the possibility that thousands of pain management patients in Western New York could suffer if Gosy couldn't be more involved in their treatment. 

"He recognized an unprecedented danger that this community would face if Dr. Gosy's office had to close, and he gave us the green light to make every effort to keep this office open," said Joel Daniels, Gosy's attorney.

Gosy is facing 114 counts of illegally prescribing controlled substances, and hasn't seen patients since he was charged in late April.

Since then, his practice closed for two weeks, and even with the help of three other physicians, Gosy's attorney said the practice couldn't keep up with patients' needs, so he asked the court to allow Gosy to return to work. 

"This motion was made at the urging of the doctors who've been providing oversight monitoring, and in so many words they said that without Dr. Gosy there, without his unique skills and experience this practice will close," said Daniels.

Schroeder decided to allow Gosy to recommend treatment, including medication, to qualified physicians monitoring his practice; and those doctors will have the final say.

"In actuality, there was really no modification in so much that we always stated that at no time during the detention hearing or afterwards did the government require or request that the defendant completely stop the practice of medicine," said Assistant U.S. Attorney George Burgasser. "The only thing he was prohibited from doing was prescribing controlled substances."

Burgasser said the U.S Attorney's Office was concerned Gosy would be given more control, and essentially have other doctors writing prescriptions for him, but now, his office has more oversight of Gosy's practice. 

"We are now allowed to actually go to the practice and we can now monitor what's actually occurring which is more than what the government had prior to these bail conditions were allegedly modified today," said Burgasser.

The judge's condition for expanding Gosy's involvement is that other physicians are available to monitor his practice. He added that both sides should have considered the fallout before opening this Pandora's Box.