some advice please!

so I have had normal periods they have been on time and and always last about 7 day. well in April I had an irregular period it lasted for 20 days!! I went to the er my hemoglobin was at a 7 because I had been menstruating for so long and I felt horrible. well it finally stopped and I had a break and started to feel better until may 10th I started my period again and today is June 4th and its day 26 today of menstruation I went to the er again. I felt so stupid having to go to the er again for the exact same thing. they did the urine test to check for pregnancy which I am not because of all the menstruation. they checked my hemoglobin ot was at an 8. they didnt do a pelvic exam like they did last time they sent me home with provera(medroxyprogesterone) not the depo shot this is a pill and I was wondering if anybody had any thoughts on it. I have been trying to get pregnant for years now and it dosen't seem to happen. I guess I wann know if this medication is gonna make it even harder for me to get pregnant? because I really dont understand what this medication supposed to do I guess