Scholars have unanimously agreed that it is impermissible and completely prohibited to conduct an abortion if the age of the fetus has reached 120 days. This is because it is considered killing a soul which Allah has forbidden, except by right. Allah says in the holy Qur`an:
"And do not kill your children out of poverty; We will provide for you and them." [6: 151] and,
"And do not kill the soul which Allah has forbidden, except by right." [17: 33]
Otherwise, scholars have disagreed on the permissibility of abortion if the fetus has not completed 120 days inside its mother's womb. Some of them deemed abortion prohibited and this is the relied upon opinion of the Malikis, Zahiris and some of the Shafi'is.
Other scholars maintained that abortion is absolutely disliked and this is the opinion of some of the Hanafis, Malikis and a probable opinion of the Shafi'is.
Other scholars consider abortion permissible only if there is an excuse that calls for it. Through research, we found that this opinion corresponds with the principles of the Hanafi School. Still, other scholars maintained unrestricted permissibility if the pregnancy was out of wedlock. This is the opinion of some of the Hanafis, one of the opinions adopted by the Hanbalis, and the opinion of the Shafi'i scholar, al-Ramli. This is likewise the opinion followed by al-Lakhmi, the Maliki scholar, and Abu Is-haq al-Maruzi, the Shafi'i scholar, who deemed abortion permissible before 40 days of pregnancy.
The dominant opinion and that which we choose for fatwa, is that abortion is not permissible before Allah has ensouled the fetus, except if the pregnancy was out of wedlock or for an excuse. Research shows that this opinion corresponds with the principles of the Hanafi School.
In his meta-commentary Rad al-Muhtar 'ala al-Dur al-Mukhtar, the Hanafi scholar Ibn Abdeen cited Ibn Wahban and gave an example for the excuses that make abortion permissible. These include the case of a pregnant woman who is nursing a child and her milk ceases to flow due to her pregnancy, and whose husband, who fears losing his child, does not have the means to afford a wet nurse. He said: "The permissibility of conducting an abortion is based on the excuse."
Imam Zarkashi mentioned that a woman is not blameworthy if she is forced by necessity to take a lawful medication which would result in a miscarriage [Al-Iqna' in al-Bajirmy's meta-commentary (4/129)].
Based on the above and in reference to the question, it is permissible in Islamic law to have an abortion before 120 days of pregnancy if the physicians determine the presence of fetal deformity. Moreover, there is no objection in Islamic law to conducting the necessary tests to check for such incurable diseases and congenital defects.