According to the Catechism of the Catholic Church:
1532 The special grace of the sacrament of the Anointing of the Sick has as its effects:
- the uniting of the sick person to the passion of Christ, for his own good and that of the whole Church;
- the strengthening, peace, and courage to endure in a Christian manner the sufferings of illness or old age;
- the forgiveness of sins, if the sick person was not able to obtain it through the sacrament of Penance;
- the restoration of health, if it is conducive to the salvation of his soul;
- the preparation for passing over to eternal life.
The sacrament of confession is part of the anointing of the sick if someone is able to confess. If someone is too ill to confess their sins then their sins are forgiven in the anointing. I can find nothing that states an obligation to go to confession if the patient recovers. However, if it brings spiritual comfort to confess then someone is always allowed to do so.