If a doctor is driving past the scene of an accident, do they have an obligation to stop and help?
According to the law in the UK, no. Duty of care only applies where you have actually created the situation through which someone may get hurt. An example of this is driving: the driver has a duty of care to the other road users not to let them come to harm as a result of their actions.
If the doctor chooses to ignore someone who is hurt, then it is called a 'pure omission', and they are not doing anything wrong in the eyes of the law. Similarly, the GMC does not list anything about treating people who are not your patients in the "duties of a doctor"; however, doctors "also have a duty to the health of the wider community", according to the section on responsibilities from the same website. The use of the word community seems to imply that this doesn't apply to harmed individuals, but rather the potential for harm to come to other people.
And yet, if you use the ethical framework I outlined a while ago, it always seems moral to go and help someone in distress (with the exception of the fact that it may not give them much autonomy; however the other 3 principles override that in this case). So while you have no obligation to do it legally, it is the right thing to do. Does that mean you have a moral obligation? I would argue that you do, on the grounds that you are faced with two options: help, or leave. One is morally correct, and the other is wrong. Therefore, anyone who can help should help, regardless of what the law says.
If and when someone does go and help to treat a person who has been injured, it could then be argued that the injured person is a patient, and if anything goes wrong while their rescuer is helping them, it can legally be blamed on the rescuer, even though without them, they might have been in an even worse state.
So it's tricky: help someone in need and face recriminations if you don't get it right, or leave them alone and wait for someone who has a contractual obligation (paramedics, etc). So far, I've never been in a situation like that, but I hope that when the time comes, I'll be able to recognise my skill set without bias and do the right thing.