confused

Abby
Been in hospital with contraction type pains  however not dialating and while I was there I lost some brownish blood and discharge any idea what this could be?? And I have terrible pain like period cramps I'm nearly 37 weeks