All perfect praise be to Allaah, the Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
As long as your swallowing of water was unintentional, your fasting is sound. Allaah The Exalted Says (what means): {And there is no blame upon you for that in which you have erred but [only for] what your hearts intended. And ever is Allaah Forgiving and Merciful.}[Quran 33: 5]
Shaykh Ibn ‘Uthaymeen said, “If the fasting person unwillingly and unintentionally does one of the things that annul the fast, his fast will be valid. If he rinses out his mouth and unintentionally swallows water, his fast will be valid.”
Nevertheless, we advise you to delay such types of treatments, where swallowing something is expected, to a time after the Maghrib prayer if possible.
And Allaah knows best.