The GP literally said “giving any medical prominence to gender identity will result in people receiving wrong and potentially harmful treatment” which is categorically false for the reasons the comment you replied to outlined.
Sex assigned at birth is in many situations important medical information; the vast majority of trans people are very conscious of their health in this sense and happy to share that with their doctor.
>Sex assigned at birth is in many situations important medical information
Which is not gender identity. As a result of being trans there may be things like hormone levels that are different than what you'd expect based on biological sex, which is why I say hormone levels are important, but how you identify is in fact irrelevant.
The problem is that over the past few decades there has been substantial conflation of sex and gender, with many information systems replacing the former with the latter, rather than augmenting data collection with the latter.
I think it's pretty clear to see how discrimination is the cause of that. Why would you volunteer information that from your point of view is more likely to cause a negative interaction than not?
In many places I'd seriously question the motives for asking about either in general. Do you really need gender info to write better targeted spam mails for your SaaS product?
So sex, and then also the gender they identify as.
You can’t hide behind an “etc”. Expand that out and the conclusion is you really do need to know who is trans and who is cisgender when doing treatment.
Biological sex, hormone levels, etc.