CHARLOTTE, N.C. — Steve Singer, who has bipolar and borderline personality disorders, knows when he’s on the verge of a mental health crisis. The female voice he hears incessantly in his head suddenly shuts up, and the hula hoop he gyrates while walking to the grocery store stops easing his anxieties.

That’s when he gets to a hospital. Usually, talking briefly with a nurse or social worker calms him enough to return home. But this year a hospital placed him on a locked ward, took his phone, and had an armed guard watch him for 20 hours before a social worker spoke with him and released him.

“I get the heebie-jeebies thinking about it,” said Mr. Singer, 60. “They didn’t help me, they hurt me.”

Deeply upset, he turned to something he’d never known existed: He completed a psychiatric advance directive, a legal document declaring what treatment he does and doesn’t want. Increasingly, patients, advocates and doctors believe such directives (called PADs) could help transform the mental health system by allowing patients to shape their care even when they lose touch with reality. Hospitals must put them in patients’ medical records and doctors are expected to follow them unless they document that specific preferences aren’t in the patients’ best medical interest.