BackgroundHospital patient safety is a major social problem. In the UK, policy responses focus on the introduction of improvement programmes that seek to implement evidence-based clinical practices using the Model for Improvement, Plan-Do-Study-Act cycle. Empirical evidence that the outcomes of such programmes vary across hospitals demonstrates that the context of their implementation matters. However, the relationships between features of context and the implementation of safety programmes are both undertheorised and poorly understood in empirical terms.ObjectivesThis study is designed to address gaps in conceptual, methodological and empirical knowledge about the influence of context on the local implementation of patient safety programmes.DesignWe used concepts from critical realism and institutional analysis to conduct a qualitative comparative-intensive case study involving 21 hospitals across all seven Welsh health boards. We focused on the local implementation of three focal interventions from the 1000 Lives+patient safety programme: Improving Leadership for Quality Improvement, Reducing Surgical Complications and Reducing Health-care Associated Infection. Our main sources of data were 160 semistructured interviews, observation and 1700 health policy and organisational documents. These data were analysed using the realist approaches of abstraction, abduction and retroduction.SettingWelsh Government and NHS Wales.ParticipantsInterviews were conducted with 160 participants including government policy leads, health managers and professionals, partner agencies with strategic oversight of patient safety, advocacy groups and academics with expertise in patient safety.Main outcome measuresIdentification of the contextual factors pertinent to the local implementation of the 1000 Lives+patient safety programme in Welsh NHS hospitals.ResultsAn innovative conceptual framework harnessing realist social theory and institutional theory was produced to address challenges identified within previous applications of realist inquiry in patient safety research. This involved the development and use of an explanatory intervention–context–mechanism–agency–outcome (I-CMAO) configuration to illustrate the processes behind implementation of a change programme. Our findings, illustrated by multiple nested I-CMAO configurations, show how local implementation of patient safety interventions are impacted and modified by particular aspects of context: specifically, isomorphism, by which an intervention becomes adapted to the environment in which it is implemented; institutional logics, the beliefs and values underpinning the intervention and its source, and their perceived legitimacy among different groups of health-care professionals; and the relational structure and power dynamics of the functional group, that is, those tasked with implementing the initiative. This dynamic interplay shapes and guides actions leading to the normalisation or the rejection of the patient safety programme.ConclusionsHeightened awareness of the influence of context on the local implementation of patient safety programmes is required to inform the design of such interventions and to ensure their effective implementation and operationalisation in the day-to-day practice of health-care teams. Future work is required to elaborate our conceptual model and findings in similar settings where different interventions are introduced, and in different settings where similar innovations are implemented.FundingThe National Institute for Health Research Health Services and Delivery Research programme.