If it had been Last Unction, I think they get to bend the rules. But if it's just Anointing of the Sick:
http://catholicism.about.com/od/beliefsteachings/p/Sac_Anointing.htm
Received in faith and in a state of grace, the Sacrament of the Anointing of the Sick provides the recipient with a number of graces, including the fortitude to resist temptation in the face of death, when he is weakest; a union with the Passion of Christ, which makes his suffering holy; and the grace to prepare for death, so that he may meet God in hope rather than in fear. If the recipient was not able to receive the Sacrament of Confession, Anointing also provides forgiveness of sins. And, if it will aid in the salvation of his soul, Anointing may restore the recipient's health.
When it's not possible to confess (Sacrament of Penance), Anointing is supposed to accomplish the same thing, but it only works if the recipient is in a state of grace and has repented sins.
I think they are allowed to presume that if the patient is in extremis, but not in a case like this.
And Catholics are supposed to believe not only that Communion has to be taken in a state of grace, but that if you do take Communion when you are not in a state of grace, it may be a cause of damnation, which is why priests aren't supposed to give Communion if they know you are not in a state of grace.
So in theory according to Catholic doctrine, if this guy had been near his last breath and unable to speak, the priest could administer Last Unction and Viaticum, but otherwise he has to do it right to make it work at all.
Which is why the priest the man called after getting out of the hospital told him the chaplain was right.