Patient safety and medical errors in ambulatory primary care are receiving increasing attention from policy makers, accreditation bodies and researchers, as well as by practising family physicians and their patients. While a great deal of progress has been made in understanding errors in hospital settings, it is important to recognise that ambulatory settings pose a very large and different set of challenges and that the types of hazards that exist and the strategies required to reduce them are very different. What is needed is a logical theoretical model for understanding the causes of errors in primary care, the role of healthcare systems in contributing to errors, the propagation of errors through complex systems and, importantly, for understanding ambulatory primary care in the context of the larger healthcare system. The authors have developed such a model using a formal 'systems engineering' approach borrowed from the management sciences and engineering. This approach has not previously been formally described in the medical literature.This paper outlines the formal systems approach, presents our visual model of the system, and describes some experiences with and potential applications of the model for monitoring and improving safety. Applications include providing a framework to help focus research efforts, creation of new (visual) error reporting and taxonomy systems, furnishing a common and unambiguous vision for the healthcare team, and facilitating retrospective and prospective analyses of errors and adverse events. It is aimed at system redesign for safety improvement through a computer-based patient-centred safety enhancement and monitoring instrument (SEMI-P). This model can be integrated with electronic medical records (EMRs).