If a woman needs to take medicine in order to get her period, either because she does not get it at all except by means of medication, as mentioned in the question, or because she does not have a regular period, as is common among women, there is nothing wrong with that if the medicine is permissible in and of itself and no harm will result from taking it.
If she gets a period after taking the medicine, then she should stop praying and fasting for the length of her period, then she should make up the fasts but not make up the prayer, as applies to all other women with regard to their periods.
Al-Nawawi (may Allah have mercy on him) said:
If she takes medicine to menstruate and gets her menses, she does not have to make up [the missed prayers]. Similarly, if she takes medicine to abort a foetus and she aborts it and bleeds after that (i.e. nifaas), she does not have to make up the prayers she missed during the nifaas period, according to the correct opinion. End quote from al-Majmoo‘, 3/10.
It is haraam for a woman to deliberately take this medicine in Ramadan or close to it for the purpose of not fasting in Ramadan.
Al-Mardaawi (may Allah have mercy on him) said:
It is permissible to take medicine in order to get one’s menses. This was stated by Shaykh Taqiy al-Deen [i.e., Ibn Taymiyah] and this is the only view he mentioned in al-Furoo‘, unless that is done close to Ramadan in order not to fast. This was stated by Abu Ya‘la al-Sagheer.
I [al-Mardaawi] say: and there is no one who disagrees with him.
End quote from al-Insaaf, 1/273. See also al-Furoo‘, 1/393; al-Fataawa al-Kubra, 5/315
Shaykh Mansoor al-Bahooti (may Allah have mercy on him) said:
It is permissible for a female to take permissible medicine in order to get her menses, but not close to Ramadan in order not to fast. (The same ruling applies to) travelling (close to Ramadan) in order not to fast.
End quote from Kashshaaf al-Qinaa‘, 1/218
And Allah knows best.