Sidney Blanco, one of the high court judges who ruled against Beatriz, said that “if they intervene and only Beatriz survives” because the fetus could not be saved, then it could be that her doctors “were not committing any crime.”...This is a very old moral principle. I've seen it in the context of discussions of doctor-assisted suicide, where the idea is that the doctor — though ethically prohibited from killing the patient — may give pain relief, even where the consequence of the medication will be that the patient dies, because the point is to relieve the pain and not to end the life.
Beatriz said her doctors would have terminated her pregnancy regardless of what the [Salvadoran] high court ruled, expressing a confidence that they would value her life over that of an unviable fetus.
Ah, yes, here it is:
The principle of double effect; also known as the rule of double effect; the doctrine of double effect, often abbreviated as DDE or PDE, double-effect reasoning; or simply double effect, is a set of ethical criteria which Christians, and some others, use for evaluating the permissibility of acting when one's otherwise legitimate act (for example, relieving a terminally ill patient's pain) will also cause an effect one would normally be obliged to avoid (for example, the patient's death). Double-effect originates in Thomas Aquinas's treatment of homicidal self-defense, in his work Summa Theologiae.