A lawsuit alleging that officials in upstate New York’s Orange County unconstitutionally failed to provide mental health discharge planning to two individuals in immigration detention will continue after a federal appellate court reversed a lower court ruling that dismissed the litigation.

The Second Circuit U.S. Court of Appeals said in a decision Friday that the plaintiffs could argue that such planning qualifies as legally mandated in-custody care and could therefore be evaluated through a constitutional lens.