legal standards for mental illness