So I saw this movie on TV about 5-7 years ago. This girl was sent to some hospital/prison, and scheduled to have some sort of brain surgery. She tries to escape, and imagines the plot to escape through multiple incredibly intense action scenes. At the end, it’s revealed she did get the surgery and everything was made up.
Any help is greatly appreciated!