SPRINGFIELD, Ill. (AP) – A federal monitor would guide an overhaul of the system for providing health care to state prisoners in Illinois under a proposed lawsuit settlement.

The American Civil Liberties Union of Illinois announced Thursday that state officials had agreed to a consent decree to settle the eight-year-old federal lawsuit over physical health care of about 40,000 state prison inmates.

A U.S. District judge in Chicago must approve the consent decree . It requires the state and the appointed monitor to create a staffing plan that sufficiently covers prison medical and dental needs and a list of other system-wide changes. The decree requires improved health care space and equipment, dedicated infection control, record-keeping and quality assurance.

The lawsuit alleges gaping holes in the prison system’s health programs leading to numerous preventable deaths.