Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.002.
It is permitted for a patient to complain of his pain and illness to a physician or a friend, provided he does not do so to express his or her anger or impatience. It was mentioned earlier that the Prophet, peace be upon him, said: “My fever is as severe as that of any two of you.” Once ‘Aisha complained to the Messenger of Allah, peace be upon him, about her headache, lamenting: “O my head.” He retorted: “Nay, rather (I should say) O my head!” Likewise it is reported that ‘Abdullah ibn Al-Zubair asked his ailing mother, Asma bint Abi Bakr, “How are you feeling now?” She replied: “I am in pain.”
A patient should thank and praise Allah, before talking about his distress and complaint
Ibn Mas’ud said: “If one thanks Allah before complaining about his pain or disease, then it is not considered impatience. Indeed, to refer one’s complaint to Allah, is quite lawful.” Jacob (the prophet), said: “I complain of my distraction and anguish only to Allah.” The Prophet Muhammad, peace be upon him, himself prayed: “O Allah! to You I complain of my weakness.”