Bismillah Al-Rahman Al-Raheem ﷽
The Standing Committee for Issuing Fatwas received the following question:
I am an Imām of a mosque and I was afflicted with cancer in the intestines. The doctors decided that the disease was in the rectum, which contained waste, and that it must be removed. In fact, they operated blocked the exit and opened a side opening for the stool. We use nylon bags every day and night. We stick a bag to this opening with glue, so it does not come out. It does not contain any smell, sweat, or anything objectionable. Then we remove it after a day and a night, wash the hole well, and stick another one in its place.
They replied:
If the situation is as you stated, you must do ablution before every prayer, just like someone who has urine incontinence or a woman who is experiencing menstrual bleeding. Your ablution is invalidated by the small or large amount of stool that comes out of you into the bag. If you carry the bag during prayer while it is impure or if you pass waste into the bag while you are praying, you are excused.
Source:
Fatwā of the Standing Committee” (5/412-413).