(b) If the order not to resuscitate was entered upon the consent of a surrogate, parent, or legal guardian and the attending physician or attending nurse practitioner who issued the order, or, if unavailable, another attending physician or attending nurse practitioner at any time determines that the patient does not suffer from one of the medical conditions set forth in paragraph (c) of subdivision three of section twenty-nine hundred sixty-five of this article, the attending physician or attending nurse practitioner shall immediately include such determination in the patient's chart, cancel the order, and notify the person who consented to the order and all hospital staff responsible for the patient's care of the cancellation.
(c) If an order not to resuscitate was entered upon the consent of a surrogate and the patient at any time gains or regains capacity, the attending physician or attending nurse practitioner who issued the order, or, if unavailable, another attending physician or attending nurse practitioner shall immediately cancel the order and notify the person who consented to the order and all hospital staff directly responsible for the patient's care of the cancellation.