We read in the Catechism of the Catholic Church that: "Each time a Christian falls seriously ill, he may receive the Anointing of the Sick, and also when, after he has received it, the illness worsens" (CCC#1529).
Thus, anyone who is suffering a serious medical illness, or facing a serious surgery), may receive this sacrament. It is not required that death be imminent.
Viaticum (passing over) is the name that refers to the final reception of Eucharist by those who are near death. It is often celebrated in conjunction with the Anointing of the Sick.