On Tuesday, a district court judge struck down the Obama administration’s since defunct mandate forcing doctors to perform transgender surgery regardless of their religious convictions or conscientious objections. The mandate, handed down by Obama’s Department of Health and Human Services (HHS), ironically did not apply to Medicare and Medicaid or to military doctors because the government’s own research showed that transgender hormones and surgeries can be harmful.

Under Trump, the HHS finalized rules protecting religious freedom, but the Obama mandate remained on the books.

The ruling in Franciscan Alliance v. Azar struck down that mandate and upheld the religious freedom of doctors who would refuse to administer hormone therapy and sex reassignment surgery. Some doctors have warned that even the hormones — the less invasive “treatment” — give healthy people a disease. The actual surgery often involves sterilizing a patient for life. Mandating such “treatments” would force doctors to violate the Hippocratic oath.

“It is critically important that doctors are able to continue serving patients in keeping with their consciences and their professional medical judgment, especially when it comes to the personal health choices of families and children,” Luke Goodrich, vice president and senior counsel at Becket, the law firm representing the Franciscan Alliance, said in a statement. “Doctors cannot do their jobs if government bureaucrats are trying to force them to perform potentially harmful procedures that violate their medical and moral judgment.”

“Today marks a major victory for compassion, conscience, and sound medical judgment,” Goodrich added. “Our clients look forward to joyfully continuing to serve all patients, regardless of their sex or gender identity, and continuing to provide top-notch care to transgender patients for everything from cancer to the common cold.”

After the Obama administration handed down the mandate, an association of over 19,000 health care professionals, nine states, and several religious organizations filed two lawsuits against it. In December 2016, two different federal courts issued preliminary decisions ruling the policy an unlawful federal overreach and likely a violation of religious freedom.

District Judge Reed O’Connor agreed, ruling that the mandate violated the Administrative Procedures Act (APA) and the Religious Freedom Restoration Act (RFRA).

Research shows that there are significant risks with sex reassignment surgery, including hearth conditions, increased cancer risk, and loss of bone density. Children with gender dysphoria (the condition of persistently identifying with the gender opposite one’s biological sex) are extremely unlikely to continue in that condition after puberty. Many realize they are not transgender, but instead gay or lesbian — like detransitioner Charlotte Evans, who launched a network for formerly transgender people.

This transgender mandate, like many other Obama-era policies, aimed to use the strong arm of the state to enforce what amounts to a new belief system. While a few people have disorders of sex development, most human beings are either male or female from the moment of conception. Men and women have key biological differences from the womb, and no amount of transgender “treatments” can alter a person’s DNA, which impacts his or her development throughout life.

Erasing biological sex in order to enshrine transgender identity in medical best practices has real consequences for patients. In one particularly tragic case, a pregnant woman who identified as a man went to a hospital with abdominal pain. Because she identified as male and records listed her as male, doctors discounted the idea that she could be in labor. She did not receive the care she needed and her child died. Had the medical establishment rightly categorized her as female, her baby would have survived. Yet doctors took the opposite lesson, chiding themselves for not considering the ludicrous idea that a man could be pregnant.

The Obama administration attempted to redefine the word “sex” in federal civil rights law to include gender identity, a person’s internal sense of self. This is not accurate, linguistically or scientifically. Yet the Obama HHS attempted to force doctors to adopt this view, with no protections for conscientious objectors.

Judge O’Connor was right to strike down the Obama mandate, but Democrats are leaping over one another to pledge their loyalty to the transgender movement. Should a Democrat follow President Donald Trump in the White House, he or she would likely issue a new transgender mandate.

Follow Tyler O’Neil, the author of this article, on Twitter at @Tyler2ONeil.