Here's the link.
Ectopic pregnancy is when the fertilized ovum migrates to the outside of the fallopian tube and attaches outside the uterus. Presently, there is no known procedure by which the life of the unborn child may be saved. Frequently, if not typically, the mother's life is endangered.
There is at present no way to save the life of the child, which will die imminently if not already. Therefore any medical action taken is considered in regard to the mother, to save her life. There is nothing the mother can do to save the life of her child.
Surgery to remove the fetus does not change the prognosis for the fetus, but can possibly save the life of the mother.
It is right to grieve the loss of the child, and to be comforted in the loss of your child.