Continuing with some sacramental details in the extreme emergency situations, we read:
261. If the dying person wishes, the sacrament of penance is celebrated first. If necessary, the confession may be generic. Because of the emergency situation, viaticum follows immediately. Christians in danger of death are bound by the precept to receive communion. If there is still sufficient time, the anointing of the sick may then be celebrated. The brief rite which follows has been provided for the celebration of these sacraments in such a situation. The priest should judge, in light of the particular circumstances, how much or how little of this rite is possible.
262. After the celebration of the abbreviated rite for emergencies, the priest should continue in prayer with the dying person, if possible, and with the family and friends, as suggested in the “Commendation of the Dying” (PCS 212 ff). When death has occurred, some of the prayers suggested at the end of the “Commendation of the Dying” may be said with the family and friends.
The pastoral judgment of the priest is important. More than the good ol’ red-n-black.
Though we know that anointing isn’t just about healing, note that it still has third position in the sacramental priorities at the time of death.