Wireless body area sensor network is a special-purpose wireless network that, employing wireless sensor nodes, is located within the human body area and transmits his vital signs. A node, placed on or near the human body, functions as the sink to collect data and finally transmit the captured data toward the central station. Here, we assume that sensors are fixed on the patient’s body, all sensors are capable of sensing and transmitting solely a certain type of vital signs data, all sensors serve both as routers and as data-generating sources, and there is no particular node serving as a relay. Network lifetime and energy consumption have significant role in WBASNs. In this paper we present a mixed-integer programming problem to balance energy consumption and maximize network lifetime. We introduce this model based on the initial energy, the energy received and transmitted by sensors, the rank or significance of sensors, the reliability of sensors, current temperature of sensors, and link bandwidth. The proposed method not only maximizes the network lifetime, but also considers many factors to find the next hops for each sensor. We used the General Algebraic Modeling System (GAMS) software to analyse results, find the routes from each sensor to the sink, and subsequently demonstrate the applicability of the proposed model. Moreover, the network lifetime in different cases of this method is evaluated and compared with that in other methods. Obtained results show a significant improvement in the network lifetime as well as greater durability of important sensors.