In the GDPR one of the legal bases for processing personal data is ‘vital interests’. You’d rely on this legal basis if processing is necessary in order to protect the vital interests of the data subject or of another natural person.
You could imagine that a governmental organization has to research who the patient has been in contact with. They would contact those people and would perhaps have to use the name of patient X to verify if there was a contact moment and what that consisted of. Meaning, was it just a situation of being in the same room or area, or was there a handshake or other close encounter? Important questions to ask in order to make a threat assessment and know what appropriate measures to take to lower or eliminate the risks.
If there’s an accident and a person is lying unconscious and cannot give their consent or more importantly, their details, you may need to go through their pockets or phone to get the information. This could be information such as their name, or an emergency contact, allergies or a DNR (Do Not Resuscitate).
Let me know on LinkedIn