This may possibly be the most idiotic thread I've ever read. Don't people have anything better to do with their time than get their knickers in a twist over a stupid salutation?
I don't think it's too much of a stretch to say that you should "instictively" be able to figure out a person's expectation while you're walking up to introduce yourself to them. If they smile, laugh and extend their hand to say, "Hi, I'm X, one of your residents", then you can chill.
If you walk up to them, and extend your hand politely, and say "Hello, I'm X, your medical student", and they snort at you over their clipboard, you can pretty much resign yourself to addressing them as "doctor".
BTW, I would think that any person who has graduated medical school, whether intern, resident or attending, has earned the honor of being called "doctor" if they want to, but I'd think that anybody who wants to be called such in private by a colleague is in need of a de-sticking.
***crap, I'm dragging myself into the world's stupidest thread... later***