Salam alakim wa rahmatallah

الجواب وبالله التوفيق
Consult some doctor or Hakeem in this regard. It is permissible if needed, rather it is necessary to have treatment to fulfill the spouse’s rights. If a person is in need of treatment it is not even permissible to have Nikah without having treatment.
واللہ اعلم بالصواب
