Advocates for people with mental illnesses praised federal legislation aimed at increasing access to treatment.

They said the bill, which President Barack Obama signed into law Tuesday, would eliminate some longstanding obstacles.

“There is just no doubt about it that there continues to be just widespread discrimination in this country,” said U.S. Sen. Chris Murphy, D-Conn.

The House and Senate overwhelmingly approved a compromise version of the bill, which Murphy called the most important piece of legislation he’s had a hand in since joining the Senate.

The law strengthens requirements that insurers give requests for mental health treatments the same scrutiny they give to those for other medical care.

The new law allows the federal Department of Health and Human Services to audit an insurer’s rate of denial for mental health services after five similar complaints. Having higher denial rates for mental health treatments could be seen as evidence of a violation, Murphy said.

“If your body is broken below the neck, then you are more likely to get good care than if your body is broken above the neck, and that makes no sense,” he said.

The law also makes it easier for providers to communicate and collaborate on a patient’s care and promotes early detection and prevention.

Kathy Flaherty, executive director for the Connecticut Legal Rights Project, said the law also makes it easier for patients to remain in their communities while undergoing treatment.

She feels the law strikes a better balance between a patient’s right to privacy and the need to share information with family members so they can play a role in treatment.

The law includes additional resources to address the dramatic rise in opioid addiction, which has resulted in a spike in overdose deaths in Connecticut and nationally. Tom Steen, chairman of the North Connecticut Association for Suicide Prevention, said you can’t address mental health without also trying to fight addiction.

“We all know in this state ... that mental health and addiction go hand in hand, and we’re losing young people to opiate and heroin overdose at an alarming rate,” he said.

The law calls for an increase in funding, but Murphy said more is needed to help expand the system. He said Republicans assured him that conversation would occur in the next session.

Murphy also said the law could be undermined if President-elect Donald Trump doesn’t enforce the new regulations, or if Republicans repeal the Affordable Care Act without putting into place new policies that maintain access to healthcare treatments and coverage.