Detailed reports are certainly written up for anything non trivial. But every single visit to your doctor will have a record. Even if it's a template "has sniffles, told to go home". Not every practice will share their records of course, but it's enough if a small number of them do. As long as the selection is not biased, it should generalise well to whole states / countries. (There's of course a difference here for communicable and other diseases - some will be localised)
This is actually important for them for a few reasons. There's resource allocation (do they look have more teens with STDs or old people with joint pains), there's preventing abuse (did you come in 3 times this month for temporary painkillers), there's helpful history (are you coming with different issues that all add up to something worse), there's history for emergency situations (someone died in a weird situation, was there a related medical issue).