Lets see.. I am in extreme pain, whatever my plans for the immediate future were, they are screwed , and you want me to exchange pleasantries and be cordial with visitors?
Maybe its an INTJ thing, or more generally an introvert thing, but interacting with people takes effort. Its not uplifting.. its exhausting. I am sure there are some who benefit from the constant stream of well-wishers. But I also know that I wouldn't and there are others like me. Asking the patient what they would prefer ( if they are capable of answering) is probably best, and if they can't answer, I think Septugenarian's quote is right on.
Your real friends and family are those whom can see you at your worst - mentally, physically, and still love you and accept you, even if you are incapable of currying to their feelings and expectations or even giving a crap about them right now.
I would simply tell well wishers that he isn't up to seeing people right now.. and any person who actually cares about him will understand that.