Some of Pennsylvania’s most vulnerable citizens—people facing criminal charges who are not competent to stand trial because of mental disabilities—have begun a class action lawsuit over the state’s provision of mental health treatment.

Last month, eleven plaintiffs, represented by the ACLU of Pennsylvania, sued the heads of a state agency and of the two state psychiatric hospitals. The plaintiffs are all persons with mental disabilities who had been found to be not fit to stand trial and were ordered into “competency restoration” treatment. The excessive delays in providing them with appropriate care are the subject of this lawsuit.

The plaintiffs include two groups. The first group alleges that they and others in their position have been waiting months and even years for court-ordered treatment when they should have been transferred out of jail and into a hospital within seven days. The second group consists of people who were hospitalized and received treatment, but allege that they then remained in the forensic units of hospitals for more than thirty days after it was determined that they could not be restored to competency. Both groups argue that these delays in timely and appropriate placements violate their due process rights under the US Constitution as well as the protections of the Americans with Disabilities Act.

The plaintiffs all suffer from serious mental health conditions. These include schizophrenia, paranoid schizophrenia, traumatic brain injury, and other mental illness and mental impairment. Due to the plaintiffs’ mental illnesses and disabilities, each of them have their interests in the lawsuit represented by either a family member or, for seven of the eleven plaintiffs, by public defenders or court-appointed attorneys.

The complaint filed in federal court on October 22 describes a system in crisis. People wait months or years in jail for appropriate, court-ordered mental health care. According to the plaintiffs, “[f]ederal courts have ruled that delays of more than seven days from the court’s commitment order to hospitalization for treatment are unconstitutional.”

While people wait in jail, they are vulnerable to violence, likely to be placed in solitary confinement, cut off from their families, and receive no treatment besides medication. Patients can refuse medication, however, and when they do many decompensate. One plaintiff was in solitary confinement for the six months leading up to the filing of the lawsuit.

In contrast, the hospital forensic units are staffed with mental health professionals, including doctors, nurses, counselors, and social workers. By law, their aim is to “maximize the probability of [a patient’s] recovery.” They develop treatment plans and are also supposed to give patients “legal skills training” as part of helping them become competent to stand trial.

The capacity of the hospitals falls drastically short of the need. The two psychiatric hospitals in the state providing competency restoration treatment have a total of 200 beds in their forensic units. The complaint states that at any given time another 200 people are on the wait list to enter these units.

These shortages in care lead to what are alleged to be the longest wait times in the country. Some people are incarcerated longer waiting for a bed than they would have been if they had been convicted. One plaintiff was held in the Philadelphia Detention Center for 589 days. Several patients from Philadelphia have waited from one to two years for treatment.

In the case of another plaintiff, who is chronically homeless and suffers from schizophrenia, he was charged with stealing three Peppermint Patties. He was evaluated and found to be not competent to stand trial and ordered into treatment. As of the filing of the lawsuit he had been waiting in jail for eleven months.

The shortage of beds in the forensic units is made worse because many of the patients there are long overdue for transfers out of the units. The second group of plaintiffs in the lawsuit includes people who have all been in a forensic unit for more than 30 days after they were evaluated and judged unlikely to become competent or no longer making progress towards competency.

According to the complaint, in January, the forensic unit at Norristown hospital, in eastern Pennsylvania, held at least 41 people—one-fifth of combined capacity of the forensic units statewide—who were not responding to competency restoration treatment and needed to be transferred to a less restrictive setting. As of January 2015, the waiting list was two-thirds full with people who’d been on it for a year or longer. One person from Philadephia had been on the wait list for a transfer to a less restrictive setting for over 1000 days.

For many of the plaintiffs receiving competency treatment, the expert assessment even at the time of their original competency determination was that they were unlikely to ever regain competence. This was the case with T.S., a man in his mid-50s who is deaf, suffers from paranoid schizophrenia, and was charged with murder. The psychiatric expert who originally evaluated him during the incompetency proceeding said that treatment might not ever render him competent. He has now been in competency restoration treatment, with no apparent progress towards competency, for a decade.

The forensic units ban outgoing calls, limit incoming calls, restrict visitors, and do not allow patients to wear their own clothes. The civil units in the same hospitals restrict patients’ movements but offer more activities and afford patients more contact with the outside world and their loved ones.

The lawsuit also alleges active resistance on the part of the hospitals to placing people in community programs. In one case, a man in his mid-20s, E.M., was placed in the forensic unit after four months in jail during which he wasn’t allowed to see his family. After transfer to the forensic unit, after a year there, a hospital psychiatrist determined that he wasn’t making progress towards competency. Another year and a half passed before he was transferred. His family found a community placement for him but the hospital fought that and placed him in the civil unit. Eventually, the hospital was forced to transfer him to a community placement.

The lawsuit highlights the grim scarcity of appropriate mental health treatment for people in the criminal justice system and the unconscionable delays this scarcity has caused. Now, some of the people most in need of this care are calling the state to account for their long wait.