A 78-year-old woman with advanced dementia requires a hip replacement following a fractured neck of femur.She lacks capacity to consent.Under the Mental Capacity Act 2005, what is the most appropriate way to proceed?