Assessing the safety of electronic health records: a national longitudinal study of medication-related decision support