"With respect to a person who is ill but not in mortal danger, a non-Jew can be asked to prepare a medicine for him. But it is forbidden to violate a Torah prohibition for him." [Shulchan Aruch, Orach Chaim 328:17].
The definition of a person who is ill but not in mortal danger has been expanded by the sages to include the following: (1) Anybody who has taken to bed because of his illness. (2) Anybody who suffers from such pain that his whole body is weakened, even if he or she does not stay in bed but does not leave his house in a normal way. (3) One who has a higher than normal temperature. (4) One who is in need of a routine treatment (such as for diabetes or asthma), who might be placed in mortal danger if the treatment is delayed. (5) Any woman from the eighth to the thirtieth day after giving birth to a child. (6) A small child, as long as his or her body is not as developed and as strong as that of an adult (in Shemirat Shabbat B'Shabbato, this is defined in the name of Rabbi S.Z. Auerbach as an age of nine or ten).
Many types of labor which are prohibited on Shabbat by a rabbinical decree can be performed for a sick person even though he or she is not in mortal danger. In addition, one is allowed to tell a non-Jew to do labor, which is usually prohibited, for the benefit of a sick person. Must a chronically ill person who is in need of many Shabbat violations throughout the day keep a non-Jew close by to get help all the time? Must the many medical institutions in our country depend on a "Shabbat Gentile" in order to operate smoothly?
To solve these dilemmas, The Zomet Institute has proposed alternative solutions: automatic medical instruments or devices which work on the principle of gramma (indirect operation), which is permitted for a person who is ill even if he or she is not in mortal danger. In particular, The Zomet Institute has developed portable Gramma Outlets which can be used to operate all standard electrical equipment (on condition that it is not necessary to press a "start" button to turn the equipment on). These outlets can be used for such equipment as inhalators and vaporizers, among other things.
Of course, in cases of mortal danger or even a possibility of mortal danger, the halacha requires us to "desecrate one Shabbat so that the patient will be able to observe Shabbat many more times," and normal methods of treatment can be used.