A federal judge in Portland, Ore., has granted a nationwide preliminary injunction disallowing a Trump administration rule requiring immigrants prove they will have health insurance or can pay for medical care before they can get visas.

U.S. District Judge Michael Simon, as The Oregonian reported, halted the directive requiring applicants have plans to be covered by health insurance within 30 days of entering the nation, or have enough financial resources to cover the cost.

President Trump had issued a proclamation in early October requiring immigrants, seeking visas from abroad — not those in the U.S. already, applying for U.S. visas to prove they can afford health care. It didn’t affect lawful permanent residents. It didn’t apply to asylum-seekers, refugees or children.

Hospitals have spent more than $35 billion, or an average of $7 million per hospital, on “unreimbursed services” over the last 10 years, according to the White House.

Under the proposed rule, the required insurance can be purchased individually or provided by an employer, and it can be short-term coverage or catastrophic. Medicaid doesn't count. And an immigrant will not be able to obtain a visa if using ObamaCare subsidies when buying insurance.

“This decision is an important check on the Trump administration’s effort to rewrite our nation’s immigration and health care laws in violation of the boundaries set out in the Constitution,” said Esther Sung, an attorney with the Justice Action Center.

Seven U.S. citizens and a nonprofit organization sued to prevent the rule from taking effect, saying it would block nearly two-thirds of all prospective legal immigrants.

The lawsuit also said the rule would greatly reduce or eliminate the number of immigrants who enter the U.S. with family-sponsored visas.

According to the Migration Policy Institute, a nonpartisan immigration think tank, 57 percent of U.S. immigrants had private health insurance in 2017, compared with 69 percent of U.S.-born, and 30 percent had public health insurance coverage, compared with 36 percent of native-born.

The uninsured rate for immigrants dropped from 32 percent to 20 percent from 2013 to 2017, since the implementation of the Affordable Care Act, according to Migration Policy.

There are about 1.1 million people who obtain green cards each year.

The new restrictions came as immigration and health care are at the forefront of the 2020 presidential race. Democratic candidates repeatedly have decried Trump’s strict immigration policies, and most have touted "Medicare-for-All" or at the very least a public option for health care. Most have even taken it a step further and supported providing health care for undocumented immigrants.