The pastor at my parish gave the sacrament of the anointing of the sick to a woman who was about to have surgery for tennis elbow. He explained that “this sacrament can be conferred for even the most routine surgery.” This did not sound right to me. The Catechism says the sacrament is for those who have “grave illness” and who are “in danger of death.” Aren’t both of those conditions required in order to receive the sacrament?
Without a citation, I do not know the paragraph of the Catechism of the Catholic Church to which you refer, but here are a couple of paragraphs that are relevant to the question at hand:
The anointing of the sick "is not a sacrament for those only who are at the point of death. Hence, as soon as anyone of the faithful begins to be in danger of death from sickness or old age, the fitting time for him to receive this sacrament has certainly already arrived" (CCC 1514; emphasis added).
If a sick person who received this anointing recovers his health, he can in the case of another grave illness receive this sacrament again. If during the same illness the person’s condition becomes more serious, the sacrament may be repeated. It is fitting to receive the anointing of the sick just prior to a serious operation. The same holds for the elderly whose frailty becomes more pronounced (CCC 1515; emphasis added).
Thus, while danger of death is indeed a consideration to be evalutated for the offering of the sacrament of anointing, it may be offered when the priest may reasonably anticipate a danger of death and not just when death is obviously at hand.
That said, please do not underestimate the seriousness of “routine surgeries.” General anesthesia is a formidable procedure, in which a person is administered potentially deadly drugs that bring him to an unconscious state, in which he must be carefully monitored by a medical expert in the field. Simply because those medical experts of anesthesia have mastered the science to the extent that the procedure may indeed be called “routine” does not mean that there does not remain risk to the patient. Thus, even for “routine surgeries” priests routinely offer the anointing of the sick.