Generative AI, such as ChatGPT provides many promises, yet its role in medical education remains unclear and controversial. To evaluate the impact of adopting ChatGPT in medical education, we developed a pilot randomised controlled trial to evaluate the impact of ChatGPT on medical students ability to achieve learning outcomes in a problem-based learning (PBL) tutorial on anaphylaxis. We then evaluated the ability of GPT-3.5 and GPT-4.0 to achieve the learning outcomes in the PBL case. Results showed that students who used ChatGPT achieve the learning outcomes better, and GPT-3.5 and GPT-4.0 models of ChatGPT could achieve the PBL learning outcomes with minimal prompting. Nevertheless, the adoption of ChatGPT could also hinder the development of clinical reasoning skills.