If a woman takes medication (to delay menstrual period) and does not experience menstruation, her fast is valid. However, she is not advised to do so unless there is a necessity.
If the medication harms her, even potentially, it is forbidden (haram) for her to take it.