PROVIDENCE, R.I. — The last piece of legislation President John F. Kennedy signed turns 50 this month: The Community Mental Health Act, which helped transform the way people with mental illness are treated and cared for in the United States. Signed on Oct. 31, 1963, weeks before Kennedy was assassinated, the legislation aimed to build mental health centers accessible to all Americans so that those with mental illnesses could be treated while working and living at home, rather than being kept in neglectful and …