Cognitive-behavioural problem solving in the treatment of patients attending a medical emergency department: a controlled trial