If you've modified the entities in some other code then their state will be modified (within the same context) without you having to explicitly change it with a foreach loop and context.Entry(pat).state=EntityState.Modified.
So taking a step back, after you've modified all your patients entities a single call to context.SaveChanges() will automagically rollback on error.
Soooo to summarise, change all the patients entities and afterwards call context.SaveChanges() which will make EF propogate all the entities that have a modified state (the state change happens when you modify the entity) to the DB, context.SaveChanges() will handle simple cases like this with regards to rollback.
P.S. Your question is making me wonder if you've changed the patients in a different context and that's why your manually changing the current context' state.