Large-scale implementation of electronic prescribing systems (e-PS) is likely to introduce at least some machinerelated errors that will harm patients. We present a dynamic systems modeling approach to developing a comprehensive multilevel accident model of the process, context and task interaction variables which give rise to human error and system failure when e-PS are used in routine care. System dynamics methods are used to represent interactions between medication management processes and the context that is relevant to error generation, interception and transmission, agent-based methods represent task interactions. Capturing the patterns of failure within an accident model will facilitate an evidence-based approach to hazard analysis and design of e-PS features to improve patient safety. The model will have broad potential to guide the design, implementation and regulation of e-PS.