The effects of depression and chronic pain on psychosocial and physical functioning.