Hi,
Unfortunately, there really is no set rule for using the articles. As you can see in the examples, “the” is used in one but not the other.
I am in the shower –“ the” is used, not "a"
He is in pain – no article is used
He felt like he was in heaven when Mary accepted his marriage proposal– not used
I am in the middle of mowing my lawn-‘”the” is used
She is in the mood for a movie- “the” is used.
She is in no mood for a movie – not used.
From your questions:
She is in hospital
she is in a hospital – this may be correct with the right context, not here.
she is in the hospital – This is correct. It means she has a medical problem which requires of her to remain in the hospital.
she is at university
she is at a university - Not sure what to makie of it. It's not wrong gramamtically, but it sounded strange.
she is at the university –The context paints an unclear picture. Does it mean she is studying at the university? Or Physically being there? If we add a little additional information to this context, then it may make sense.
She is getting her Ph.D. at the University of Miami .
She is at the office. This clear means she is physically there.
Does it help?