28 weeks pregnant and my heart goes into Atrial Fibrillation

Kelly
So I spent the last 4 days in the hospital 1 day on labor and delivery and 3 days in the ICU. I have been having issues with Pre-eclampsia and a short cervix. I was told no sex and complete pelvic rest. But I decided not to listen. 
My fiancé and I had sex and when we were done the bed was filled with blood. I immediately checked out and began staring at the blood I knew what we had to do but my mind and body had totally disconnected. I managed to say we have to go to the hospital. My fiancé found some clothes for me to put on and we left for the ER. I was in utter shock.
While in the ER they checked the babies heart rate. The minutes it took to locate her heart felt like hours, but there she was strong as ever. They did an ultrasound abdominal and transvaginal. My cervix had shortened even more now 1.4cm or 14mm previously being 18-21mm. I was admitted into the hospital to monitor bleeding and baby.
The next day I saw my MFM doc and had a confirmation ultrasound done. I was awaiting discharge instructions when I began to feel weird. I felt like I was having a panic attack. My heart was racing and I was Short or breath. I called for my nurse and asked her to check my vitals bc I didn't feel well.
As she checked me my bp was 158/110
I was hyperventilating and my pulse was fluctuating between 90bpm and 189bpm. And EKG was ordered and confirmed that my heart was in Atrial Fibrillation. They immediately transferred me to the ICU.
My heart remained in Afib for 24hrs. I was given IV metoprolol and acebutolol and tabocor and lovenox injection. My heart remained in a fib. So the cardiologist decided that he would take me to the OR and put me to sleep and shock my heart back into a normal rhythm via a procedure call electrical cardioversion. After crying all night and praying I finally fell asleep. When I woke up my nurse told me the procedure was cancelled bc I converted in my sleep!!!!
I was so happy and thankful. I was discharged after 4days and placed on a daily beta blocker. I have never had heart problems previously. Still don't know what caused it but I'm glad it's managed now.