Source for פיקוח נפש
The Gemara in מסכת יומא explains that we can learn the principle of פיקוח נפש דוחה שבת, that a situation of danger, overrides Shabbat observance, from the case of מחתרת.
The case of מחתרת, refers to the permission granted to shoot and kill a thief who breaks into your home at night when you are home. The assumption is that he is armed because he prepares himself if you wake up and catch him. This is not the case by a thief who breaks in during the day, who assumes you are not home. You may not kill him.
The Gemara says that in the מחתרת case where there is a doubt if the thief is coming for money or coming to physically harm, and although shedding blood is very serious, permission is granted to save yourself. Then certainly regarding Shabbat where one is very ill and in possible danger, that one may violate Shabbat in order to save that person.
This is a source for פיקוח נפש דוחה שבת.