I believe that there have been large strides made in terms of recognizing mental illness and dealing with it in the criminal justice system. Inmates can receive mental healthcare within prisons or be mandated it from courts, but the quality of this care is often questionable. I personally believe that the criminal justice system has limited capability for dealing with mental health issues. The fact that we send people to prison with serious mental illnesses is appalling. Prior to deinstitutionalization, there were large wards that housed thousands of sick people. While these systems were imperfect it was less invasive and damaging to people than putting them in prison. I also think that there is a role confusion that is taking place in criminal justice caused by the fact that as a society we tend to punish people who are sick.
The entire concept of insanity within the scope of the legal system is somewhat troubling. You can be considered mentally ill but still be sane enough to stand trial. I personally think this is a terrible approach to justice and to the mental health fields because it forcing the criminal justice system to deal with people who they are not trained to deal with.