A transgender man is suing a Catholic hospital in New Jersey for canceling his hysterectomy surgery after his doctor deemed the procedure “medically necessary” as part of his sex transition.

The surgery was scheduled at St. Joseph’s Hospital in Paterson, but an administrator canceled the operation because of the hospital’s religious affiliation.

A lawsuit filed on Thursday claims that a Catholic hospital denied a transgender man a hysterectomy due to ethical and religious directives from the US Conference of Bishops. The man, Jionni Conforti alleges that doing so violated his patient’s bill of rights that states hospitals will provide medical services regardless of “gender identity or question.”

US sued for complete record of complaints filed against #Catholic hospitals https://t.co/TUvLlCZWvNpic.twitter.com/Zd3MSlaej1 — RT America (@RT_America) May 24, 2016

In June 2015, Jionni Conforti went to St. Joseph’s Wayne in New Jersey to schedule his hysterectomy. The head nurse in charge of surgery there “assured” him that there would be no issues having the procedure at either the Wayne hospital or its other location in Paterson.

The procedure was deemed “medically necessary” to treat Conforti, who was diagnosed with gender dysphoria in 2014, court documents said. He had “long struggled with depression and anxiety rooted in the need to align himself with his true sex.”

Conforti began receiving hormone therapy as part of the treatment, and received recommendations from both his primary care physician and his therapist that he undergo a hysterectomy. Part of his decision to have the surgery was due to “a possible link between Jionni’s hormone therapy and certain reproductive system cancers,” the lawsuit said.

Eight days later, however, Conforti’s surgeon told him that hospital administration would not allow the operation at either facility. The same day, he received an email from Father Martin D. Rooney, director of mission services at St. Joseph’s Hospital System, reiterating that the surgery would not be scheduled.

This is to follow up to your email inquiring about scheduling a total hysterectomy here at St. Joseph’s to remove all female parts based on the medical necessity for Gender Reassignment. This is to inform you that as a Catholic Hospital we would not be able to allow your surgeon to schedule this surgery here at St. Joseph’s.

As a result of the refusal, Conforti “felt betrayed” by the hospital system and became “deeply depressed.” The denial also caused him “great anxiety.”

“Being humiliated and rejected by a hospital because of who you are as a person is not okay,” Conforti told Time. “My goal is to make a change for the up and coming trans people so they never have to go through this.”

US Supreme Court to rule on transgender school bathroom case https://t.co/5dU8isvGGwpic.twitter.com/fGRpPsjHHl — RT America (@RT_America) October 29, 2016

St. Joseph’s patient bill of rights states that it will provide medical care “in accordance with the moral teaching of the Roman Catholic Church, to receive the care and health services as required by law.” It also states that patients have the right to treatment “without discrimination based on,” among other things, “sex, sexual preferences, gender identity or expression.”

“No hospital should be allowed to decide who their patients are, particularly when they receive government funds. Denying care to someone at their time of need because of their sex or gender identity is not only dangerous and humiliating, it’s against the law,” Lambda Legal staff attorney Omar Gonzalez-Pagan said in a statement. “In the United States, one in six hospital beds are in Catholic hospitals. These health care providers must comply with federal and state anti-discrimination laws so that the health of LGBT people who walk through their doors is not endangered.”

“This is my neighborhood hospital. My whole family has been treated here and this is the hospital where I would be taken by ambulance in an emergency and they discriminated against me,” Conforti said in a statement. “I am shocked and saddened by the treatment I received and I am afraid of how I would be treated if I need medical care again. St. Joseph's Healthcare who says it prides itself on a ‘patients first’ approach, completely disrespected who I am as a person and that is not how a hospital should treat people.”

The rejection didn’t just mean that Conforti needed to find a new location for his surgery, he also had to find a new doctor because the original surgeon only has admitting privileges at St. Joseph’s. Three months after the rejection, another hospital performed Conforti’s hysterectomy.