Generalization of Medical Large Language Models through Cross-Domain Weak Supervision