Disease classification is fundamental to clinical practice, but current taxonomies do not necessarily reflect the pathophysiological processes that are common or unique to different disorders, such as those determined by genetic risk factors. Here, we use routine healthcare data from the 500,000 participants in the UK Biobank to map genome-wide associations across 19,628 diagnostic terms. We find that 3,510 independent genetic risk loci affect multiple clinical phenotypes, which we cluster into 629 distinct disease association profiles. We use multiple approaches to link clusters to different underlying biological pathways and show how these clusters define the genetic architecture of common medical conditions, including hypertension and immune-mediated diseases. Finally, we demonstrate how clusters can be utilised to re-define disease relationships and to inform therapeutic strategies.