Wa alaykum salam. If it is necessary for you to take medication than you’re not obligated to fast. If you will be off of this medication before next Ramadhan then you will do the Qadha of those days umyou missed, but if you will be continuously in need of this medication then you need to pay fidya of feeding one poor shia per day of the missed fasts.