BALTIMORE, OCT. 16 -- AIDS patients, already beset with complex medical problems, are encountering a bewildering range of new legal problems -- job discrimination, insurance coverage, custody of children and, finally, preparation for death.

Now organizers of a novel project at the University of Maryland School of Law here have established a legal clinic, financed in part by a $40,300 federal grant, within the walls of the university's hospital in downtown Baltimore -- an experiment in teaming law faculty and students with the doctors and nurses who work with the state's growing population of AIDS patients.

While there are a few legal offices in private or state-financed AIDS service organizations in Washington, New York, San Francisco and other cities with large populations of AIDS patients, the Baltimore project is the first to be supported by the federal government, according to U.S. officials.

Representatives of homosexual rights groups and other organizations involved in the rights of AIDS patients applauded the Reagan administration's willingness to support a legal assistance program, regardless of how small.

"It is incredibly important that the federal government has apparently begun to recognize that legal assistance is a critical component of AIDS-related service," said Ben Schatz, head of the AIDS civil rights project of National Gay Rights Advocates in San Francisco.

The Baltimore project also appears to be the only one in which legal advisers deal with AIDS patients in a hospital, rather than in a law office.

"We go to them, rather than their coming to us," said Richard L. North, law school associate professor and coordinator of the program.

Armed with the one-year pilot grant from the U.S. Department of Education, plus secretarial and logistical support from the law school, four law students under North's supervision have been counseling dozens of AIDS outpatients for the last month at the hospital's infectious diseases clinic, contesting lost jobs and insurance coverage, arranging power-of-attorney agreements for incapacitated patients, writing wills and helping patients through the bureaucracies of public welfare.

In addition, says North, law students help patients find additional money to cover the costs of the drug AZT, an experimental medication that can slow fatal infections in some patients but costs $900 a month.

One woman with two children who receives $840 a month in Social Security disability payments, for example, needed cash for rent and food, said North. "We found a program that would pay for the drug for one month," he said, "but now we've got to find something for {her} after that."

It's a process of "constantly manipulating the regulations," North said, of "seeing ways of getting legal relief."

The clients are largely poor and black, he said, many of them intravenous drug users, or their spouses or children. Most are from Baltimore, but the clinic has served AIDS patients from as far away as Washington.

Giving legal advice to AIDS patients is not like giving advice to other clients, North said. AIDS patients in advanced stages of the disease often become disoriented or display bizarre behavior.

"These young law students," he said, "are dealing with people who are facing death . . . . We are training them how to ask what they want to do with their assets . . . . Are they buying anything on time? Are they behind in their rent?"

Those are tough questions to ask dying people, said North, "and I expect a real emotional burden to hit us" in the coming months as the patients die.

The idea of the legal clinic originated with North, who submitted a financing proposal to the U.S. Department of Education in June after receiving the blessing of the law school. He said he hopes to add eight to 10 law students next semester and hire a part-time faculty member.

His goal, North said, is to create a "cadre of lawyers trained in the unique problems" of AIDS patients " . . . and provide services for {AIDS patients}, especially those at the bottom of the socioeconomic ladder."