These issues are by no means exclusive to Illinois. Jails and prisons can make the practice of medicine challenging. For one, their inhabitants are under a much heavier disease burden than the broader American public. When the Bureau of Justice Statistics compared illness in jails and prisons with rates in the general population, it found a striking divide. While the average rate of infectious disease, like tuberculosis or hepatitis, among those incarcerated is 21 percent, the rate for those outside of prison is under 5 percent. Estimates suggest that, on average, prisoners’ bodies function at a physiological age 10 to 15 years older than their chronological age. A growing geriatric population also complicates the work of doctors and nurses.

There are logistical factors, too, that make providing care tough. Like other states with strict budget constraints, Illinois is running its facilities above capacity, at 147 percent, and its per capita funding for prisoner health care ranks 48th out of 50 states, according to a 2014 report. Facilities nationwide also maintain an unusual chain of command, in which guards—whose primary focus is security—are often the first to encounter inmates with medical complaints. Under this informal system of triage, urgent symptoms may go unrecognized.

Health-care providers must also balance treatment against legitimate safety concerns. In a recent example, an inmate from Illinois’s Kane County Jail was granted medical furlough to visit a nearby hospital. While in the emergency room, he took a nurse hostage, and was eventually shot and killed after broken negotiations and a SWAT team standoff.

At the same time, the negligence of prison medical staff sometimes seems baffling in its callousness. Predating Shansky’s report, in the spring of 2012 an inmate in Illinois’s Taylorville Correctional Center, who had lost 42 pounds in three years, was diagnosed for a second time with hemorrhoids after he complained of bleeding from his rectum. Within weeks he was placed in diapers and having up to 40 bloody and watery bowel movements a day. Not until July was the man sent to a hospital, where he was diagnosed with late-stage colon cancer that had metastasized to his liver and lungs. He died one month later.

In his report, Shansky documented numerous deaths similar to this one that he said were caused by a “failure to identify serious instability”—a severe case of internal bleeding that went unmanaged, sepsis that went undiagnosed. In sum, he found “an unacceptably high rate of deviations from the standard of care.” (Shansky declined a request for comment, as he will likely be called to testify in the case. The state corrections department, which criticized his report, and Wexford Health Sources both declined to comment.)

After his findings were released in 2014, both the plaintiffs and the state of Illinois began moving toward a consent order that included court oversight of prison health care, according to Bennett from the ACLU. But the election of Republican Governor Bruce Rauner shifted the political winds. Rauner’s administration, she suggested, preferred a private settlement that precluded that oversight, which “was a deal-breaker.” Negotiation fell apart and the case returned to active litigation.