Very Long Period

A
I'm 17 and I've been getting period for four years now. From the beginning of the year my period has lasted for over 40 days. The previous time I had my period it was around 47 days. After 6 weeks, I got my period again for now 45+ days. It is not spotting, it is around medium heaviness constantly. When it happened to me at the beginning of the year I was prescribed insulin regulating medication which ended my period. I'm still taking them and my period continues like this. Please help!