There are some pretty big longitudinal studies with consent ( "45 and up" are a quarter of a million people, for example - that's big enough that working predictions within the cohort would be a worthwhile health outcome).
There are nevertheless privacy issues, which I did not address as my first comment was already very long, especially for a tangent. Most obviously, people would be consenting to the collection of data whose significance they cannot reasonably forsee.
I do agree that most current AI companies are unlikely to be a good steward of such data, and the current rush to give away health records needs to stop. In a way it's a good thing that health records are currently so limited, since the costs will so obviously outweigh the benefits.