סימן קלה סעיף טז
חוֹלֶה וּמְשַׁמְּשָיו, פְּטוּרִים מִסֻּכָּה. וְאִם הוּא חוֹלֶה שֶׁאֵין בּוֹ סַכָּנָה, אֵין הַמְשַׁמְּשִׁין פְּטוּרִין אֶלָּא בְּשָׁעָה שֶׁהוּא צָרִיךְ לָהֶם. אִם הוּא חוֹלֶה שֶׁיֶשׁ בּוֹ סַכָּנָה, פְּטוּרִין גַּם בְּשָׁעָה שֶׁאֵינוֹ צָרִיךְ לָהֶן כָּל כָּךְ.
A sick person and his attendants are exempt from the mitzvah of sukkah. However, if the patient is not critically ill, the attendants are exempt only when he needs them. If he is critically ill, they are exempt even when he does not need them so urgently.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)