Detecting Bias and Enhancing Diagnostic Accuracy in Large Language Models for Healthcare