ChatGPT-4 revealed to surpass physicians in clinical reasoning but lag behind residents in certain cases