A probate judge here has ordered that every reasonable effort be made to save the life of a 45-day-old infant. Kerri Ann McNulty, despite the wishes of her parents that she be allowed to die of her birth defects.

The ruling is vivewed by many Massachusetts doctors and attorneys as a barbinger of a new legal and medical attitude toward defective newborns, who have been allowed in many instances to die rather, than face a bleak life of institutional care.

Kerri Ann was born Jan. 4 suffering the residue of an undetected German measles infection her mother contracted early in pregnancy. The virus caused dense cataracts in both eyes, nerve deafness and probable severe mental retardation.

Her life is threatened by an obstruction in her aorta, the main artery that branches from the heart, but she has been kept precariously alive during the past weeks as her fate was debated before Essex County Probate Judge Henry R. Mayo Jr.

Dennis and Donna McNulty of Lynn, Mass., petitioned Judge Mayo to authorize withholding of sergery to repair the artery. They acted under a recent, controversial dictum by Massachusetts' highest court.

The new Massachusetts ruling essentially holds that issues of both withholding and terminating critical care - for elderly stroke victims or cancer patients as well as for severly ill newborns - are matters for the probate courts to decide, not for families, doctors, nurses, social workers, priests, committees or anyone else.

"We just didn't want to see her suffer through an operation," Donna McNulty said. "She can't see or hear. Her only comfort is to be held and touched. I would prefer not to have the operation performed."

However, Kerri Ann's court-appointed guardian reluctantly recommended, and the judge agreed, that the surgery should be performed. Under the Massachusetts Supreme Judicial Courts ruling of Nov. 28, they said, all lifesaving care must be provided and "quality of life" is not a proper consideration.

The court here was especially emphatic in rejecting the Quinlan doctrine, the 1976 opinion of New Jersey's Supreme Court "in the matter of Karen Ann Quinlan." The New Jersey court held that hospital "ethics committees" could hear evidence on the hopelessness of individual cases and decide to discontinue care without the court's endorsement.

The new ruling was handed down on Nov. 28, but it attracted little attention until recently, when doctors, hospital officials and lawyers here began to realize how profound a change the court had wrought in the medical decision-making process.

Until now, decisions about life-prolonging case in Massachusetts hospitals (like their counterparts elsewhere) were mate privately, by a consensus of medical and nursing staff and the family. Sometimes a committee was involved, but most often the decisions were and hoc, with greater or lesser family involvement and knowledge, depending on the style of the institution and the attending physician.

No longer. Now, before a critical decision is made that would condemen an "incompetent% patient to an earlier death, the patient's family or guardian must petition a probate court. The court will appoint a temporary guardian to represent the patient's best interests. There will be a hearing, testimony on medical facts, prognosis and what the patient would have wanted.

And the probate judge will decide.

That's the procedure for "incompetent patients - mentally retarded or insane, comatose or unconscious, infants or other minors. The court said that "competent" patients can decide for themselves how far to go in pro longing life.

Theat, too, is viewed as an important feature of the ruling. For one thing, it is the basis for the court's logic: if the "competent" patient is viewed as having a choice, then the same right must be extended to the "incompetent." But the courts must decide for the "incompetent," not some potentially biased third party or nonjudicial committee.

Second, the court's stress on the right of choice in these matters is viewed by legal experts as a strong, implicit endorsement of the so-called "living will," a declaration of intent that has won legislative sancition in eight states.

For those incapable of chice, however, the living will is not solution. But neither are the courts, say a growing numbers of doctors, hospital officials and medicine-oriented lawyers who know and understand the Massachusetts ruling.

"One wonders if the court had any realization of how many, many cases there are like this, said attorney William J. Curran of the Harvard School of Public Health. "I think they thought they were dealing with cases that only happen on occasion, when there is time to make a deliberate decision."

The immediate practical effect of the opinion, at least in some hospitals, is to enforce a sort of "never-say-die" attitude in place of the tacit understanding that some patients were not to be resusciating everybody - the 85-year-old with brain hemorrhage, the patients dying of metastic cancer. We often have no machines left for young people."

Some doctors and nurses said in interviews that they are inclined to ignore the ruling, to go on quietly deciding not to resuscitate Mr. X or Mrs. Y if he or she should suffer cardiac arrest, or to be less than aggressive in treating the complication of terminal illness when the family and staff think that "enough is enough."

"There are many subtle ways of doing it - of not giving total support," said one physician. Lawyers who represent hospitals are alarmed by such an attitude, even if they sympathize with it. Conservative legal advice is to follow the law - or risk both civil malpractice actions and criminal liability.

Aside from the logistical difficulties in complying with the court-prescribed procedure, however, the opinion has raised some other problems. For instance, many doctors are reluctant to suggest to a family that it petition the court, and many people are said to shy away from the prospect that they would have to say in public that they want their loved one to die. (At present there are no protections of identity once a case has reached the hearing stage.)

Thus, many decisions about prolonging or withholding care will not be made - or, rather, will be made tacitly in the direction of doing everything possible.

Mayo's ruling in Kerri Ann McNulty's case underscores the new requirement there that all detective newborns be saved if medically possible, even if they would live only what one social worker calls "a twilight existence."

Many, if not most, physicians here are opposed to such rigid requirements, not to mention the general principle of court involvement in such matters. One exception is Dr. Murray Feingold of Tuffs-New England Medical Center in Boston.

"I'm not sure the way decisions were made was always right," Feingold said. "But if the court requires us to maintain the life of an otherwise terminal patient, the next question is how does the state make sure the quality of life is the best attainable? The court shouldn't just say, 'Save this child - goodbye.'"