You can buy most meds in Lhasa the problem will be trying to communicate to get the right medication( I remember struggling for 20 mins trying to get nifidipine in Lhasa and then the guy behind the counter then telling me the slow release was better even though he never asked me what it was for). So it would be better to get them prior to leaving.
Most doctors won't know a lot about higher altitude but I know some do, it can be a little hit and miss, but fairly easy for them to find out more. Remember the best treatment for AMS etc is to go down.