Rav Eliezer Waldenberg (Israel, 1915-2006), in his treatise "Ramat Rahel," cites the ruling of the Shulhan Aruch that one should not visit an ill patient if this would cause the patient inconvenience. Although there is an obligation of Bikur Holim, to visit ill patients, it applies only when the visit would be beneficial to the patient, but not when a visit would cause him further grief. At times a patient is not in the condition or the mood to entertain guests, and sometimes his family members are not in a position to have company. One who wishes to visit an ill patient must therefore take this into consideration when planning the visit, and ensure to visit at a time when he would be assisting the patient in his time of need, rather than contributing further to his distress, Heaven forbid.
The work Leshon Hachamim gives the example of a wealthy, prominent person who is not accustomed to welcoming townspeople in large numbers in his home. If such a person takes ill, it would certainly cause him hardship and inconvenience if everybody in the community comes to visit him. Therefore, only those who are close to the individual and can ascertain that their visit would be beneficial should visit the ailing patient.
Interestingly, the Hafetz Haim (Rabbi Yisrael Meir Kagan of Radin, 1839-1933), in his work Ahabat Hesed, laments the fact that many people incorrectly excuse themselves from this great Misva of Bikur Holim because of this Halacha. Rather than carefully consider whether they could assist the patient by visiting, many people simply assume that a visit would inconvenience the patient, and therefore decide not to go. The Hafetz Haim urges us to assess each situation honestly to make the best decision, and not to carelessly excuse ourselves from this very important Misva.
Rav Waldenberg notes that in principle, the obligation of Bikur Holim applies to every member of a community anytime somebody in the community takes ill. Many people erroneously assume that they bear the obligation to visit only patients whom they know personally, such as friends and family members. In truth, however, the entire community bears the obligation to visit every sick patient in the community. Of course, in large communities, visits by every member would cause the patient considerable hardship. Rav Waldenberg therefore advises every community to establish a Bikur Holim society, a volunteer group that would ensure that every ill patient in the community has visitors and people caring for his needs. These volunteers function as the Shelihim (representatives) of the community, so that everyone in the community fulfills his obligation through the visits made by these volunteers. Rav Waldenberg compares this arrangement to the "Ma’amadot," the rotation of Jews who observed the sacrificial offerings in the Bet Ha’mikdash. Since these offerings were brought on behalf of the entire nation, it was necessary for the nation to have representatives present at the time of the offerings, so that all members of the nation could fulfill their obligation through these representatives. Likewise, Rav Waldenberg writes, every community must establish a Bikur Holim society to fulfill the community’s obligation of Bikur Holim every time somebody takes ill.
Of course, this does not mean that people should not pay personal visits, as they fulfill their obligation through the Bikur Holim volunteers. People in a position to help an ill patient must certainly do so, even if there are already volunteers caring for the patient.
Summary: One should not visit an ill patient if this would cause him inconvenience. In principle, everyone in the community bears an obligation to visit every ill patient in the community. It is therefore imperative for every community to establish and maintain a Bikur Holim society to fulfill the community’s collective obligation to visit and care for sick patients.