A former Medical University of South Carolina surgical resident is being treated at a state psychiatric hospital after months awaiting care needed to get him well enough for trial in a 3-year-old harassment case.

Circuit Judge Stephanie McDonald initially issued an order in December to place 32-year-old Karl Ehrens in the state Department of Mental Health’s forensic division for up to 60 days in an effort to “attain competence.”

But that program had no openings, leaving Ehrens in limbo for months.

The forensic division is located at the 180-bed G. Werber Bryan Psychiatric Hospital in Columbia, which accepts patients referred by jails and criminal courts throughout the state. The program Ehrens was ordered to attend only has about 30 beds.

DMH Deputy Director and General Counsel Mark Binkley said an expansion is in the works, but the current waiting list for the program stretches for months.

Ehrens is awaiting trial in a first-degree harassment case stemming from accusations that he stalked an 18-year-old woman in 2010 after she rejected his romantic advances.

Ehrens was released on a $40,000 bond in October of that year. But this past July, Ehrens caused a stir by sending odd emails to several people, including court officials, and mailing a box with a dozen Care Bears to the Clerk of Court. After arriving back in town from Massachusetts where he was staying with family, he was taken into custody by a SWAT team working with crisis counselors.

Ehrens later wrote prosecutors indicating that he wanted to call the alleged victim in his case to testify as a witness for the defense. He also told people that he wanted to ask her to marry him, according to sources familiar with the case.

A doctor who evaluated him July 25 determined that he was mentally ill and posed “a substantial risk of physical harm to himself or others,” according to a motion by prosecutors. That prompted McDonald’s initial order to place him in the Columbia facility.

Ehrens’ attorneys, Christopher Adams and Spencer Roddy, argued in a motion filed last month that Ehrens had been waiting more than 160 days in custody to get into the program with no assurances as to when he might be admitted.

They pointed out that the charge Ehrens faces carries a maximum punishment of three years in prison. Given the time he has already spent jailed awaiting trial, he would be immediately eligible for parole if convicted, they stated in their motion.

Ehrens’ attorneys argued that keeping him locked up beyond that date amounted to a violation of his constitutional rights. They asked that the court rescind its order to send Ehrens to Werber Bryan and instead have him quickly re-evaluated to see if he was competent to stand trial.

McDonald, however, put the onus back on the state and ordered the mental health agency to get Ehrens into Werber Bryan earlier this month.

Adams declined to comment on the case when contacted Thursday. Ninth Circuit Solicitor Scarlett Wilson would only say that a trial for Ehrens cannot go forward until the psychiatric evaluation is complete.

Reach Glenn Smith at 937-5556 or Twitter.com/glennsmith5.