I suspect it’s not possible to build it. The problem isn’t code, it’s law. HIPAA compliance is a requirement. The patient would need to sign off on each request for information about their health, and the entities who have the information will require that approval. If there is not a system in place for them to share this information, they’re not going to create it for you.
IANAL or a Medical professional. I do work for a company that’s decided not to do what you are thinking about though.
Why can’t I be both?