Admitted to hospital at 22 weeks...

I have posted before about having contractions and pain but Friday I went into l&d; for a labor check just to be safe and ended up getting admitted due to contractions and the baby’s heart decelerating. I’ve had all sorts of tests and everything has come back normal. No one seems to understand why I have contractions despite taking medicine to stop them. I think I will be going home soon and will be following up with my regular OB. Just wondering if anyone else has every gone this and know what to expect? I am worried I will be out on bed rest and will lose my job (I live in CA). I’ve never been through all this before and I just don’t know what to think or do now. I have adenomyosis and endometriosis also, not sure if that makes a difference.