John Swinney has vowed to fix problems faced by Scotland’s NHS, such as delayed discharge, saying he hopes to reduce the number of Scots on waiting lists by the end of the year.