The Shulhan Aruch (Orah Haim 330) addresses the laws relevant to a woman who is in labor on Shabbat, and establishes that the situation of labor is considered one of Piku’ah Nefesh – potential risk to life. As such, the Shabbat prohibitions are suspended for the sake of tending to the needs of a woman in labor.
Based on the Rambam (Rav Moshe Maimonides, Spain-Egypt, 1135-1204), the Shulhan Aruch writes that labor is considered a potentially life-threatening condition once the woman reaches any of the following three stages: 1) the water broke; 2) the woman is already on the birthing table; 3) the woman can no longer walk on her own, and needs somebody’s assistance in order to walk. Once the woman reaches any of these three stages, she is considered to be in a state of Piku’ah Nefesh that allows – and requires – violating Shabbat to care for her if necessary.
However, the Aruch Ha’shulhan (Rav Yechiel Michel Epstein of Nevarduk, 1829-1908) notes a significant point of distinction between the situation of a woman in labor and other situations of Piku’ah Nefesh. Childbirth, of course, is not an ordinary illness, as it is a perfectly natural phenomenon. G-d created the world such that women experience labor in order to produce a child. The reason why childbirth is treated as a situation of Piku’ah Nefesh is because many women, understandably, become frightened and anxious during the process, and this fear and anxiety can cause harm, Heaven forbid. Therefore, Shabbat is violated for the sake of a woman in labor only if she asks for things to be done for her. In ordinary cases of potentially life-threatening medical conditions, we do whatever is needed to care for the patient without the patient asking; anything deemed necessary for the patient’s wellbeing is done, even if it entails Shabbat violation. In the case of a woman in labor, by contrast, we wait for the woman to express what she needs. For example, if she asks that the light be turned on, then we turn on the lights. Even if the woman is blind, but she wants the light on so that others can see her, we turn on the light in order to ease her concerns. Likewise, if she asks to turn off the light, so she would be more comfortable, we turn off the light.
It goes without saying that after the baby is born, the umbilical cord is cut, and then the knot is made, and all other basic needs of the child are cared for, even if this involves acts that are otherwise forbidden on Shabbat.
The Hazon Ish (Rav Avraham Yeshaya Karelitz, 1878-1953) ruled that if a woman goes into labor on Shabbat, somebody should accompany her to the hospital, even if she says she is capable of going alone. In such a situation, the Hazon Ish explained, it must be assumed that the woman really does need somebody with her, but is simply worried about causing additional Shabbat violation. Therefore, even if she does not ask to be accompanied to the hospital, somebody should go with her.
Although the needs of a woman in labor override the Shabbat prohibitions, efforts should be made to try to minimize the extent of the Shabbat desecration. Thus, the Mishna Berura (Rav Yisrael Meir Kagan of Radin, 1839-1933) writes that in the ninth month of pregnancy, a couple should prepare every Ereb Shabbat for the possibility of labor on Shabbat. In practical terms, this means – as Hacham Ovadia Yosef writes – that if the couple plans on going to the hospital by car, they should turn off the light that would otherwise be lit when the car door is opened. Since this light is not needed for the trip to the hospital, it should be disabled before Shabbat in order to avoid unnecessary Shabbat desecration. Likewise, Hacham Ovadia writes, it is proper for the couple before Shabbat to write down on a piece of paper all the information that they will be required to provide upon arriving in the hospital, in order to expedite the process and minimize Shabbat desecration in the event that they need to go to the hospital on Shabbat. He also advises that the couple prepare a bag on Ereb Shabbat with all the items they will need in the hospital.
Summary: When a woman is in labor – once her water breaks, she is on the birthing table, or she cannot walk without assistance – she is considered to be in a potentially life-threatening situation, and therefore on Shabbat, anything she feels she needs is allowed to be done, even at the expense of the Shabbat laws. Thus, for example, one may turn on or off lights for a woman in labor if she requests it. If she needs to go to the hospital on Shabbat, somebody should go with her, even if she does not ask to be accompanied. Once the ninth month of pregnancy begins, the couple should make arrangements every Friday to minimize the extent of Shabbat desecration in the event the woman goes into the labor on Shabbat. For example, they should turn off the light inside the car, and prepare in advance a bag and all the paperwork they will need in the hospital.