Growing up, Denisse Rojas Marquez rarely visited the doctor. As undocumented immigrants from Mexico, her family viewed medical care as a luxury and sought it only in emergencies.

“I would always wait until it was very severe to see a doctor,” said Ms. Rojas Marquez, who came to the United States as a toddler. “That’s still a mentality I have to train myself out of. Growing up, going to the doctor meant very expensive bills and navigating through very complex systems.”

At 26, Ms. Rojas Marquez is determined to become a physician and help bridge the gap between undocumented immigrants and medical care. She is close to making that dream a reality because of a 2012 policy called the Deferred Action for Childhood Arrivals ( DACA), which protects undocumented immigrants brought to the United States as children from deportation and offers access to work authorization. The policy enabled Ms. Rojas Marquez to become one of the first undocumented students to attend the Icahn School of Medicine at Mount Sinai in New York.

But the fate of Ms. Rojas Marquez’s medical education is in flux as the U.S. Supreme Court considers protections for undocumented immigrants in the case of Texas v. United States . In dispute is the constitutionality of two of President Obama’s immigration policies: the Deferred Action for Parents of Americans and Lawful Permanent Residents ( DAPA ) and expanded DACA . The former protects undocumented immigrants who are parents of U.S. citizens from deportation, if they meet certain criteria. The second extends work authorization under the original DACA program from 2 years to 3 years and broadens age requirements.

Texas and 25 other states have sued over the programs, arguing the president does not have the authority to issue the new immigration policies, and that the programs violate the Constitution as well as the Administrative Procedure Act for notice-and-comment rule making. High court justices heard oral arguments April 18.

The ruling could impact the growing number of medical students with DACA status across the country, and jeopardize the funding invested in their training. Sixty-one medical schools now accept applications from DACA applicants, according to data from the Association of American Medical Colleges (AAMC). In 2015, 46 students with DACA status applied to U.S. medical schools and 20 were enrolled. In 2016, more than double (112) applied, although enrollment data will not be available until year’s end. Neither AAMC nor the National Resident Matching Program collect data on residents with DACA status.

A high court ruling in favor of the states could lead to DACA’s undoing, said Michael M. Hethmon, an attorney for the Immigration Reform Law Institute in Washington, D.C. The institute issued a brief to the Supreme Court in support of Texas.

If Texas prevails, “it’ll be a matter of weeks before a similar challenge will be levied against DACA and a number of other related programs,” Mr. Hethmon said in an interview. “There will be no more legal justification for those programs that exist.”

Saving talent or wasting money?

Loyola University in Chicago has accepted more students with DACA status than any other U.S. medical school. The reasons are simple, said Mark Kuczewski, Ph.D., chair of medical education at Loyola’s Stritch School of Medicine.

“We’re in the business of taking outstanding students,” Dr. Kuczewski said in an interview. “If the student is outstanding, we want them in our applicant pool. Second, being bilingual and bicultural is extremely important. We have patient populations out there that are diverse and underserved. We want to utilize this talent.”

In the fall of 2014, Stritch enrolled seven medical students with DACA status; in 2014, they doubled that enrollment. The students competed on the same playing field as other applicants and received no special treatment, Dr. Kuczewski said.

DACA students do pose funding challenges, he acknowledged. Although the students are protected from deportation and receive work authorization, they don’t qualify for federal student loans. Medical schools must find unique ways to help DACA students finance their education. A major Catholic health system provides student loan packages for several DACA students at Stritch, Dr. Kuczewski said. DACA students can also apply for financial assistance through an AAMC assistance program.

“Medical students use copious amounts of federal student loans,” he said. “Somehow the school has to make up that difference. We’ve found partners, but they don’t have infinite capacity, so we have to keep going back and finding new partners each year.”

The University of California, San Francisco, also has opened its doors to DACA students. Now in his third year, Jirayut New Latthivongskorn is UCSF’s first undocumented medical student. His education is financed by grants, private funding, and donations, said Mr. Latthivongskorn who came to the United States from Thailand when he was 9 years old. He is cofounder of Pre-Health Dreamers , a network of undocumented students who plan to pursue medical careers.

Before DACA granted his entry into UCSF, Mr. Latthivongskorn was accustomed to barriers because of his undocumented status, including having to turn down a nearly full-ride scholarship from the University of California, Davis, after high school.

“It was devastating,” Mr. Latthivongskorn said in an interview. “It was one of the very first times where I felt different and thought, ‘This is not going to work. You are undocumented.’”

Mr. Latthivongskorn and his family scraped together money for him to complete his undergraduate degree at the University of California, Berkeley. California has since passed the DREAM Act, a law that allows undocumented immigrants to receive private scholarships funded through public universities.

Not everyone believes undocumented immigrants should get the chance to become U.S. physicians. Dr. Jane M. Orient, executive director of the Association of American Physicians and Surgeons, argued that undocumented immigrants are not the answer to curbing the physician shortage.

“In a country that’s supposed to be ruled by law, it seems incomprehensible that people who are violating the law should be given privileges over people who are here legally,” she said in an interview. “We desperately do need more physicians, but we should not be blocking Americans from having this opportunity.”

Dr. Shirie Leng, a Boston anesthesiologist, said DACA is promising in theory, but falls short in practical application.

“There’s no particular reason why [undocumented students] wouldn’t make great doctors,” said Dr. Leng. “The problem is funding related. You can give kids all the opportunity you want, but if you can’t pay for it, that seems to me to be the biggest sticking point.”

Basing admission policies on programs that are vulnerable could end poorly for schools and students, Dr. Leng added.

If DACA is revoked, “it’s not just a waste of money for the school, but a waste of time for the kids,” she said.

Protections hinge on Supreme Court … and next president

During oral arguments earlier this month, justices appeared to disagree on whether DAPA and expanded DACA were properly executed.

Associate Justice Anthony M. Kennedy indicated that the normal order of government policy making had been “turned upside down,” by the creation of the programs. Associate Justice Sonia Sotomayor, meanwhile, noted that immigration policies with broader reaches have been similarly instituted in the past.

A ruling for the government would mean the president can use his executive power to enact policies that run contrary to immigration laws already in place, said Mr. Hethmon, the D.C. attorney. Current immigration laws trump informal agency discretion and do not allow for the government’s “arbitrary and capricious creation of a massive classification of nonstatus alien beneficiaries,” Mr. Hethmon wrote in his high court brief .

A decision that favors Texas would unravel opportunities for undocumented immigrants and prevent their ability to contribute to society, said Ignacia Rodriguez, a legal fellow at the National Immigration Law Center, which authored a brief in support of the government.

“What’s at stake is providing a stable environment for U.S. citizen children to grow, and providing people with the opportunity and tools to be able to contribute to the workforce [and] to the economy,” she said in an interview. “This is a payoff for everybody, not just those receiving the benefit.”

Regardless of what the Supreme Court decides, the next president could have the last word, according Ashley C. Parrish, a Washington D.C. attorney who cowrote a brief in support of the states. Mr. Parrish takes no position on the merits of the immigration programs, but rather, he is concerned with the administration’s failure to follow the Administrative Procedure Act’s requirements for notice-and-comment rule making.

“If the program were adopted as a legal rule after notice and comment, it could not be changed without going through a new notice-and-comment process,” he said. “If it is just a bare statement of policy, it can be changed at any time, without notice to anyone. The next administration could say, ‘Thank you for coming out of the shadows; we are now going to deport all of you.’ ”

Among the Democrats running for president, former Secretary of State Hillary Clinton has said she will defend DACA and Sen. Bernie Sanders (I-Vt.) has said he supports DACA and DAPA, and plans to expand them if elected.

Conversely, presumed Republican presidential nominee Donald Trump has indicated he would rescind DACA and related programs if elected.

After spending most of her life terrified of deportation, Ms. Rojas Marquez said she is not wasting time worrying about the Supreme Court’s decision or whether the next president will overturn the policy. She is keeping her studies foremost in her mind and the goal of becoming a doctor firmly in her heart.

“I have always lived with what-ifs,” she said. “This time around, I’m not going to be living in fear of the removing of DACA, because I wouldn’t have made it this far if I always lived in fear. My plan is no matter what happens, I’m going to finish medical school, and from there, I pray that I will be able to practice in the U.S.”

The Supreme Court is expected to issue its decision by June.

Click here to watch a related video.

On Twitter @legal_med