Determinants of quality of life in patients with advanced cancer