First of all it's normal when you start a high stress job (or any job that particularly stresses you). This should abate with a bit more time.
Come up with a game plan to catch yourself at it and redirect your brain, at least during your waking hours. Your brain has just gotten itself stuck in a loop.
Before you go to sleep at night, tell yourself "Tonight I'm going to dream about (sandy beaches, brew pubs, cute puppies, cute guys, etc etc)". Not sure if it'll work but hope this helps.
If you start having dreams that it's near the end of your shift and there's one patient you haven't even looked in on yet - don't know what to do about those. In my experience those dreams go away gradually after you retire.