Medical school graduates are entered in a nationwide draft (similar to football) for residency. Medical centers select graduates based on graduates’ stated preference for emphasis or specialty, and graduates wait on pins and needles until they learn who has selected them.
My niece was in her residency in family practice. She was picked to go to a hospital/clinic Salt Lake City.
I don’t know if you can drop out and go back due to emergency.