A D.C. Superior Court judge yesterday ordered city officials to have four elderly residents of an unlicensed nursing home examined by doctors.

Judge Dyer J. Taylor ordered the tests after attorneys for the city sought a temporary restraining order to close the home at 4903 Illinois Ave. NW where a man died of chronic diabetes three months ago.

Taylor told the city to have the doctors report back to him at 10 a.m. today, but also said the four persons could only be examined with their permission.

City attorneys, who are trying to remove the four patients, ranging in age from 67 to 98, said in a hearing yesterday that the home is "in an unsanitary and unsafe condition" and that the patients need "immediate medical and other care which they are not receiving." The attorneys said the home is operating illegally.

The home's operator, Lucille Johnson, testified yesterday that the patients are taken to see doctors regularly by their families. She also denied that she was operating illegally. "I don't feel that I'm in violation because there are 300 homes and they have no license." She said she had tried to apply for a license last year, but had been told by licensing officials that they were not issuing them.

Sylvester Williams, 64, died at the home Dec. 2 from lack of insulin he needed to treat his diabetic condition, according to the District's chief medical examiner. Williams' chronic diabetes left him in a state of "severe dehydration and malnutrition," the medical examiner said.

During yesterday's hearing, Taylor first proposed that the patients remain in the home until a further hearing could be held next Wednesday on the city's request to close the home.

But assistant Corporation Counsel John Clifford vigorously opposed the judge's proposal, arguing that "it would be impossible for the District to move in as a watchdog to take care of the patients on the site" because the house lacked sufficient hot water and clean linen to "properly maintain the health and safety of the patients."

"They can walk and feed themselves and bathe themselves and they all weigh over 140 pounds," Johnson told the court in her defense.

Robert Sauls, director of licensing for private care homes for the D.C. Department of Human Resources, has said his office lacks the staff needed to eforce a 1977 law that requires inspection and licenses for homes in which one or more persons are cared for by someone other than a relative.

Earlier this week, District officials inspected the Johnson home. The search warrant was obtained because Johnson barred inspectors from the home since June 20, officials said.

One of the inspectors who visited the home last June was Effi Barry, wife of now-Mayor Marion Barry. She was an investigator with the Environmental Health Administration.

In an affidavit supporting the search warrant, Barry said she had found so much dirt, grease, grime and roaches and rodents in the kitchen that it was "imminently dangerous to the health of the residents and [Barry] served upon Ms. Johnson a notice to discontinue all food service and preparation."