Creation and validation of a linear index to measure the health state of patients with depression in automated healthcare databases