OP:
I think what makes this question rather misleading is actually using the term abortion in relation to a life saving procedure in which saving the life of the mother will inevitably result in the death of the child inside her.
When we think of abortion, we typically think of a woman in good health choosing to terminate the life of the baby inside her for reason X, where X is more of a reason of convenience than life.
However, there are circumstances in which a woman's life becomes threatened due to being pregnant. The most obvious example would be an ectopic pregnancy.
In these life threatening situations, I think the moral thing to do is for the doctor to consider both the fetus and the mother as his patients. His goal should be to save the life of both. However, if the fetus is too underdeveloped, then saving the mother may result in the death of the fetus. This is not an abortion, this is a death as a result of an emergency surgery. The doctor should always have the mindset of saving both his patience, but the grim reality is that there are times where he can't.
As for determining whether a woman's life is genuinely at risk or not, that is fairly easy from a medical standpoint.