Robin Williams played a physician most memorably in Patch Adams (1998)—the true-story dramedy about Hunter "Patch" Adams, who founded the Gesundheit Institute and pioneered humor-as-medicine. Williams' blend of manic energy and deep empathy was perfectly cast.
If you're thinking of a specific scene—red nose, clowning in a children's ward, "laughter is the best medicine" speeches—that's Patch Adams. For anything else, let me know the details.