JazaakAllah, another question, if you are faced with a situation where you would have to perform CPR on a non-mahram, would you be allowed to perform it?
Ideally, a hospital in a Muslim country should have male and female Muslim doctors so that the males may attend to the male patients and the females to the female patients. Of course, this is very difficult to achieve because it would mean that the gender ratios within each specialty would have to be the same.
it is permissible, as it is a necessity. it is necessary for muslim men and women to be doctors as well, along with expertise in other professions. Allah ta'ala knows best.
Is it allowed for a Muslim man to be a Doctor, because it involves touching women that aren't mahrams?