A 78-year-old woman in a care home is noted to be acutely confused, drowsy and disorientated over 24 hours. She is usually independent with mild memory problems. Examination shows tachycardia, fever and an infected leg ulcer. What is the most likely diagnosis?