Is it ethical for a doctor to tell patients they are about to die if they aren't?

Could this have the opposite effect to a beneficial one (making them accelerate their own end by jumping from a high window, for example?)

Would a doctor really adopt this ploy?

The book seemed flawed in this respect. This part of the plot seemed both improbable and unethical.