Praise be to Allah.
Allaah has permitted those who fast to eat and drink until dawn comes. When dawn comes, it is haraam to eat and drink, and it makes no difference whether what is consumed is food or medicine. Allaah says (interpretation of the meaning):
“and eat and drink until the white thread (light) of dawn appears to you distinct from the black thread (darkness of night)”
It was narrated from ‘Abd-Allaah ibn ‘Umar (may Allaah be pleased with him) that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Bilaal gives the adhaan at night, so eat and drink until Ibn ‘Umm Maktoom gives the call to prayer.” Then he – i.e., Ibn ‘Umar – said: He was a blind man who did not give the call until it was said to him: “It is dawn, it is dawn.” Narrated by al-Bukhaari (592), Muslim (1092).
It was narrated that Ibn Mas’ood (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “No one of you should let the adhaan of Bilaal prevent him from eating sahoor. Rather he gives the call to prayer so that the one who is praying qiyaam may rest and the one who is asleep may wake up.” Narrated by al-Bukhaari (6802), Muslim (1093).
Based on this, it is permissible for you to take the medicine after sahoor if that is before dawn breaks, and there is nothing wrong with that. The fact that the effects of food and medicine remain in the body during the day in Ramadaan is one of the blessings of sahoor. Hence it is prescribed to delay sahoor so that the Muslim will have the strength to fast during the day in Ramadaan.
We ask Allaah to protect your spiritual and worldly affairs.
And Allaah knows best.