The Wireless Sensor Network (WSN) is a self-organizing network consisting of a number of sensor nodes located in the monitoring area. One of the main applications of wireless sensor network is in the field of health care and remote patient monitoring. One of the most important challenges of such networks is controlling network congestion and transmitting data in a way that improves quality of service (QoS) parameters. Thus, it increasing grid performance and reducing energy consumption. Energy consumption increases due to various reasons such as unsuccessful delivery of packets to the receiver, congestion in the network, retransmission of packets, and delay in delivery packets to the sink, low received signal strength and so on. Given the importance of some data in the field of health, congestion should be avoided and secure data transmission should be ensured. This study divides the collected data into two groups based on their intrinsic characteristics by presenting a congestion management protocol: 1) critical data 2) non-critical data. The proposed protocol provides a dynamic routing algorithm based on the TOPSIS model for non-critical data transmission. In addition, an algorithm for transmitting critical data through the shortest possible path is also provided based on support vector machines. This improves the network performance through using multi-classification that is obtained from Support Vector Machines. The simulation results indicate that the proposed method works better than other methods and leads to better performance in delay, network performance and power consumption.