A homeless man accused of killing, raping and robbing a pregnant doctor at Bellevue Hospital had tried to have himself committed to the hospital's psychiatric ward last summer but was turned away, officials say.

The hospital's staff advised Steven Smith to go to a clinic because his case wasn't serious enough, said Bellevue spokesman James Walsh.Smith pleaded not guilty Tuesday to rape, robbery and two counts of murder in the slaying of Dr. Kathryn Hinnant, 33, whose body was found in her office Sunday morning.

Smith had been secretly living in an equipment room on the 22nd floor of the hospital since last month, police said. He had apparently moved freely throughout the 25-story building, often wearing stolen hospital staff clothing, investigators said.