In 1998 , election officials in New Jersey refused to count ballots from residents of a state psychiatric hospital unless the voters could prove that they were competent , which later was ruled unconstitutional .