For more than half a century, Denmark has maintained population-wide demographic, health care, and socioeconomic registers that provide detailed information on the interaction between all residents and the extensive national social services system. We leverage this resource to reconstruct the genealogy of the entire nation based on all individuals legally residing in Denmark since 1968. We cross-reference 6,691,426 individuals with nationwide health care registers to estimate heritability and genetic correlations of 10 broad diagnostic categories involving all major organs and systems. Heritability estimates for mental disorders were consistently the highest across demographic cohorts (average h2 = 0.406, 95% CI = [0.403, 0.408]), whereas estimates for cancers were the lowest (average h2 = 0.130, 95% CI = [0.125, 0.134]). The average genetic correlation of each of the 10 diagnostic categories with the other nine was highest for gastrointestinal conditions (average rg = 0.567, 95% CI = [0.566, 0.567]) and lowest for urogenital conditions (average rg = 0.386, 95% CI = [0.385, 0.388]). Mental, pulmonary, gastrointestinal, and neurological conditions had similar genetic correlation profiles.