VaginalPain

First off I went to the ER today for extreme vaginal pain after spotting and a sharp pain in my left ovary. When I went to the ER the sac was there and my levels were great. However when the doctor gave me my discharge papers it said I had a cyst . Could this be the cause for the pain and the vaginal pain. Doctor said they didn’t know why I was spotting. I’m confused