As expected, the risk of dying by suicide and attempting suicide in those patients who had been admitted as inpatients at least once (OR=12.05 (95% CI, 10.46–13.88) and OR=10.73 (95% CI, 10.03–11.49), respectively) was significantly higher than in the outpatient group (OR=5.88 (95% CI, 4.65–7.44) and OR=3.90 (95% CI, 3.71–4.10), respectively). The risk of death by suicide was similar across ICD versions (OR ICD-8=10.44 (95% CI, 8.60–12.67); OR ICD-9=9.34 (95% CI, 6.57–13.27); OR ICD-10=9.61 (95% CI, 8.12–11.38)). However, the risk of attempted suicide was higher for those individuals who had received an OCD diagnosis based on ICD-9 codes (ORs=7.60 (95% CI, 6.23–9.26)), compared with those receiving an ICD-8 or an ICD-10 code (OR=4.14 (95% CI, 3.14–5.02) and OR=5.45 (95% CI, 5.23–5.67), respectively).