People who have a reversible illness are not asked this question in my place of work. It is, however, discussed with very ill people and their families if it is thought that they would not survive prolonged resussicitation. This discussion takes place with the Consultant, or registrar on call, and either confirmed or not by the Consultant the next day. This decision is reviewed frequently, and if the person improves, the decision is put aside.
Some people will not survive a sudden cardiac event, for example, those with an underlying serious illness who are admitted to hospital very ill for any other reason. This means that every effort is made to treat and reverse all or any reversible cause of the current illness. Frequent observations, the use of a scoring tool that indicates a developing problem, and timely interventions to treat those problems will generally help with recovery.
I have not known of this discussion taking place with an otherwise healthy person.