The obligation to help save someone’s life even if it involves desecrating Shabbos:
A. The Mitzvah and its reason:
One who has a life-threatening illness it is a Mitzvah [and obligation] to transgress Shabbos on his behalf [to help heal him] and those who act with alacrity [and do so first] are praised.
Asking a Rav: One who seeks [Halachic advice to verify if he is allowed to save a person who he knows is in danger] is spilling blood [through this delay] and the one who is asked [such a question] is to be ashamed because he should have made a public speech mentioning that it is allowed. [It is obligatory upon every Rav to be well versed in these laws in order so he does not have to delay a treatment until he verifies the matter in Sefarim.]
If there is doubt whether the situation is life threatening: Even a questionable life-threatening situation pushes off [the prohibitions of] Shabbos.
If there is doubt if the person is alive or dead, Jew or gentile: One which a mound fell upon him and there is doubt as to whether he is still alive or already dead, [and] a doubt if he is under there or he is not under there, and even if one were to say that he is under there is doubt as to whether he is a Jew or a gentile, one is to undo the mound from upon him even though many doubts are involved.
The reason for all the above is because: It says [in the verse] “That one should do and live by them” and what is “and live by them” trying to teach us? It is saying that one should see to it that one will for certain live through doing the Mitzvah and should not [do so if] he will come through this [Mitzvos] to a case of a possible life-threatening danger.
If one is not knowledgeable of whether the injury or illness can be life-threatening, is he to ask a doctor/Rav or is he to desecrate Shabbos due to doubt?
Yes, he must ask a doctor/Rav in such a case.
If the danger is not immediate, and there is time to take advice with a Rav in terms of the proper action, may one do so?
Yes, and so is the custom. The above disparaging of asking a Rav is only when it is an emergency that requires immediate attention.
B. Helping to save a life even he will further live only momentarily:
Even if [the victim] was found to be crushed and is thus only able to live momentarily, [nevertheless] one is to undo the mound up to his nose and check him [for if he still has life] and if he is still alive then one is to undo the mound and take him out for him to live whatever amount longer [that doing so will allow him to live]. [This applies even if the person has no chance of living enough to fulfill another Mitzvah, or guard Shabbos, or to ever regain consciousness, nevertheless for those few moments one is to desecrate Shabbos.] [However] if one did not feel life in his nose, then he has certainly already died, even if he was not crushed.
C. One who refuses to accept treatment:
If [the sick person] refuses to accept the treatment because he does not want Shabbos to be desecrated on his behalf, then he is to be forced [into taking it] as this is a ludicrous form of [supposed] piety. [This certainly applies during the week, that we force him to take a medicine or listen to doctors’ orders even to cut off a limb, even if he does not want to do it due to the pain and ridicule he will have to live with.]
D. No need for atonement:
Anyone which extinguished a fire which posed a possible danger does not need atonement and is not allowed to be stringent on himself and do acts of repentance on it even if he so wishes. [One is not to have any worry or sadness over the fact he had to desecrate Shabbos.]
E. Being swift to transgress Shabbos to save a life even if doing so swiftly involves additional transgressions:
Whomever is swift to transgress Shabbos for a life-threatening situation is praised [for doing so] even if [in the process of doing so hastily] he has done with it an additional [unnecessary] transgression, such as for example one spread out a net to remove a child that fell in a river and consequently caught fish with it, as well as any case of the like. [However, if the matter is not so urgent then when possible to lessen the amount of prohibition done, then one must do so as will be explained in Halacha 3B.]
F. If many figs were picked when only one was needed:
[If] the doctors evaluated that [the patient] needs one fig and ten people ran and each one brought back one fig, they are all exempt of liability and they all receive reward from G-d even if [the patient] became better from the first fig.
Summary of the obligation to help save someone’s life even if it involves doing Shabbos transgressions:
It is a Mitzvah to do everything possible to help save a Jews life, even if it involves transgressing Biblical prohibitions, and one who delays doing so even in order to receive Halachic permission is considered to have spilled blood. Even in a case of doubt as to whether the person is in life threatening danger one is to do all that is possible to save him. Even if one will only be able to help him live for a very short amount of time, he is to save him. One who is swift to transgress Shabbos to save a life even on account of doing additional prohibitions is praised. However if the matter is not so urgent then if it is possible to lessen the amount of prohibition done, one must do so. If the patient refuses to accept treatment then he is to be forced into it. Even if the treatment can be pushed off until after Shabbos one is not to do so, due to worry that perhaps by then he may not be able to be cured anymore by that time.
 Admur 328:2; Michaber 328:2; Mishneh Yuma 83a
 As the Torah states “Lo Saamod Al Dam Reiacha” [M”B 328:6; See also Admur 329:8 and Hilchos Shemiras Haguf Vehanefesh 7]
 See M”B 328; This means that in the event that
 Admur ibid; Michaber ibid; Yerushalmi Yuma 8:5
The reason: As through doing so the treatment is being delayed and he may eventually die due to this delay. [M”B 328:6]
 Admur ibid; Yerushalmi ibid; M”A 328:1; M”B 328:4
 Admur ibid; M”A 328:1; Terumos Hadeshen 1:58; 2:156; M”B 328:4
 Kaf Hachaim 328:10; Mateh Efraim 618:16; M”B 618:24
 Admur ibid; Michaber 329:3; Mishneh Yuma ibid
 Admur 329:3; Michaber 328:3; Mishneh Yuma ibid
 Admur 328:2 and 329:3; Shmuel Yuma 85b; M”B 328:4; Biur Halacha 329:3 “Ela”
Other reasons in Admur-Opinion of Rebbe Shimon Ben Minasya: Rebbe Shimon Ben Minasya in Yuma 85b says the reason one is allowed to desecrate Shabbos is because “Let one desecrate one Shabbos so he can fulfill many Shabbosos”. [brought in Admur 306:29 as the reason for why one may desecrate Shabbos; Brought in Tanya chapter 24 as the only reason] According to this reason if one will not come to fulfill many Shabbosos [such as if he will die momentarily regardless, or is a Shoteh or Katan] then he may not desecrate Shabbos. [See Biur Halacha 329:3 “Ela”; Minchas Elazar 1:9]
 Aruch Hashulchan 328:2 based on Or Zarua 108 and Gemara Menachos 64a; Shevet Halevi 3:36
 Admur 329:3; Michaber 329:4; Yuma 85a
Opinion of Or Hachaim Hakadosh: Some write that one may not desecrate Shabbos for the mere extending of a moment of life unless he will live until the next Shabbos. [Or Hachaim Hakadosh Ki Sisa 31:16] This is seemingly based on the opinion of Rebbe Shimon Ben Minasya in Yuma 85b that the reason one is allowed to desecrate Shabbos is because “Let one desecrate one Shabbos so he can fulfill many Shabbosos”, and hence here since he will not come to fulfill many Shabbosos therefore one may not desecrate Shabbos. [Biur Halacha 329:3 “Ela”; Minchas Elazar 1:9] However in truth one cannot say he is based on their opinion as even Rebbe Shimon agrees with the above ruling of the Gemara which is not brought with any differentiation, as even one more moment of fulfilling Shabbos is worthy of desecrating Shabbos, even according to this opinion, while the Or Hachaim requires him to live until the next Shabbos. Furthermore, we do not rule like Rebbe Shimon Ben Minasya! Rather one must say the Or Hachaim is simply giving a commentary according to Derush and not according to the final Halacha. [Minchas Elazar ibid] Other answers on the Or Hachaim are suggested amongst the Poskim and Mefarshim. [See Minchas Elazar ibid in name of many Poskim; Daas Torah; Orchos Chaim; Oheiv Yisrael; Sefas Emes; Minchas Chinuch Moseich Shabbos]
Opinion of Rebbe Shimon Ben Minasya: See above that according to the reason Rebbe Shimon Ben Minasay in Yuma ibid one would not be allowed to desecrate Shabbos if the person cannot live to fulfill another Shabbos, or more Mitzvos on that same Shabbos. [Biur Halacha 329:3 “Ela”; Minchas Elazar 1:9]
Case of Goses, or terminal illness: See Q&A below and Rama Y.D. 339:1; Piskeiy Teshuvos 329:30
 Biur Halacha 329:3 “Ela”; Minchas Elazar 1:9
The reason: As in those few moments he can think thoughts of Teshuvah. [Meiri, brought in Biur Halacha ibid; Chasam Sofer Haazinu] Furthermore, even if he cannot think words of Teshuvah, every moment of Jewish life in this world is precious. [Biur Halacha ibid] As every person is given an exact amount of time to live in this world and perhaps, he needs those extra seconds to fulfill his mission and not come back down in a Gilgul a second time. [Halachos Ketanos 2:38; Tzitzis Eliezer 8:15-3; See Piskeiy Teshuvos 329:6]
 Admur 328:11; M”A 328:6; Radbaz 4:67; Kneses Hagedola; Mor Uketzia 328; M”B 328:6; See also Admur 618:1 regarding eating on Yom Kippur
Custom of some Tzaddikim: Some Tazaddikim were accustomed to give up their lives rather than be Michalel Shabbos, as they held one may trust in Hashem rather than listen to the doctors. [See Avnei Nezer 7:193 in name of Ramban and Even Haezra] It is likewise recorded that the Riva refused to eat on Yom Kippur despite the doctors’ orders and he dies as a result. [Radbaz 1:444] Some Poskim defend this practice. [Avnei Nezer ibid] Other Poskim negate it. [See Radbaz ibid] According to all this may be done only for people that are on a very high level of trust in Hashem. [Sheveit Halevi 8:251] However other people may not rely on a miracle. [Rashba 1:413; Chovos Halevavos Bitachion 4]
 The reason: Although in Yoreh Deah 157:1 the Michaber rules like the Rishonim [Rabbeinu Yerucham] that say by all Mitzvos one may choose to die rather than transgress, nevertheless this is only in a case that the gentile wants him to transgress for the sake of transgressing his religion, in which case there is a Kiddush Hashem if he is killed. However, in this case there is no Kiddush hashem involved, and hence one may not be stringent upon himself. [Radbaz ibid]
 Mor Uketzia 328
 Admur 334:28; Darkei Moshe 334:7; Or Zarua 2:38; Chavos Yair 236; Shaareiy Teshuvah 334:2; M”B 334:78 in name of Nezer Yisrael in name of Zechor Leavraham;
Other opinions: Some Poskim rule that an individual may choose to fast for atonement if he desecrated Shabbos Biblically being that Shabbos is Dchuya by Pikuach Nefesh and not Hutar, although we do not rule this way to anyone who asks. [Chavos Yair ibid; see Piskeiy Teshuvos 3287 footnote 61]
 The reason: As this can cause himself [or others] to be lax in extinguishing a fire the next time it occurs. [ibid]
 Tashbatz 1:54; Shulchan Shlomo 334:4; Chasam Sofer 85 “Just as one is not to be pained for doing Mila on Shabbos, so too regarding Pikuach Nefesh”
 Admur 328:14; Michaber 328:13; Braisa Yuma 84b
 Lit. has fixed another matter
 Based on 328:13 and 18; Biur Halacha 328:15 “Viyeish Lahem Sechar Tov”
 Admur 328:17; Michaber 328:15; Menachos 64a
 Admur 328:2
 Admur 329:3
 Admur 328:14
 Admur 328:18
 Admur 328:11
 Admur 328:13