Trustworthy Agents for Electronic Health Records through Confidence Estimation