I love to have people over, and I would be very upset if someone I'd invited arrived and found there was nothing they could eat!
One friend is a woman who is on a very strict low-fat diet, and I always made sure that there was plenty for her to choose from. I even cook a portion of the main meal just for her with no fat, etc. (Even tho I don't believe low-fat diets work! LOL)
Another friend can't have anything with soy, so I'm always careful to check labels when he's coming to dinner!
From the host's point of view, I'd want to know if there are restrictions.....if I didn't want to accomodate them, I wouldn't invite you! I can't think of anything more upsetting than inviting someone to dinner and then have them leave hungry because of the menu!
As for explainations, you don't need to say anything more than what your restrictions are. Saying the doc put you on this diet is easier....but you certainly don't need to give your diagnosis, let alone a history of your problems! People that ask questions are rude and nosey, and you don't have to answer them!
"I'm allergic" is also very helpful! People can be allergic to just about anything....and if you say you're severely allergic to something, that usually does the trick! (I use this in restaurants to prevent mayo on my burgers! Ick!)
If the host is a buisness aquaintance, or someone you don't know well, just bring something with you....seldom do hosts object when someone brings another dish! And that means there will be at least 1 thing you can eat!