[Warning: I’m no lawyer, nor doctor] It depends on the country. At least in Brazil this wouldn’t roll:
Article 135 of the Penal Code - demands you to render aid to people under grave danger, as long as it won’t incur in risk for you. That applies to everyone, not just doctors, but if you’re a doctor it becomes really hard to explain why you didn’t render aid.
Article 33 of the Medical Ethics Code - forces the doctor to render aid to someone seeking urgent or emergent professional care, when there’s no other doctor in a position to do so. Note that failure to follow ethics codes can make a professional unable to exert their profession legally.
[Warning: I’m no lawyer, nor doctor] It depends on the country. At least in Brazil this wouldn’t roll: