For HIPAA law in the U.S., with any kind of medical record data, practitioners can share this with family/friends/caregivers + anyone else the patient chooses if they sign an official release of information form. These usually have an expiration of only so many months or years.
Simple diagram for this would be: all medical data is in a gigantic locked vault that can never be opened for any emergency ever unless emergency services personnel have signed paperwork from the patient.
Unless: patient is unconscious, especially long-term in a coma or otherwise not of sane mind, and/or declared by a court + judge to be unable to take care of their own affairs, in which case someone else may be appointed for that.
Either of those two scenarios could be represented by a key that can open the vault, then move some medical data to a secondary vault with restricted access to only specific people.
Which could be a group of people but they would have to be individually named in most cases I believe to be authorized to have any access to medical data.