A male doctor treating female patients and vice versa

Q 1: I am a medical student and next year we are to study a gynecology course, insha-Allah (if Allah wills) . Accordingly, I would like to ask about the following:A- Is it permissible to attend this practical course, which may require seeing a woman's body?B- Is it permissible for male doctors to specialize in Gynecology or should that be restricted to females only? C- Is it permissible for female patients suffering diseases other than gynecological disorders and pre-natal care to refer to male otolaryngologist or oculist for example, despite the existence of female specialists in these fields?D- Is it permissible for a female doctor to examine male patients? (Part No. 24; Page No. 418

A 1: A, B: If there is a sufficient number of female specialists in Gynecology, this field of study should be restricted to them making it impermissible for you to study it or see the `Awrah (parts of the body that must be covered in public) of women during check ups or surgery. On the other hand, if there is a lack of female specialists; it becomes necessary for the need of Muslims and then you are permitted to study this branch and see whatever you need to examine of a woman's body for check ups or surgical purposes.C- If an experienced female doctor is available for treating women, it becomes impermissible for the latter to refer to a male doctor.D- It is permissible for female doctors to examine and treat male patients only when necessary and no male doctors are available to do this. Otherwise, the former should refrain from doing this and refer to male doctors for treatment.May Allah grant us success. May peace be upon our Prophet Muhammad, his family, and Companions!