(CNN) Health experts warn that recent health care and immigration policies could worsen an ongoing doctor shortage, raising the question of why the federal government doesn't train more doctors in the first place.

Some physicians' groups continue to call for an increase in the federal funding of medical residency programs, the training that doctors get after medical school in specialties like surgery and pediatrics. These funds, which were capped by the 1997 Balanced Budget Act, are predominantly financed by Medicare in the vicinity of $10 billion.

"Everyone always thought that that cap was going to be lifted," said Dr. Janis Orlowski, chief health care officer of the Association of American Medical Colleges. "Twenty years later, that cap is in place."

To train residents at teaching hospitals, the federal government budgeted over $10 billion of mandatory funds in 2016, about 90% of which came from Medicare and the rest from Medicaid, according to the Congressional Budget Office. Additional voluntary funding may come from private sources and other government agencies, such as the Department of Veterans Affairs.

Orloski said teaching hospitals also contribute to cost of residents, especially when they exceed the number of residents allotted by the cap.

instead, the number of international doctors entering US programs went down, and the number of US graduates who were not accepted went up, said Orlowski. Attempts at passing legislation to remove the cap have been unsuccessful. Medical school enrollment jumped 27% between 2002 and 2016, according to the association. But due to the cap, this did not result in 27% more doctors being trained in the US;instead, the number of international doctors entering US programs went down, and the number of US graduates who were not accepted went up, said Orlowski. Attempts at passing legislation to remove the cap have been unsuccessful.

"It is a difficult time right now, as the (Affordable Care Act) and the repeal and replace are being discussed," Orlowski said.

Although there has been little direct mention of residency funding, she said, it could be a target for spending cuts.

A new analysis commissioned by the Association of American Medical Colleges predicted a doctor deficit of 40,800 to 104,900 by 2030.

"I have to say that we are concerned," Orlowski said.

Spots to fill

Even with the increase in American medical students, there are fewer of them than there are residency spots.

osteopathic students submitting applications, according to the Last year, just over 18,000 graduating MDs vied for nearly 28,000 first-year residency slots, with a much smaller number ofosteopathic students submitting applications, according to the National Resident Matching Program . This year's numbers will be announced on Friday, when the next batch of medical school graduates will find out where they are headed.

The rest of the positions are filled largely by foreign doctors and US citizens who have studied abroad, many in Caribbean medical schools. Just over 50% of each group who applied to American programs matched into one.

A number of health care organizations also expect nurse practitioners and physician assistants to take on some of this workload, but a shortage of primary care doctors will persist, Orlowski said.

Barriers to health care access are not evenly distributed throughout the medical system, experts say, though some disagree on whether the solution involves training new doctors.

"A good question is, 'What kinds of doctors should we be training?' " said Dr. Elliott Fisher , director of the Dartmouth Institute for Health Policy and Clinical Practice.

Fisher, who helped develop the accountable care organization model, said residency training "responds to the market." Hospitals may be incentivized to fund training programs that perform profitable procedures, such as orthopedic surgery, whose doctors are not in short supply, he said. There's less financial incentive to invest in specialties like primary care, which are experiencing a shortage.

"That's expensive and probably harmful public policy," added Fisher, whose own work has argued that more doctors and higher health care spending do not actually result in better access and health outcomes.

The relative shortage of primary care and rural doctors also reflects doctor preference, said Orlowski; differences in salary, work hours and lifestyle may draw some away from where they are needed most.

In addition to primary care doctors, Orlowski said, some other specialties -- such as general surgery and psychiatry -- also fail to fill regional needs.

"There are opportunities. There are jobs," she said. "I'm not sure we have a magic answer to that."

What doctor shortage?

Some experts such as Fisher disagree that there's even a doctor shortage in the first place.

The country needs more primary care doctors, Fisher agreed, but the remedy has more to do with redistributing doctors, making health care more efficient and changing the financial incentives that drive health care in its current direction, he said.

In 2014, the Institute of Medicine released a report arguing against a change in residency funding. The report, which denied an overall doctor shortage, called for other major changes to residency training, such as weaning slowly off Medicare and reconsidering whether residents train predominantly in teaching hospitals. Most health care is delivered outside the hospital, according to the report.

"Our training programs are at least three giant steps behind ... where health care seems to be moving to," said economist Gail Wilensky, co-chairwoman of the Institute of Medicine committee that released the report and former director of Medicare and Medicaid programs under President George H. W. Bush.

"There's obviously a lot of pressure to keep doing what you're doing in terms of federal funding," she said.

The report also called for increased transparency and accountability. Wilensky said that, while the report was being put together, several medical centers opened their financial records to the research team, but the data were insufficient to track the flow of funds and revenues of their residency programs.

Experts on both sides say they recognize the importance of increasing health care access through more efficient care, better allocation of resources and the use of technology. But there is no consensus on whether training more doctors is a part of that plan. The problem of access is interpreted on one side as partly a lack of physicians; on the other, it is purely a systemic problem -- one caused by inefficiency and waste, poor distribution of resources, a lack of transparency and the accumulation of unnecessary care and costs.

"We disagree with the IOM report, and we agree with it," Orlowski said. "We agree ... that we are not going to solve the physician shortage by just increasing the number of doctors."

Join the conversation See the latest news and share your comments with CNN Health on Facebook and Twitter.

But when it comes to the prospect of training more doctors, she said, there's more at stake than health care alone.

"If you take a look at teaching hospitals, they are the economic engines for many towns," she said.

"It's not just a cost, but it's truly an investment in the infrastructure of our cities and our states."