A Task Scheduling Algorithm for Optimizing Quality of Service in Smart Healthcare System