Likewise, let those medical students who want to be private practice ophthalmologists in the suburbs of San Francisco take out loans to pay tuition. But the university could demand no payment from those, for example, who commit to becoming primary care doctors and agree to take Medicare and Medicaid or specialists willing to practice in poor areas with doctor shortages.

I know that many young people are not sure of their chosen path when they enter medical school. But there are simple ways to adjust the concept.

How about all medical schools commit to forgiving or paying back the loans of young doctors who go into lower-paying fields or set up practice in underserved areas — and keep doing so as long as they stay there?

The government could reasonably demand such a system from academic medical centers as a precondition for receiving federal subsidies and payments. After all, many receive billions from the government and pay little if any tax because the I.R.S. allows them nonprofit status , in part because they provide “community benefit.”

So if a student chooses to become an ear, nose and throat surgeon in suburban New York or a private cardiologist in Miami, fine. He or she can pay back what has been borrowed. But if that doctor chooses to deliver babies in rural Oklahoma or practice pediatrics on the South Side of Chicago, then he or she should get to keep every penny of salary.

The federal government and some states, as well as the military, already subsidize medical school tuition or pay back loans in exchange for limited-time service commitments. But that promotes a tour-of-duty mentality. They are also poorly funded and cover a relatively small number of students .

The real goal is not short-term payback but to enable and support young doctors who feel that treating patients is a calling, regardless of the patients’ ability to pay.