A despondent man who said he had AIDS took up to four people hostage at a hospital Saturday and then shot himself to death. A short time later, one policeman accidentally shot another while looking for the gunman.

The wounded officer, identified as Jose Rodriguez, 32, was in satisfactory condition after being hit in the shoulder by a bullet fired by an officer who encountered him in a stairwell at St. Luke's-Roosevelt Hospital Center.Police converged on the hospital about 1 a.m. after 39-year-old Richard Carr of Manhattan entered the emergency room and demanded to be readmitted, First Deputy Police Commissioner Richard Condon said.

Carr had discharged himself from the hospital on Friday against the advice of doctors, who would not say why he had been in the hospital, Condon said.