If I make an eiruv tavshilin on erev Yom Tov, as required, but have to go to another city because of a medical emergency can I still cook on Erev Shabbos?
From your question it sounds like the emergency came up after you already made the eruv and cooked something for Shabbos. You may rely on the eruv that you made even though you will not be able to get to your eruv on shabbos. This is especially true if your family is coming with you and bringing the eruv. But even if you are the only one going to the other city, it is better for you to make another eruv for that place without a bracha, but if you didn’t, you may rely on the first eruv that you made.
Shevet Halevi 8-122, Piskei Teshuvos 527-10.