Coronavirus is spreading an outbreak in the world and the medical staffs have been coming under further strain with increasing in patients referring to the hospital. Real-time health monitoring systems play a critical role in prevention, control the pandemic disease, and enhance the entire health care service delivery in real-time, and influence on visiting the hospital visiting the hospital. In this paper, a hierarchical architecture for the Internet of Things is improved using resource and task management techniques for reducing emergency response time and enhanced the patients’ quality of experiences considering energy consumption, network delay, cost of execution in the cloud and network usage. In this proposed scenario, the task is divided into subtasks and processes depending on their functions with different execution times. This method also has led to improving the fog architecture. This proposed method is modeled are evaluated in terms of the specified parameters, using the iFogsim toolkit. The results showed an improvement of 80 percent in their parameters such as cost of execution, total network usage, and average delays, compared to the cloud and other common architecture.