The gemara Nedarim 39 cites a “remez” from the pasuk in our parsha ‘Im k'mos kol adam y’musun eileh u’pekudas kola dam yipakeid aleihem…’ (16:29) that there is an obligation to be ‘pokeid’ and visit the sick. Interestingly, there are two other gemaras that point to completely different sources for the mitzvah of bikur cholim:
1) Sota 14 cites ‘achrei Hashem Elokeichem teileichu’, the obligation to imitate the middot of Hashem, as including bikur cholim – just as Hashem visited Avraham during his post-milah illness, so too we should visit the sick;
2) Bava Metziya 30b cites a derasha on ‘v’hodata lahem es haderech asher yeilchu bah’ to include various mitzvos such as gemilus chessed, bikur cholim, etc.
The multiplicity of sources for bikur cholim may be why the Rambam categorizes it under multiple mitzvos. In Sefer HaMitzvos Aseh 8 the Rambam quotes the gemara in Sota in the context of explaining the parameters of the mitzvah of ‘v’halachta b’derachav’, imitating Hashem’s middot. Yet earlier in Sefer haMitzvos, Shoresh 2, the Rambam illustrates the principle that derashos should not be counted as separate mitzvos by citing Bava Metziya as an example of multiple items all included under one mitzvah of ‘v’ahavta l’reacha kamocha’ (see also Ramban, Shoresh Rishon, p 22 in the standard text). Unlike the BH”G who counted bikur cholim as an independent mitzvah, the Rambam (Aveil 14:2) calls bikur cholim a ‘mitzvah m’divreihem’, implying it is only a chiyuv derabbanan, but adds that it and other chassadim are included in ‘v’ahavta l’reicha kamoch’ - apparently the Rambam’s held bikur cholim is a takanah derabbanan through which one achieves a kiyum d’oraysa of v’ahavta l’reicha kamocha.
The obvious question is whether there is any nafka mina between categorizing bikur cholim as a mitvah of v’halachta b’derachav or a mitzvah of v’ahavta l’reicha kamocha or an independent mitzvah. I don’t have answers myself yet on this one, but will point out a kasha of the shita mekubetzet (nedarim 39) which may hinge on this issue. The shita asks why is it that by bikur cholim the obligation is even for a gadol to visit a katan, despite it being beneath the gadol’s dignity, yet by the mitzvah of hashavas aveida we learn (B.M. 30) that a zakein is patur from a mitzvas aseh which is ‘aino l’fi kevodo’, which involves a diminution of his honor to perform? I'll give you time to mull it over yourself… to be continued.