Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: “Islam has stipulated very strict rules with regard to the permissible boundaries of interactions/physical contacts between males and females who are not related either through marriage or blood relations. According to these rules, it is considered Haram for males and females who are not related in marriage or blood to be in private or come into direct physical contacts with one another. As everything that leads to Haram is Haram, they ought to avoid circumstances or avenues that might lead to such close contacts as far as possible.
The above rules are designed specifically to protect us against our own vulnerabilities and weaknesses for as Allah says in the Qur’an, “Verily man/woman has been created weak.” (An-Nisa’: 28) As one poet rightly remarked, “All illicit relations can be traced to a single unlawful gaze, just like all burning fires often proceed from a single spark.” However, Since Islam takes into account the realities of everyday life, and, therefore there may be situations where such contacts are necessary, and therefore unavoidable, the scholars of Shari`ah have allowed certain exceptions to the above rule: Thus they have considered such contacts permissible if undertaken strictly for the purpose of saving lives or administering essential treatments wherever applicable. This special ruling falls under the rule of necessity, which stipulates that in exceptional cases what has been otherwise considered as impermissible becomes permissible.
In order to qualify for permission under the rule of necessity, however, certain conditions apply: Firstly, the physician of the same gender must be unavailable; secondly, contacts should be kept to the absolute minimum limit as necessary.
It is best advised to consider the following scenarios: Is there a shortage of male medical doctors in your area to treat males? If there is no such shortage, then are you allowed by the ethics governing your profession to specialize in treating female patients only?
If there is no shortage of male medical doctors, and it is possible for you to specialize in treating females only, then you are not allowed to treat male patients. If, on the contrary, there is a shortage of male dentists, or, you are not allowed by the ethics of your profession to refuse treating male patients, then you are allowed to treat them–provided you take all the necessary safeguards such as making sure that your assistant or nurse is around while you are treating male patients. Furthermore, you must also limit physical contacts with the males to the absolute minimum that is necessary for diagnosing and treatment.
Once we have taken all possible measures that are humanly possible, Allah will hopefully forgive us the rest. After all, He will judge us not merely by our acts, but even more so by our intentions and cherished thoughts and motives.”