Answer: In response to your question, the asal (general principle) is that free mixing between men and women is prohibited and not allowed in the Sharia. Women are commanded and informed to cover themselves up, and there are many extensive evidences on that.
However, there are situations where exceptions are made due to necessity, need, or even a Sharia benefit. In such cases, it may be permissible for a woman to come into contact with men, engage in free mixing, or even touch the opposite gender.
One such situation where it is permissible is for medical reasons, as there could be a need for it. The evidence for this is found in a narration by Imam Al-Bukhari on the authority of Al-Rubai’ bint Mu’awwidh, who said:
We were in the company of the Prophet (ﷺ) providing the wounded with water and treating them and bringing the killed to Medina (from the battle field) . (Bukhari: 2882)
This means they would come into contact with the opposite gender and even touch them.
Additionally, Al-Bukhari and Muslim both narrated in the Hadith of Anas bin Malik that he said:
On the day (of the battle) of Uhad when (some) people retreated and left the Prophet, I saw `Aisha bint Abu Bakr and Um Sulaim, with their robes tucked up so that the bangles around their ankles were visible hurrying with their water-skins. Then they would pour the water in the mouths of the people, and return to fill the water skins again and came back again to pour water in the mouths of the people. (Bukhari: 2880)
This action took place on the battlefield, and there was a clear maslaha (benefit) for the Ummah, making it permissible for the women to engage in this task, even if it involved free mixing with men.
Imam Muslim also narrated on the authority of Anas bin Malik:
When the Messenger of Allah (ﷺ) went on an expedition, he would take Umm Sulaym, and he had some women of the Ansar who supplied water and tended the wounded. (Muslim: 1810)
This also indicates that they would come into contact with the opposite gender.
Furthermore, if there is a benefit for a woman to feed guests, even if it is not a necessity or a need, it is permissible for her to do so.
This is evidenced by a narration in Sahih Al-Bukhari and Muslim:
When Abu Usaid As-Sa`idi got married, he invited the Prophet (ﷺ) and his companions. None prepared the food for them and brought it to them but his wife. She soaked some dates in water in a stone pot overnight, and when the Prophet (ﷺ) had finished his food, she provided him with that drink (of soaked dates). (Bukhari: 5182)
This demonstrates that such actions are permissible when there is a benefit.
However, it is important to understand that it is not permissible for a woman to uncover her awrah (private parts) for a male doctor, or for a man to uncover his awrah for a female doctor, if there is a person of the same gender available to perform the task.
If no one of the same gender is present, then it is permissible to uncover only the specific part that needs to be treated.
For example, if a woman needs to show her thigh to a male doctor, she is not allowed to uncover her chest, hair, or neck. She may only show what is necessary.
As Ibn Nujaym mentioned in his books, the principle is that necessity must be in line with what is needed. (Al-Ashbāh wa’l-Naẓāʾir:1:277)
Uncovering your awrah is haram and not permissible unless there is a necessity.
If a woman is sick and experiencing pain, she is not allowed to uncover herself unless the pain is severe, life-threatening, or causing excessive harm. In such cases, it is permissible for her to uncover her awrah to a male doctor.
Similarly, a man may uncover his awrah to a female doctor in life-threatening or severe pain situations.
It is important to note that these rulings apply to both men and women, as the Prophet ﷺ said:
“Women are the counterparts of men.” (Abu Dawood: 236)
This was authenticated by Shaykh Al-Albani.
However, this principle applies as long as there is no specific ruling that distinguishes one gender from the other.
In conclusion, while free mixing and uncovering the awrah are generally prohibited, there are exceptions in cases of necessity, need, or benefit, such as in medical situations.
However, one must always adhere to the principles of modesty and only do what is absolutely necessary.
And Allah Subhanahu Wa Ta’ala knows best.
— Answered by Ustadh Abdulrahman Hassan