This is an interestingly and painfully complex situation.
There seems little scope for a rule utilitarian resolution here. Take rule utilitarianism to be the requirement to act on a rule which, if adhered to by everyone, would (probably) produce the greatest amount of good.
'Good' can be interpreted in a variety of ways (happiness, pleasure, the satisfaction of interests or preferences among them). Interpreting the nature of good is not the problem here; rather the problem is that no rule of sufficient complexity is likely to be available in this situation. The moral life would be impracticable if rules had to accommodate such detailed circumstantiality.
Then the option appears to be act utilitarianism. I take this to be the requirement to do that action which will (probably) produce the greatest amount of good. 'Good' again is open to latitude of interpretation.
It can only be down to the act utilitarian to think her or his way through the situation and to decide what, all things considered, will produce the greatest good. What that decision will be will depend on assessments of probable consequences (that's built into act utilitarianism as defined above) but beyond that it is too situational for an outsider to fix objectively what the doctor - 'you' - should do. The doctor must trust to 'moral luck' that she or he has made the right, or at least a defensible, act utilitarian decision.
My formulations of rule and act utilitarianism are rough and approximate but more sophisticated and qualified formulations would not deflect the points I've made.
I think a similar indeterminateness, for quite different reasons, impacts the Kantian agent. The clearest light is thrown not by the 'Groundwork' but by 'The Metaphysics of Morals' ('MM'). In MM II.1.9 Kant observes that 'The supreme principle of the doctrine of virtue is : act in accordance with a maxim of ends that it can be a universal law for everyone to have. - In accordance with this principle a human being is an end for himself as well as for others' (MM, tr. M. Gregor, Cambridge, 1996, 157). Familiar stuff but he adds that if the moral law 'can prescribe only the maxim of actions, not actions themselves, this is a sign that it leaves a playroom (latitudo) for free choice in following (complying with) the law, that is, that the law cannot specify precisely in what way one is to act' (MM, II.1.7 : Gregor, 153).
I should argue that whatever maxim the doctor adopts in choosing between the options you identify, that maxim could respect 'The supreme principle of the doctrine of virtue ... : act in accordance with a maxim of ends that it can be a universal law for everyone to have' and treat all the human beings involved as ends for themselves as well as for others.
▻ CONCLUDING REFLECTION
John Rawls in one of his early papers referred to the need, or at least the desirability, of a 'decision procedure' for ethics. Given the need for the ethicist, not to simplify the moral life but to represent its real complexity, I find reassurance in the failure of either utilitarianism or Kantianism to cut a knife through the dilemma you describe and specify a single, determinate solution.
J. Rawls, 'Outline of a Decision Procedure for Ethics', The Philosophical Review, vol. 60, No. 2 (Apr., 1951), pp. 177-197.