Universal health care and centralization of patient records would probably be required to do what you’re talking about.
If scientists actually could mine everyone’s data easily it would be a lot easier to do stuff like this. Privacy laws and the fact that so much of the medical system is disconnected from itself get in the way - it’s normal for every new doctor to ask the same questions again because there’s no reliable way to share information.