The residency obligation to renew a PR card is to be resident in Canada 730 days out of the previous 5 years.
Unfortunately the only exceptions to the above rule are for people who work abroad for a Canadian business or the Canadian government, or are the immediate family members of such a person.
One thing to note is that while in Canada, you are not required to maintain a valid PR card. A PR card is only required to re-enter the country. So if your course is less than 5 years, you can always come back to Canada before the expiry of your PR card, live here for two years without leaving, and then apply to renew your PR card.
If your course is longer than the term of your PR card, you will unfortunately lose the ability to maintain your PR. You could complete your training abroad and apply for PR in your own right which should be straightforward for a qualified doctor.