We examined whether diabetic polyneuropathy (DPN) and diabetic foot ulcers in type 2 diabetes can be accurately identified using International Classification of Diseases, 10th revision discharge diagnosis codes, surgery codes, and drug prescription codes. We identified all type 2 diabetes patients in the Central Denmark region, 2009-2016, who had ≥1 primary/secondary diagnosis code of "diabetes with neurological complication" (E10.4-E14.4), "diabetic polyneuropathy" (G63.2), or "polyneuropathy, unspecified" (G62.9). Patients with potential painful DPN and non-painful DPN were identified based on prescription history for serotonin-norepinephrine reuptake inhibitors, tricyclic antidepressants, or gabapentinoids. Likewise, type 2 diabetes patients with potential foot ulcers were identified based on diagnosis or surgery codes. We used medical record review as the reference standard and calculated positive predictive values (PPVs). Of 53 randomly selected patients with potential painful DPN, 38 were classified as having DPN when validated against medical records; of these, 18 also had neuropathic pain, yielding a PPV of 72% (95% CI: 58-83%) for DPN and 34% (95% CI: 22-48%) for painful DPN. Likewise, among 54 randomly selected patients with potential non-painful DPN, 30 had DPN based on medical record data; of these, 27 had non-painful DPN, yielding PPVs of 56% (95% CI: 41-69%) and 50% (95% CI: 36-64%), respectively. Secondary E-chapter codes often denoted stroke or mononeuropathies, rather than DPN. Excluding secondary E-chapter codes from the algorithm increased the PPV for DPN to 78% (95% CI: 63-89%) for the painful DPN cohort and to 74% (95% CI: 56-87%) for the non-painful DPN cohort. Of 53 randomly selected patients with potential diabetic foot ulcer, only 18 diagnoses were confirmed; PPV=34% (95% CI: 22-48%). G-chapter and primary E-chapter diagnosis codes can detect type 2 diabetes patients with hospital-diagnosed DPN, and may be useful in epidemiological research. In contrast, our diabetic foot ulcer algorithm did not perform well.