ANNAPOLIS, NOV. 9 -- A Maryland appeals court ruled today that hospitals and blood banks cannot be sued by patients who contracted AIDS from blood transfusions, unless the blood supplier was negligent.

The case was brought by a 19-year-old Montgomery County hemophiliac, who received regular transfusions at a Silver Spring hospital all his life. In February 1985, one month before methods of testing blood for acquired immune deficiency syndrome became available, he was found to have symptoms of AIDS.

Wayne A. Roberts and his mother, who live in Damascus, sued Suburban Hospital for $10 million, arguing that they had the right to claim damages under product liability laws. Roberts said in court papers that he suffered physical pain and fatigue, mental anguish and "grief associated with suffering from a disease with no cure." He could not be reached for comment yesterday.

In its ruling today, however, the Maryland Court of Special Appeals said blood transfusions are a medical service and not a product, and therefore are not covered by product liability statutes or by implied warranties.

Almost all the nation's 20,000 hemophiliacs depend on transfusions of blood derivatives to allow their blood to clot and prevent them from bleeding to death after even minor injuries. However, it was not until April 1984 that scientists identified the virus HIV as the apparent cause of AIDS and tests for screening donated blood were not available until March 1985.

According to the Red Cross, which collects about half the donated blood in this country, testing for the virus has been extremely effective in preventing the transmission of AIDS by transfusions. However, a variety of studies have shown that between 64 and 94 percent of hemophiliacs in the United States were exposed to the virus before donated blood was tested.

So far, about 700 people in this country are known to have contracted AIDS as a result of blood transfusions -- about 1.5 percent of the more than 45,000 documented cases of AIDS.

Many suits have been filed against hospitals and blood banks around the country by such victims, and nearly all have been unsuccessful. In July, a federal judge in the District threw out a suit brought by the parents of a 3-year-old Herndon boy, Matthew Kozup, who died of AIDS through transfusions he received after his premature birth at Georgetown University hopsital in 1983.

Legislatures in 48 states, including Maryland and Virginia, have passed laws protecting hospitals and blood banks from such suits in cases where diseases in blood cannot be detected or eliminated.

"I can really sympathize with the frustration," said Suburban Hospital's attorney, S. Allan Adelman. "You do what's necessary to get good health care and you get AIDS out of it. But unfortunately we just didn't have the ability or the technology to solve the problem. The only way to avoid that problem . . . was to completely eliminate the blood supply and that wasn't an acceptable alternative."