Uncertainty in US immigration policy is being blamed for the decline in foreign applicants to residency programs at American hospitals.

According to preliminary numbers from the Electronic Residency Application System (ERAS), the number of applications from international students fell for the second year in a row.

International graduates make up about one-third of total overall applicants, and a quarter of the ones finally admitted into US programs. Foreigners ultimately represent roughly 26% of licensed physicians, 40% are primary care doctors. More than half of people caring for the elderly are foreign medical graduates.

In last year’s recruitment cycle, travel restrictions kept more than 500 applicants from Muslim countries from getting visas. Modification to the restrictions in September this year further stoked uncertainty.

Program directors at hospitals are concerned that foreign applicants might not be able to get visas, and they fear they may lose doctors. In a 2016 survey, 42% quoted “visa status” as an important factor in deciding whether or not to interview applicants.

William W. Pinsky, the president of Educational Commission for Foreign Medical Graduates, voiced concern that the US might be viewed as an unwelcoming destination for future physicians.

“We are heading into a second resident recruitment season with a great deal of uncertainty… One challenge for programs will be to continue to select the best and the brightest, without regard to nationality, in order to continue to produce the best physicians possible.” Pinsky said.

As part of the visa requirement, most foreign doctors who want to stay in the US after residency programs have to work in areas short of healthcare professionals. The hospitals that have these shortages tend to be places where US citizens are not interested in living or working. This means that if the number of foreign medical professionals decline, the first ones to feel the impact will be the elderly and the poor in far-flung rural areas.