The patient was a quiet man in his late 40s, laying still and minimally responsive to questions. His bloodwork showed severe dehydration. This was a man who could not answer where he was, when it was, or who he was. He was most likely dehydrated because he did not have the mental capacity to ask for water. While in the hospital, he was occasionally cantankerous, verbally abusive, and refused all food. One morning, we were unable to locate him and thought he had escaped from the hospital but ultimately found him in another patient’s bathroom clutching a box of chocolates he had received from his former partner the day before.

He needed more intensive care than we could give him: It was clear to me that this man had advanced dementia and belonged in a skilled nursing facility. Unfortunately, he had come to us not from a nursing home but from a jail cell—transferred to the hospital by the facility’s medical director due to an altered mental status. I restored his fluids and got ready to discharge him. But I had no interest in sending him back to jail.

So I got him out.

It was surprisingly easy. I called the medical director at the jail and pleaded my case for compassionate release. To be perfectly honest, he sounded relieved someone had called to take responsibility for this man who clearly did not have the mental capacity to survive in jail without special care. The director told me he would send a letter to the judge, and if the order was signed, the patient would be released from custody. I hung up the phone pleased but still expected a lengthy process ahead, especially as I had decided to make this call on a Friday afternoon. Imagine my shock the next morning when I walked in and found the patient uncuffed and the guards asking the patient to sign himself out of custody. In what was, to me, the clearest indication of his compromised mental capacity, he refused to sign the paperwork because he did not even realize he was in jail. Ultimately, he had to be signed out by proxy. He spent the next two weeks in the hospital with us as we searched for a nursing home with an available bed for him.

One month later, I had another patient who came from a jail with an altered mental status. She had a complicated psychiatric history combined with HIV-associated dementia. The two compounded one another; her mental illness precluded consistent treatment with antiretrovirals, and subsequent advancement of her HIV then worsened her mental status. Emboldened by my previous success, I again decided to call the medical director of the jail to plead for a compassionate release. This was a different county jail than the first one so the process was lengthier. But ultimately, the patient was similarly released unceremoniously and within the week.

I never did ask for what crimes these patients were incarcerated but given the ease with which they were released, I can only imagine they were low-level offenses that resulted from their mental conditions. Once the patients were released from custody, they were reunited with their families, and I got a glimpse into what it meant to be poor and mentally ill in America. Both patients had known mental illnesses and were cared for via limited family support. My first patient had twice before been in nursing homes for his condition, but upon achieving lucidity through consistent treatment, checked himself out of nursing care and preferred to live a solitary vagabond life—presumably without his prescribed medications. The second patient had a congenital condition, which for the first 15 years of her life was well-managed under parental supervision. But when she reached the age of consent, she similarly preferred to be homeless.

Prior to my interactions with them, both patients had been missing for more than a year. Their families stated that shortly after their loved ones had disappeared, they did search and recruited the help of law enforcement. But after months went by, they lost hope. They did not know whether their loved ones were dead, alive, healthy, ill, or incarcerated. When told that we had retrieved their missing family members from county jails, they were not surprised. Both patients had been arrested for sleeping in abandoned cars or trespassing in the past, so their families were not surprised it had happened again. (For good reason: Any interaction with the prison system raises the stakes of re-arrest, a problem compounded by homelessness.)

Both stories here are typical of what it means to be mentally ill and incarcerated, the consequences of which have been well-documented. These routine brushes with incarceration can be devastating for the mentally ill, who need consistent treatment to get well. There have been many solutions tried and failed. Attempts to transfer patients to nursing homes were thwarted by the apprehension of housing convicts. Psychiatric hospitals are no longer a viable option due to their sharp decline in funding and consequently availability. So jails and prisons had to become their own nursing homes, which presents its own ethical dilemmas. (Should anyone really die while locked up?)

Now months after discharge from the hospital, I called the families of my two patients to follow up on their progress as free citizens. Sadly, there are no happy endings here. Despite being released from their cells, the patients remained prisoners of their minds. Both adamantly denied they had any problems and refused to take their medications. While in the hospital, we cajoled them with juice, crushed the medicines into applesauce, and tried every other trick the nurses could conjure. This was, however, a nonsustainable plan, the families quickly realized. Inconsistent medication usage is at best futile and at worst breeds resistance to the treatment, so we decided to suspend treatment on my first patient when we discharged him to a nursing home. Months later, he has not seen an outpatient provider to restart his medications despite active involvement from his partner and the heroic efforts of his assigned social worker. My second patient had a worse prognosis and the family opted for palliative care, as she would certainly deteriorate without the medications she was forcefully refusing. After we got her out of jail, we transferred her to hospice where she passed away six days later. Her parents were understandably devastated but were thankful she had the dignity of dying in a padded bed rather than a padded cell.

For these two patients, the hospital was an opportune setting for intervention but hardly an ideal one. Although assessing a patient’s social determinants of health is part of a holistic approach to health care, there are not enough resources nor is it the best use of a physician’s skills to correct the living situation of every patient who has been misplaced. I learned that it is not difficult to convince a judge to release someone with advanced medical problems from jail, but that does not mean this model of justice is sustainable. Overflowing hospitals are not equipped to house recently sprung inmates in addition to their regular patients. Doctors at their patient maximums cannot be expected to take on this burden at the expense of other patients with active medical issues. For the same reasons of limited resources and overcrowding, the incarceration system is also not equipped to take on this responsibility.

So if neither the hospital system nor the incarceration structure are equipped to handle mentally ill inmates, then who should be responsible for their placement in society? As is the case with most things in medicine, the best cure is preventive. When apprehended, these people should be recognized as patients and not criminals, and appropriately triaged to social and health services.

Taking the lead from several other cities around the nation, Atlanta, the city where I practice, recently passed a resolution to do just that. The Pre-Arrest Diversion Initiative will attempt to identify people that have committed low-level crimes such as jaywalking and marijuana possession (often people who are socially or mentally disadvantaged). Rather than throw them in jail, they will assign them to a case manager who can help them navigate the available resources for mental health care, housing, and substance abuse.

A similar program in Seattle, Law Enforcement Assisted Diversion, has been significantly successful.Participants in the program were more than two times as likely to have obtained permanent housing. They were also 46 percent more likely to be on the road to employment, and 33 percent more likely to have an income source. The probabilities of these positive outcomes increased with each interaction a participant had with their case manager. Additionally, the city of Seattle saw a 60 percent reduction in recidivism rates and a net cost decrease of $8,000 per participant over one year, compared to people who had not been enrolled in LEAD by law enforcement at arrest.

Preventive care is often harder for these patients to access. It is only when they reach rock bottom and have no other resources available to them that we step up. But evidence shows that if we invest more sooner, we may be able to avoid the outcomes I experienced with each of my patients.

No, it is not hard to get a patient out of jail. But it shouldn’t come to that.