Visiting the Sick

There is a machlokes Rishonim whether the mitzvah of bikur cholim is m’d’oraysa or m’d’rabbanan. It is based on the understanding of a passage in Bava Metzia (30b).
“Rav Yosef taught a baraisa concerning the verse: ‘And you shall teach them the statutes and the laws, and shall show them the path wherein they shall walk and the action that they must perform’ (Exodus 18:20).’” The baraisa parses the various directives in the verse. “... “the path” is referring to acts of kindness; “they shall walk” is referring to visiting the ill.” Since the mitzvah of visiting the sick is derived from a pasuk, the Ramban in his Sefer HaMitzvos concludes it is a biblical mitzvah. However, the Rambam nevertheless concludes that bikur cholim is actually a rabbinic mitzvah. Still, one fulfills the Torah mitzvah of chessed by visiting the sick.
The Tur cites two primary reasons for the mitzvah of bikur cholim. The first is that the visitor should attend to the needs of the sick individual. The second is that the visitor should pray for the choleh. Indeed, the Rema (YD 335:4) declares: Anyone who visited a sick individual and did not pray for him has not fulfilled the mitzvah! The Levush and Chochmas Adam conclude that that Rema must hold that the primary reason for the mitzvah of bikur cholim is to daven for the sick individual.