It is narrated from Sayyiduna Abdullah bin Amr (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever among the Muslims is afflicted with a bodily illness or suffering, Allah Almighty commands the guardian angels (who record deeds): Keep recording for this servant of Mine the same deeds that he used to do in his state of health and well-being, for as long as he is bound in My fetter (that is, illness)." In the narration of Imam Ahmad bin Mani' there is this addition, that he (peace and blessings be upon him) said: "Keep recording for this servant of Mine, every day and night, all the good deeds that he used to do (in his days of health), for as long as he is confined in My fetter." Imam Ahmad bin Hanbal also narrated this hadith through various chains, which include narrators such as Abd al-Razzaq, Ishaq bin Yusuf, Sufyan al-Thawri, Ma'mar, Asim bin Abi al-Najud, Khaythamah bin Abd al-Rahman, Waki', Mis'ar and Abu Hasin; and Imam al-Hakim also narrated it and said that this hadith is sahih (authentic) on the conditions of Imam Bukhari and Imam Muslim.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب الطب / 3844
Hadith Gradingمحدثین:قال الحاكم: صحيح على شرطهما
Hadith Takhrij«(3844/1) أخرجه مسند أحمد برقم: 6786، وأخرجه سنن الدارمي برقم: 2770، وأخرجه المستدرك على الصحيحين برقم: 1327، وأخرجه مجمع الزوائد ومنبع الفوائد برقم: 3197» «(3844/2) أخرجه مسند أحمد برقم: 6831، وأخرجه سنن الدارمي برقم: 2770، وأخرجه المستدرك على الصحيحين برقم: 1327»