A doctor who sued Johns Hopkins Hospital for $35 million last June after becoming infected with the AIDS virus while caring for a patient there has agreed to drop his suit.

Attorneys for Dr. Hacib Aoun and the hospital reached a confidential settlement, according to Joann Rodgers, a hospital spokeswoman. Aoun, who had sued the hospital and some Hopkins doctors for libel, slander and breach of confidentiality, has accepted that statements attributed to the doctors were not meant to breach his confidentiality or defame his reputation, according to a joint statement by the hospital and Aoun. Rodgers said all parties had agreed not to disclose details of the settlement.

In his suit, Aoun, 32, alleged that after he informed his superiors that he was infected with the AIDS virus, they revealed his illness to others, breaching his right to confidentiality. He also said in an interview last July that lawyers for the hospital and Johns Hopkins University had implied in letters to his lawyer that he had contracted the disease sexually and suggested he provide a list of his past sexual partners.

"We're happy that it's over because my health hasn't been so great lately," Aoun said yesterday. Aoun, who is married and has a 20-month-old daughter, has AIDS and has been hospitalized at the University of Maryland Hospital four times since September for infections and complications from his treatment. "I had some concerns about not being able to continue the fight if I had to go back into the hospital," he added.

The Venezuela-born cardiologist became infected with the virus while working as a medical resident at Hopkins in 1983, when he accidentally stabbed his finger with a broken glass tube filled with blood from a leukemia patient who had received multiple transfusions.

At the time, the AIDS virus had not been discovered and there was no blood test for the infection. Aoun became ill briefly a few weeks after the accident, but recovered and continued to work at the hospital until he became ill again in November 1986. He learned last Christmas Eve that he was infected with the virus. A stored sample of serum from the leukemia patient, who died in 1983, later was tested by the Maryland state laboratory, and the results suggested that the patient's blood contained the virus at the time of Aoun's accident.

Rodgers said yesterday that hospital officials had always accepted that Aoun contracted the virus from the blood of an infected patient. "At no time did Hopkins ever question in a letter or in any other way how he got AIDS," she said.

"I don't think that I can ever forgive the people involved completely," Aoun said yesterday. "The issues that I wanted to bring out publicly need to be brought up again and again."

He said health-care workers tending AIDS patients should be provided with life insurance and accident insurance, and that states should pass laws ensuring confidentiality for anyone infected with the virus. "Nobody in this world should have to go through what we've gone through," he added.

In its statement, the hospital said it is studying benefit programs in light of Aoun's illness and that it is working to educate employes about the danger of contracting the AIDS virus while caring for patients.