Acts that invalidate the fast come under two broad categories
category 1: What we ingest
category 2: What our bodies discharge
Allah specifies three deeds permitted when fast-breaking. This means fasting is abstention from these acts.
So now you may lie with them (your wives) and seek whatever offspring God has decreed for you. Moreover, you may now eat and drink until the white thread of dawn becomes clear to you, as distinguished from the black thread of night. Then complete the fast until the night (Surat Al-Baqarah, 2:187).
Allah’s Messenger, on him be peace, then itemized four additional acts that invalidate the fast because they are analogous to these three acts, or they weaken the faster and may harm him or her.
Here are the seven fast invalidators:
i. Sexual Intercourse
ii. Masturbation
iii. Eating and Drinking
iv. What Amounts to Eating and Drinking
v. Blood Letting (cupping, etc.)
vi. Induced Vomiting
vii. Menstruation and Lochia (Postpartum Bleeding)
Can you explain the seven fasting invalidators?
i. Sexual intercourse during the fasting part of the day of a Ramadan fast is the most serious fast-breaking sin and requires a heavy expiation (kaffarah, an expiation or atonement and reparation for guilt. See What Is Meant by Kaffarah for Violations of Ramadan Fasts?).
Any minimal penetration of the male genital organ into the female vaginal genital organ (or adjacent anal orifice, which is categorically forbidden (haram)), even for a moment, constitutes this act.
All seven invalidators require the immediate resumption of the fasting day, even after one has violated it, and also making up the violated day on another day, according the majority opinion.
Do the six other fasting invalidators require expiation (kaffarah)?
No, according to the Shafi‘i and Hanbali legal schools. They hold that an existing Text of Revelation, a statement, hadith, of the Prophet, on him be peace, specifies a single act (sexual intercourse), in this time (a Ramadan day fast), and its atonement (a specific kaffarah due for it) and that one cannot draw analogy from it for other violations.
Yes, on the authority of the Hanafi and Maliki schools, who contend that at issue is not merely the act itself during Ramadan, but the sanctity of the Ramadan fast in itself. Therefore, any deliberate and clear violation of the fasting aspect of Ramadan — the withholding of oneself from what breaks the fast — requires expiation, kaffarah.
Here’s a brief explanation for each in numbered order.
ii. masturbation means ejaculation of semen or orgasm, however achieved. Allah states in a Divine Pronouncement (hadith qudsi) of the faster: “One forgoes one’s food, drink and desire for My sake” (Bukhari and Muslim). The Arabic word ‘shahwah,’ translated as ‘desire,’ connotes the act’s completed ends.
iii. eating and drinking mean food or liquid entering the stomach through the mouth and the esophagus, evidenced by the ablution (wudu’) instruction of the Prophet, on him be peace: “Snuff water deep in the nose, except when fasting.” This exception guards against one inadvertently ingesting the water of ablution (Tirmidhi). Putting something into the mouth only, with nothing from it swallowed, does not break the fast.
iv. blood transfusion and intravenous (iv) feeding (invalidate fasting because they are nourishment. Injections, intravenous or intramuscular, are not, even insulin, though nighttime administration safeguards against doubt.
v. medicinal bloodletting via cupping invalidates the fast for both the cupper and the one cupped, said the Prophet, on him be peace (Abu Dawud). This includes blood donation, though permitted in an emergency. Still, the fast is broken and must be made up on another day. Nosebleeds, blood testing (in a small amount), tooth extraction, even surgery do not invalidate the fast, unless its purpose is that of cupping.
vi. induced vomiting breaks the fast. Involuntary vomiting does not, according to the Prophet, on him be peace (Tirmidhi).
Aisha, God be pleased with her, said: “The Messenger of Allah, God grant him peace and blessings, came to me and said: ‘O Aisha, is there any bit of bread?’ I brought him a piece and he put it in his mouth. Then he said: ‘O Aisha! Did any of it enter my stomach? … This is like the kiss of the fasting person, for the fast is broken by what goes in not by what comes out.’ ”
vii. menstruation and postpartum bleeding invalidate the fast, even if they occur an instant before sunset, as these conditions nullify ritual worship (Bukhari). If a woman feels the onset but no blood appears, the fast remains valid. If either cease in the night, and she ritually bathes (ghusl) after sunrise, her fast is still valid.
Are their conditions for these invalidations?
Yes.
The first six actions only invalidate the fast in three cases:
If one knows they are forbidden and does any of them
If one does them with awareness not in forgetfulness or a lapse of consciousness
If one does them willfully, not in coercion
What common medical procedures do not invalidate the fast?
Here’s a quick list of common medical procedures that do not invalidate one’s fast:
Rinses: Enemas (there is a scholarly difference of opinion on this, though scholars that allow for it under the stipulation that it cannot go beyond the lower intestinal tract), eye drops, eardrops, skin absorbed applications, wound treatment (stitches, cleansing, dressing, etc.)
Oral Procedures: Fillings, tooth and mouth cleaning with siwak or brush (so long as nothing is swallowed); gargling and mouth rinse (that does not reach the stomach, though the risk of inadvertent swallowing seems too risky, as the Prophet, on him be peace, warned against taking water in deeply for wudu’, ablution, when fasting)
Surgical Procedures: Oxygen, anesthetic gasses, inhalers; intubation, scope insertion via the stomach, endoscopy, biopsies (if no solutions or coatings are swallowed); and instrument insertion in the brain or spine.
And Allah knows best.
For an in-depth look see Valid Exemptions for not fasting Ramadan.