A character foil is a character that contrasts with another character, usually the protagonist. The main purpose of including a foil in a story is to highlight the qualities of the other character.
This is what Praskovya Fedorovna is doing for Ivan Ilyich in this passage. In the passage, Fedorovna has an attitude of indignation towards Ilyich and his disease. We learn that she believes him to be doing something wrong, and thus be unable to get better. This contrasts sharply with Ilyich's calm attitude. Moreover, Fedorovna has an air of falsity that she shares with the doctor, and which contrasts with the authenticity of Ilyich.