The American Medical Association is opposing bills to make a second opinion mandatory before the government will pay for elective surgery in the Medicare and Medicaid programs.

Last week, a truncated version of the second-opinion measure was steered through the House Commerce Committee on a 22 to 18 vote by Rep. Andrew Maguire (D.-N.J.) over strong AMA opposition.

The Maguire amendment, attached to a larger Medicare-Medicaid bill, provide only for demonstration projects in seven states.

But the AMA is still opposed and may seek to get it out of the bill.

Maguire said in an interview that requiring a patient to obtain a second doctor's views, even though the patient would still be free to follow the first doctor's advice if he or she chose, could save the government potentially billions of dollars in the giant Medicare and Medicaid programs.

Second opinions, he said, would discourage needless hysterectomies, tonsillectomies, gall bladder operations and the like.

Maguire cited a study by the House Commerce oversight subcommittee two years ago, which said that 2 million cases of needless surgery in both government-financed or privately paid medical treatment may be killing as many as 10,000 people and wasting as much as $4 billion each year.

"And figures just obtained from a mandatory second-opinion program in Massachusetts, covering about 56 percent of the total Medicaid population, show a net 20 percent decrease in surgery with a net saving of $866,000 over two years," Maguire said.

Last October, AMA spokesman Dr. Frederick W. Ackerman said such claims of savings "cannot be substantiated," and moreover, that requiring a second opinion would "intrude on the patient's role in dictating the course of treatment."

An AMA official said yesterday that the 1978 oversight subcommittee figures had been discredited and shown to be overblown.

"I want to make clear the AMA doesn't oppose voluntary second opinions," the official said. "But they shouldn't be mandatory." He said the government is already funding Medicare-Medicaid second opinions on a voluntary basis for those who want them.

Rep. Phil Gramm (D.-Tex.), an opponent, said he may lead a fight to take the provision out in committee or on the floor.

Gramm said he had come to the conclusion that the Maguire provision isn't a good idea because there are already two statewide projects on it under way, plus four others being conducted on a voluntary basis. Moreover, he said, Blue Cross/Blue Shield has under way at least 30 experiments with second opinions.

Gramm said "no conclusive results have occurred from states that have it." In view of the fact that widespread experiments are under way, he said, there isn't any reason to spend $6 million; it would be much better to study the results of programs in existence.

"The loser here is the American taxpayer," Gramm said. He said that he had called a meeting of some of those opposed to Maguire's provision and that AMA lobbyist Jim Drake had attended, but it was his own idea and he wasn't acting at the request of the AMA.

"Always get a second opinion" has long been folklore medical wisdom.But health experts now see the use of second opinions to ward off needless surgery as a potential major cost-saving device. Former Health, Education and Welfare secretary Joseph A. Califano Jr. frequently spoke of it, and HEW put in a rule saying a patient could seek a second opinion and Medicare or Medicaid would pay for part of it.

But whether it should be mandatory is another issue. Under Maguire's plan, a patient advised to have surgery by his initial doctor would have to get the opinion of a second; but the patient could then decide to go ahead even if the second doctor advised against. In practice, many patients decide against it in such a case.

Maguire said mandatory programs are quite different from voluntary because they cover everybody and you get a wider range of samples and of savings; so the fact that voluntary programs are being tried out doesn't make mandatory experiments less necessary.

The seven-state mandatory experiment would be far larger than anything being tried out now, he said.

Maguire said he told the AMA's Drake that in view of the fact that he'd cut his proposal down to demonstration projects, "I can't understand why you guys aren't supporting it."

But Gramm said that in view of the other studies already under way, "it's a frivolous proposal" to go ahead with seven more.