It’s rare, but it happens: A surgeon leaves a piece of gauze in a patient. A doctor gives a bad diagnosis. The wrong arm is amputated.

When mistakes happen in hospitals and doctor offices, many assume the straightforward remedy is to hire a lawyer and sue.

But in Utah, it’s not that easy — and for years, the state’s medical community has had significant influence on which malpractice cases made it into the courtroom.

Not anymore.

The Utah Supreme Court released a decision over the weekend that found the process Utahns must follow before filing a medical lawsuit is bleeding into the role of judges. And for nearly the past decade, a Utah government licensing entity essentially had the power to block lawsuits from reaching the courtroom.

That is unconstitutional, the high court found.

The decision centered around a process called a pre-litigation hearing. This is where someone who wants to sue a medical provider has to go first before a panel created by the Division of Occupational and Professional Licensing (DOPL). The panel — a medical professional, a lawyer and a layperson — then issues a finding on whether the claims had any merit.

In the past, plaintiffs could file a lawsuit no matter what conclusion the panel reached. That changed in 2010, when state lawmakers added another layer to the process: If the panel rejected a case, the person who wanted to sue had to find a health care provider who would write an affidavit saying the claims were valid.

Even then, the DOPL panel had to accept the explanation. It could reject that affidavit, blocking the case from moving forward.

That’s what happened in the case that the Utah Supreme Court weighed in on. A Utah woman, Yolanda Vega, sued Jordan Valley Medical Center after her 44-year-old husband underwent a routine procedure to have his gallbladder removed in 2014 and came out in a coma. He died a week later.

Vega and her attorneys went through the pre-litigation hearing process, but the panel found her claims lacked merit. She then retained a doctor to provide an affidavit — where the doctor wrote that the medical records were inadequate, but that the circumstances of Gustavo Vega’s death “are highly suspect.”

That wasn’t good enough for the DOPL panel, and it rejected the affidavit, asking for it to be amended. Vega went ahead and filed her lawsuit anyway, and a judge dismissed it because she did not have the DOPL certificate as required by law.

The Utah Supreme Court found that this process allowed DOPL to “exercise the core judicial function of ordering the final disposition of claims” without judicial review — which is unconstitutional.

“If there is no review or appeal to the courts, then the ruling of the panel is not a recommendation or an opinion — it is an authoritative and final ruling on whether a claim has merit,” Justice Deno Himonas wrote in the unanimous opinion. “It is a total disposition of a case, outside of the courts, without any standard judicial process or the consent of the parties.”

Himonas also wrote in the opinion that the high court recognizes that health care costs are rising, and legislators can take action in how to tackle that problem.

“If, in the Legislature’s judgment, frivolous lawsuits are a major contributing factor to increased costs of care, it has the power and prerogative to attempt to mitigate any and all deleterious effects,” he wrote. “However, regardless of the wisdom of any such approach, the Legislature’s solution is still subject to the Utah Constitution.”

Troy Booher, the appellate attorney who represented Vega, applauded the Supreme Court’s decision, saying the state constitution requires that the judicial branch should be the ultimate decider in these cases.

“It’s a very well-reasoned opinion,” he said, “that draws a clear line between the work that the judiciary should do and what’s left over for the other branches of government — which is very, very important.”

The high court struck down the part of the law that outlined the process of a health care provider offering an affidavit that is then sent to DOPL. The original DOPL pre-litigation hearing process remains intact.

“We’re just going back to the way it was before 2010,” said G. Eric Nielson, one of Vega’s attorneys. “It’s just one less barrier to justice.”

Nielson said he wished the Utah Supreme Court would have ruled the entire pre-litigation process was unconstitutional, including the panel hearings. He said the three-member panel almost always rules in favor of medical professionals. It’s unlikely, he said, for a radiologist to find that a fellow radiologist made a mistake.

“It’s biased,” he said. “It’s never neutral. I have had cases that I thought were just appalling care. The doctor on the panel, he is a biased person. He or she would never be allowed to sit on a jury in a medical malpractice trial.”

Attorneys for Jordan Valley Medical Center were not immediately available for comment.

Physician and state Rep. Ray Ward, R-Bountiful, said he believes there is value in having a pre-litigation panel, not as a replacement to the courts but to provide feedback to both sides of a potential medical malpractice suit.

He said he wants to be treated fairly as a physician, while recognizing that valid complaints need to be allowed to move forward and be heard.

"There probably will be more lawsuits coming through," Ward said of the ruling. "I don't know that it would be an avalanche."

Senate President Stuart Adams, R-Layton, sponsored the original 2010 bill. He said that while members of DOPL were doing their job in evaluating the underlying case, he believes the Utah Supreme Court made the right call in its ruling.

Adams said it’s likely the issue will be discussed during the upcoming legislative session to amend the law and comply with the court’s ruling.

“As we try to deal with issues like this, a part of it is refined as we go,” Adams said. “The courts have helped us refine this.”