Creating an index to measure health state of depressed patients in automated healthcare databases: the methodology