It's not surprising that mental health issues and substance abuse problems are major contributors to crime in California. What is surprising is how few attorneys seem to know how to have a meaningful discussion with their clients about these issues.
Some of my clients suffer from profound mental illness; they're hard to talk to. If someone is too ill, it is impossible to communicate clearly and have them to aid in their own defense. In those instances, Penal Code 1367 allows the court to stop the case dead in its tracks and have the defendant seen by a doctor, evaluated, and treated. If it works, life in (and out) of court starts up all over again. If it doesn't, the defendant either gets released after being locked up for the equivalent of a full sentence (in a misdemeanor) or sent to a state hospital for treatment (in a felony).