שולחן ערוך, אבן העזר, Seder HaGet Seder HaGet · ז
Shulchan Arukh, Even HaEzer 185
אם המגרש הוא שכיב מרע צריך לדקדק בו שיהיה שפוי בשעת כתיבה ובשעת נתינה (וע"ל סי' קכ"א):
If the divorcer is dying, it is necessary to be careful that he be sensate at the time of the writing and the delivery. Rem"a: See above ch. 121.