President Donald Trump delivers remarks during an event to mark the National Day of Prayer in the Rose Garden at the White House May 3, 2018 in Washington, DC.

LOS ANGELES — Critics are assailing the Trump administration's "conscience" rule, which allows health workers to refuse medical treatment to people, even in emergencies. They charge it allows discrimination against the LGBTQ community and women and could result in some medical providers refusing lifesaving care.

In a release last week, the Health and Human Services announced the issuance of its final "conscience" rule, which it said follows President Donald Trump's May 2017 executive order and his pledge "to promote and protect the fundamental and unalienable rights of conscience and religious liberty."

The agency said the final rule replaces a 2011 policy "that has proven inadequate." It added that these laws protect health-care providers and workers "from having to provide, participate in, pay for, provide coverage of, or refer for, services such as abortion, sterilization, or assisted suicide."

However, the city of San Francisco filed a lawsuit last week calling the federal rule unconstitutional and charging it "would increase discrimination in health care." Furthermore, the city claims it risks losing nearly $1 billion in federal funds if it refuses to comply with the administration's rule.

"While San Francisco complies with the laws passed by Congress, the final rule would result in immediate injury to San Francisco," the city declared in its complaint. It said the rule requires the city and county "to prioritize providers' religious beliefs over the health and lives of women, lesbian, gay, bisexual, or transgender people, and other medically and socially vulnerable populations."

At the same time, the lawsuit said: "San Francisco recognizes and respects that an individual's religious beliefs, cultural values, and ethics may make that person reluctant to participate in any aspect of patient care."

"But while the city supports the legitimate conscience rights of individual health care professions, the exercise of these rights must be balanced against the fundamental obligations of the medical profession and the right of patients to receive quality patient care," it added.

As an example, San Francisco said it could lose federal money: from Medicaid and Medicare, to HIV treatment and assistance for low-income families.

"Health-care providers are sworn to put patients first and to do no harm," said Christine Keeves, a spokesperson for the San Francisco Lesbian Gay Bisexual Transgender Community Center. "Giving providers an excuse to deny services or treatment to LGBTQ people will exacerbate already prevalent health disparities and put patients last."

The city's lawsuit, filed in U.S. District Court in San Francisco, seeks declaratory and injunctive relief and names the HHS and its Secretary Alex Azar, as well as the director of the agency's Office for Civil Rights, Roger Severino.

The White House referred requests for comment to the HHS.

"The rule provides enforcement tools to federal conscience protections that have been on the books for decades," Severino said in an email statement to CNBC. "The rule does not create new substantive rights."

He added: "We have not seen the hypotheticals that some have used to criticize the rule actually develop in real life. Faith-based providers just like all providers should be allowed to serve those most in need without fear of being pushed out of the health care system because of their beliefs, including declining to participate in the taking of human life."

California Attorney General Xavier Becerra has signaled he's "prepared to do whatever it takes to challenge this rule," according to spokesperson Sarah Lovenheim. Becerra has already filed lawsuits against the Trump administration on other health care issues, including the "gag rule" on abortion.

"The 'conscience' rule creates real confusion around health-care providers' obligations to patients in emergency situations," said Ian Thompson, senior legislative representative for the American Civil Liberties Union in Washington.

"We think that this could put patients in danger when, for example, they are miscarrying or hemorrhaging, experiencing heart failure, or suffering from some other serious complication during pregnancy," Thompson said.

He said an ambulance driver could use the federal law to refuse to transport someone to the hospital in an emergency situation if they thought the person might be getting an abortion.