Don’t worry—the safety mechanism will release a pokémon if its ball is too damaged for use, even if she’s still inside. Considering the fact that phantump is a ghost, yours likely slipped away unnoticed, which means she’s likely in hiding.
Now, keep in mind that when I say released, I mean you will need to catch her again. If you bonded with her, this shouldn’t be a problem, and she may still be nearby (if she hadn’t followed you to the hospital). However, if you hadn’t bonded … I’m sorry, dear reader.
In any case, get well soon!