An Iowa judge has dismissed a lawsuit brought on behalf of two transgender Medicaid recipients that challenges Iowa’s law allowing local governments and state agencies to refuse to use taxpayer dollars to pay for transition-related surgery.

The lawsuit, filed by the American Civil Liberties Union and the ACLU of Iowa on behalf of Mika Covington and Aiden Vasquez, argues that the law is unconstitutional under the state’s Civil Rights Act because it singles out transgender people for disparate treatment.

Both Vasquez and Covington are transgender, qualify for Medicaid, and have doctors who agree that receiving gender confirmation surgery is necessary to treat their gender dysphoria. Yet under the law, they could potentially be denied coverage for gender confirmation surgery and forced to pay out of pocket — even though the state’s Medicaid program would have — and has — covered similar procedures for non-transgender residents.

The law, which was signed into law as an attachment to a budget bill by Gov. Kim Reynolds in May, was a direct response to a unanimous March decision by the Iowa Supreme Court finding that a long-standing regulation prohibiting Medicaid funds from being used to cover transition-related care was unconstitutional because it violated Iowa’s law prohibiting discrimination in public accommodations.

In response, Republican lawmakers carved out a special exemption within the state’s public accommodations law that allows any organization that handles taxpayer dollars to refuse to cover gender-affirming surgery.

At a hearing last week, Iowa Assistant Attorney General Thomas Odgen argued that the language of the law does not actually ban funding, because while state agencies can refuse to provide coverage for procedures under Medicaid, the Department of Human Services is not explicitly prevented from covering those services, and individuals like Covington and Vasquez are not barred from seeking Medicaid coverage for their health care needs, reports Iowa Public Radio.

On Friday, Polk County Judge David Porter dismissed the lawsuit, ruling that the injunction that the ACLU lawyers had sought to stop the new law from being enforced is not “ripe for judicial consideration” because Covington and Vasquez have not yet exhausted all their options by going through the Department of Human Services’ administrative appeals process.

The ACLU has since filed an emergency appeal of Porter’s ruling, asking the Iowa Supreme Court for an emergency temporary injunction, as well as to expedite the appeal.

“No one, including transgender Iowans, should be denied the medical care they need,” Daniel Hoffman-Zinnel, the executive director of the LGBTQ rights group One Iowa, said in a statement responding to Porter’s ruling.

“Being denied this medically necessary care puts the health and lives of transgender Iowans who rely on Medicaid at risk, including increased risk of depression, anxiety, and suicidal thoughts for transgender individuals who can’t access the care their doctors prescribe,” Hoffman-Zinnel added. “That’s why we’re appealing this decision.”