IMPORTANCE Psychiatric comorbidities are common among patients with cancer. However, whether or not there is increased risk of mental disorders during the diagnostic workup leading to a cancer diagnosis was unknown.OBJECTIVE To examine the relative risks of depression, anxiety, substance abuse, somatoform/conversion disorder, and stress reaction/adjustment disorder during the periods before and after cancer diagnosis compared with individuals without cancer. DESIGN, SETTING, AND PARTICIPANTS Nationwide matched cohort study from