It's not really fine. I work on a Healthcare system in the nordics.
Who you billed, who visited what doctor, who your primary care provider is, all the people a doctors office has as patients, refers to the SSN.
You don't want to lose that connection or to have to update everything for any change.
You store a unique identifier for the person in the system, and you can then pull the actual personal identification number when needed.
You do not keep individual private lists of people changing genders.