It is narrated from the father of Ibn Ajlan: Sayyiduna Abu Hurayrah (may Allah be pleased with him) came to me when I was ill and overcome (by weakness and illness). He asked: "Has this companion of yours prayed?" The people said: "Yes." At this he said: "Know that I have been informed that there is no servant who falls ill except that Allah, the Blessed and Exalted, keeps recording for him (as reward) all the good deeds he used to do in his state of health and well-being, until Allah, the Mighty and Majestic, takes his soul or cures him of the illness and restores him to health."
Ibn Hajar al-Asqalani recorded it in al-Matalib al-'Aliyah, and supporting reports for it exist in Sahih al-Bukhari.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب الطب / 2459
Hadith Gradingمحدثین:إسناده صحيح
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :إسناده صحيح. » «أخرجه مسند أبي يعلى برقم: 6638، وأخرجه المطالب العالية لابن حجر برقم: 2460»