Training and Evaluation of Guideline-Based Medical Reasoning in LLMs