Maryland health officials, in a decision intended to reverse years of chronic neglect of the deaf in state mental institutions, have agreed to set up one of the most comprehensive treatment programs for deaf, mentally ill patients in the country.

The program is being established in response to a lawsuit filed last year on behalf of a 42-year-old deaf woman who languished 22 years in a Maryland state mental institution. The program includes the state's first residential center for mentally ill patients with hearing problems and requires hearing examinations for every patient admitted to a state institution.

In addition, two day care centers and halfway housing for patients who leave the residential center will be provided.

Previously, Maryland, like most other states, had no central system to help patients in state mental institutions who were deaf. Those deaf patients had to rely on an astute staff member or persistent relative to demand special services to help the patient communicate with doctors and other medical workers.

The result of years of neglect showed clearly in the 42-year-old woman, who, according to court papers and hospital administration officials, essentially had been "lost" at Spring Grove Hospital Center in Catonsville for most of her 22 years there.

Despite repeated urgings from outside psychologists, she had been given no hearing aid, nor had she had any contact with sign interpreters who could explain her problems to her doctors and other patients on her ward.

At the time the suit was filed in the summer of 1983, lawyers for the woman, identified in court papers only as Nancy Doe, said their client's case evoked memories of a period not too long ago when masses of deaf people were written off as mentally retarded or untreatable.

During an interview at Spring Grove in September 1983, Nancy (her real first name) wore a light blue ruffled blouse that was stained by coffee. She wore no undergarments. Her eye contact was almost nonexistent. Her sign language ability was minimal and her written communication primitive.

In contrast, during a visit at the new state facility in Sykesville this week, Nancy's hair and clothing were clean. Her attention span still was short but her eye contact was good and she smiled spontaneously. When asked, in sign language, how she was, she responded orally, "I'm still sick, but I'm getting better."

Lawyers for Nancy praised the final settlement offer this week from the state's Department of Health and Mental Hygiene as "wonderful."

"The state has responded very, very well," said David Chavkin, a lawyer with the Maryland Advocacy Unit for the Developmentally Disabled, which filed the suit along with the Washington-based National Association of the Deaf Legal Defense Fund.

"I hope when this is completed the state of Maryland will have a model program that other states can follow," said Mark Charmatz, a lawyer with the legal defense fund. "The state has created a program . . . . There was little of anything prior to our lawsuit. It's like night and day."

Although the final settlement has not been filed in court, Nancy's lawyers, as well as those representing the health department, said yesterday that they expect the most recent offer to be approved. In addition, assistant attorney general Varda Fink, lawyer for the health department, said yesterday that regardless of the disposition of the lawsuit, the hearing, screening and new residential program at Springfield Hospital Center in Sykesville will continue.

Traditionally, patients in state institutions with handicaps -- in particular, deaf patients -- go unnoticed. There are few sign interpreters skilled in the mental health area and frequently, as in Nancy's case, it is difficult to determine whether the patient's problems are a result of illness or the byproduct of years of institutionalization.

Locally, a program considered to be one of the best of its kind in the country exists at St. Elizabeths Hospital in the District. In Virginia, state officials this year started a residential program.

Nancy, a sturdy woman with cropped brown hair, was admitted to Spring Grove at age 20 after her father's death left her an orphan. The lawsuit has brought not only a new home but also a world of communication and sounds. Soon after the suit was filed, Nancy received a hearing aid, and about a month ago she moved to Springfield.

The walls in Nancy's new ward, unlike those of her old ward, are painted a fresh yellow and a pale green. None of the staff members on her old ward knew sign language; all staff members at her new home know or are receiving sign training.

Two full-time sign language interpreters and a deaf social worker have been assigned to her, as has an occupational therapist. Nancy and 12 other residents have adopted a puppy and on one recent day a Sign Language Crossword Cubes game was set out on the table.

Nancy's doctors still have not determined the extent of her mental illness, although she was originally diagnosed as a paranoid schizophrenic. Her records do not make clear whether an interpreter was present during the initial examination 20 years ago.

"Nancy is not going to be leaving anytime soon, but there is an incredible improvement both in her behavior and her participation," said Chavkin after visiting Nancy during the center's open house Oct. 16. "She was almost unrecognizable. . . . She communicated with us."