The legislation has been endorsed by major state and national mental-health organizations, including the American Psychological Association and the American Psychiatric Association, as well as by faith groups, elected officials and former public safety officials.