There is a degree of nudity involved while gaining the ovum of the lady or while putting the fertilized ovum back. Nudity is expressly prohibited in the Shariah. In this context, if we look at the clarifications made by the jurists, we find more than one instance where the Fuqaha have ruled nudity to be permissible to the extent that it is needed. ‘Allama Shamsuddin Sarkhisi (May Allah shower His mercy on him) writes:
Translation: It has been narrated on the authority of Hadhrat Imam Abu Yousuf (May Allah shower His mercy on him) that if a person is extremely weak and through urinary catheterization, administering suppositories and/or enema, the weakness is reduced, then doing this is permissible. This is absolutely correct. This is because weakness is a kind of a disease due to which ultimately the person may end up having serious diseases. (Mabsut, Vol. 10, Pg. No. 163)
This is because treating a disease comes under a valid need. Thus, undressing to the extent required is permissible.
‘Allama Alauddin Samarqandi (May Allah shower His mercy on him) (deceased 552 Hijri), the author of Tuhfatul Fuqaha has classified some occasions to be valid needs. Just see what he wrote:
Translation: It is not permissible for a woman to see the area between the navel and the knees of another woman excepting in times of need, like if there is a sore or a wound in this area which has to be administered some medicine. If only a man has this knowledge, then this area should be revealed before that man, he may see the area where the sore, etc. is there and as far as possible should not let his gaze go beyond it. (Tuhfatul Fuqaha, Kitab Ul Hazri Wal Ibaha)
‘Allama Alauddin Kasani (May Allah shower His mercy on him) has written the details about this:
Translation: If a woman has a sore, etc. in such a place that seeing that area is not permissible for a man, then it is permissible for another woman to treat it, provided she knows how to treat it. If no woman knows it, someone should learn it and then treat. If there is no woman who knows the treatment or who can learn the treatment and the life of the diseased woman is in danger or there is a danger of difficulty arising from it or danger of such agony which the woman cannot bear, then there is an allowance for a man to treat her. However, that man should only open the area of the sore and as far as possible should try to limit what he sees. This allowance is only on the basis of a reason deemed to be valid by the Shariah, as the prohibitions of the Shariah are countermanded at the time of a need. (Bada’i Us Sana’i, Vol. 4, Pg. No. 299)
If while retrieving the ovum from the wife or while implanting the fertilized ovum, if there can be an arrangement wherein the wife does not have to reveal her private parts before anyone except the husband, then it is not prohibited at all. However, it would still be Makruh (undesirable).
If it involves undressing before anyone else apart from the husband, then as this is being done for the sake of treatment, then as per the aforementioned details, it ought to be allowed. However, there would still be a degree of undesirability involved.
It is evident from the references mentioned from Tuhfatul Fuqaha and Bada’i Us Sana’i that if treatment involves undressing, then one should take the services of female doctors. If no woman knows this treatment, someone should learn it and if there is no one who knows this and no one is able to learn it, then with caution one can utilize the services of male doctors. Undesirability is still present is all these cases.