WITH THE Sandy Hook shootings still in the public mind, it seems as though every legislator, from the NRA-friendly to the anti-gun, is paying attention to mental health care in America. But lawmakers must also keep an eye on the bigger transformation of the country’s mental health system that is already in the works.

According to a 2011 study from the Kaiser Commission on Medicaid and the Uninsured, 60 percent of Americans and 70 percent of U.S. children suffering from mental illness aren’t getting treatment. One reason, no doubt, is stigma associated with seeking help for mental rather than physical problems. Another is that out-of-pocket costs and a shortage of mental health professionals limit access.

So, a group of lawmakers led by Sens. Debbie Stabenow (D-Mich.) and Roy Blunt (R-Mo.) are proposing to improve community mental health facilities. Under the plan, Medicaid would compensate these facilities more like it does rural health clinics or similar places that provide care for physical ailments. In return, mental health centers, often nonprofit organizations that accept a fair amount of Medicaid money, would have to provide services such as 24-hour crisis psychological treatment and substance abuse programs. Backers say that the proposal would cost about $1.4 billion over 10 years and help about 1.5 million patients. It’s a fine plan.

The Democrats’ 2010 health-care law, however, already prescribes a much bigger change in how mental health services are financed. The Affordable Care Act’s expansion of Medicaid and private insurance will ultimately extend mental health coverage to some 4.3 million Americans, according to a study in the American Journal of Psychiatry— including, no doubt, many of those who would use improved community mental health centers. That’s where the big money comes in.

A new Bloomberg Government study reckons that the coverage extension could shift as much as $29 billion in costs to Medicaid and insurers in 2014, if every state chose to expand its Medicaid programs. But that also assumes that the rate at which people use mental health services doesn’t rise, which it probably will. If 70 percent of those in need seek mental health care — a 30-point increase that Matt Barry, one of the study’s authors, calls “aggressive” but reasonable — Medicaid spending could increase by $261.9 billion between 2014 and 2021.

The federal government, then, is about to make a significant new commitment to mental health care. Mr. Barry says there isn’t much evidence this sort of spending will lead to fewer gun deaths. But, after another shooting, believed to involve a mentally ill suspect who attended the University of Maryland, the possibility can’t be ignored. Of course, reducing gun violence is not the first goal — improving the nation’s mental health is. Congress must ensure that happens, at least.