New Judge and naoim, I was addressing the point raised on the OP and trying not to get tangled up in the birth sex/gender stuff.
If asked whether I am male or female in a hospital, I would either give a straight answer of come up with a silly, but correct response along the lines of "I'm pretty sure the dangly bits mean I'm male" rather than get upset at being asked something to which the answer is obvious. That's not really rocket science.
With regard to New Judge's point about different treatemnt regimes for men and women with the same condition, I will just point out that ther are people who were born male and are now legally female and people who were born female and are now legally male. If it means that staff at hospitals need to ask seemingly stupid questions in order to determine the correst treatment regime for someone who may have switched gender, so be it. Sure, some of the questions may sound daft, but the answers are important for both the medical staff and the patients.
Finally, as for the case New Judge seems to wheel out every time the biological sex/gender issue is raised - it should never have happened, but it did. "Never happen" events occur every day in hospitals, which is one reason forms and checks get longer all the time. I can only hope that the hospital where that happened has learnt a lesson and is far more careful in the future, and that other hospitals do so as well.