It goes without saying that if an ill patient suffers from a life-threatening condition on Shabbat, anything that is necessary to treat the condition may and must be done even if this entails an act forbidden on Shabbat. The question arises, however, as to whether any Shabbat restrictions are waived in the case of a "Holeh She’en Bo Sakana" – a patient whose condition does not threaten his life. Is there room for any leniencies when such a patient requires assistance that involves actions forbidden on Shabbat?
The Shulhan Aruch (Orah Haim 328:17) cites several different opinions, and concludes that if the patient is "Nofel Le’mishkab" ("bedridden"), then it is permissible on Shabbat, if necessary, to perform an action forbidden Mi’de’rabbanan (by force of Rabbinic enactment), in an unusual manner. This means that if the patient requires something which Torah law allows on Shabbat, but the Rabbis forbade, the action may be done with a "Shinui" – some deviation. Of course, if a non-Jew is present and available to perform the action, then the non-Jew should preferably be asked to do what the patient needs. But if no non-Jew is available, then a Jew can perform the action with a "Shinui," as long as the action is forbidden only "Mi’de’rabbanan."
Hacham Ovadia Yosef (in Hazon Ovadia) gives the example of a patient who cannot sleep because of the light in the room. Although "Mechabeh" – "extinguishing" – is one of the thirty-nine Shabbat prohibitions, the Torah prohibition of "Mechabeh" applies only when one extinguishes for the sake of rekindling. Extinguishing for the purpose of eliminating the fire falls under the category of "Melacha She’ena Sericha Le’gufah" (a forbidden action performed on Shabbat for a different purpose), which is forbidden only "Mi’de’rabbanan." Therefore, Hacham Ovadia writes, if a non-Jew is not available to turn off the light for the patient, a Jew may do so in an unusual manner, such as by using his elbow instead of his finger. It should be noted that the Mishna Berura (Rav Yisrael Meir Kagan of Radin, 1839-1933) maintained that extinguishing a flame is treated more stringently than other Rabbinic prohibitions, and thus in his view, it would be forbidden to turn off a light for a patient on Shabbat. Hacham Ovadia, however, disagreed, and maintained that there is no difference between extinguishing and other Rabbinic prohibitions in this regard. Therefore, if a bedridden patient cannot sleep on Shabbat because of the light, and no non-Jew is available to turn it off, then a Jew may turn off the light in an unusual manner.
Another example would be the case of a patient confined to a reclining chair who needs the chair to be electronically adjusted. This question arose concerning an elderly woman who needed such a chair, and she could not get out of the chair without electronically adjusting it. It would appear that adjusting the chair by pressing the button would be forbidden only "Mi’de’rabbanan," as the lights are all LED lights, which do not involve any sort of fire, and the use of electricity itself does not constitute a Torah violation. Therefore, if no non-Jew is available to adjust the chair for this patient, it would be permissible for a Jew to press the button in an unusual manner to help the patient.
Summary: If an ill patient is bedridden but his condition is not life-threatening, actions forbidden on Shabbat on the level of Rabbinic enactment may be performed on his behalf, if necessary, if they are done in an unusual manner. Therefore, if a patient cannot sleep because of the light in the room, and no non-Jew is available to turn off the light, one may turn off the light with his elbow, or in some other unusual manner, to allow the patient to sleep. Likewise, in the case of a patient confined to an electronic reclining chair, who needs to have the chair adjusted, if no non-Jew is available, one may adjust the chair by pressing the button in an unusual manner.