Back pain

I couldn't fall asleep last night cuz of excruciating pain in my mid back on the right side. Any way i turned it hurt bad.....any ideas if its pregnancy related? Or some other medical issue? Im 19 weeks pregnant thank u