Q. Can an elderly patient wearing a diaper put on tefilin when he is wet?
A. On a similar question (442), regarding a patient hospitalized and wearing diapers, if he is allowed to listen to Torah tapes or Jewish music we wrote: “Mishna Berura (78: 3) rules that if a dry outer garment covers the urine damp inner clothing, one is permitted to read the sh’ma and recite tefilos. Certainly one is allowed to listen to Torah tapes and music that contains pesukim. Nevertheless, at the time the patient is urinating he should stop his prayers or learning.
However the above does not apply to feces even if they are covered, as they are not absorbed by the diaper, (O.H. 76: 5, Mishna Berura 18), therefore the patient would have to be cleaned properly before praying.
Horav Shlomo Miller’s Shlit”a opinion is that when visiting the ailing and praying in front of them or talking divrei Torah to them, you do not have to be concerned perhaps they soiled themselves, unless there is a prevalent odor.”
In regards to donning Tefilin the Rov maintains that greater care should be taken to ensure that no feces are present, and the patient should wear them immediately after being cleaned and changed and preferable only for a short time.
Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a