Structured Outputs Enable General-Purpose LLMs to be Medical Experts