That’s a big step, long in coming. But now comes the hard part: actually upgrading health care in the prisons so that no one dies or suffers needlessly.

People behind bars with medical problems don’t have the ability to shop around for health care. If the care is substandard, they can’t do anything about it. But two reports by court-appointed experts found the health care provided by an outside for-profit contractor had been widely unacceptable for 40,000 state prisoners.

In one case, for example, no one paid much attention to a 26-year-old inmate who repeatedly told health care staff members he had atrial fibrillation — until he had a stroke. A study released in 2015 found “significant lapses in care” in 60 percent of the cases in which prisoners died behind bars in 2013 and in the first half of 2014.

The final consent decree will spell out qualifications for health and dental care providers, such as physicians; require more health care space and better equipment; require the hiring of infection control staff; require the implementation of a electronic medical records system, and put a quality control program in place.

The federal court and involved parties are still negotiating to achieve a final approval of the consent decree. After that, it’s important that the foot-dragging stops that has delayed resolutions of these problems for eight years.

It won’t be easy. As Jennifer Vollen-Katz, executive director of the John Howard Association, says: “Execution for this is going to be very difficult for the department. They are under-resourced, and they are understaffed.”