When should a doctor connect a patient to and disconnect a patient from a life-support system?