If the medicine is too important to treat a specific medical condition such as hypertension and diabetes, then one can take it during fasting hours. It is quite important to consult with a religious authority or a doctor if you have any questions about medications.