PurposeThe healthcare sector relies on knowledge management systems to improve knowledge flows and effectively capture, leverage and share knowledge with several organizational stakeholders. However, knowledge as a resource represents a social construct that involves additional managerial complexities and challenges, including undesirable knowledge behaviours. The aim of the current study is to provide insight on how knowledge management systems, knowledge hoarding, knowledge hiding and task conflict shape the quality of care provided by hospitals. We propose and test an original revealing model.Design/methodology/approachWe follow a quantitative approach to address the structural relationship between variables using a combination of factor analysis and multiple regression analysis. The model is tested adopting a structural equation modelling approach and using survey data conducted to 318 healthcare professionals working in Portuguese hospitals.FindingsThe main findings suggest that knowledge hiding is positively related to task conflict in hospitals, and task conflict negatively influences quality of care. Knowledge management systems directly and indirectly (via knowledge hoarding) promote quality of care. Moreover, knowledge management systems also mitigate the negative influence of task conflict over quality of care. We propose a final corollary on the relevant role of HRM as the backstage for the model.Practical implicationsOur research offers a novel insight into an overlap of organizational behaviour and healthcare management research. It provides an original framework on knowledge management systems, counterproductive knowledge behaviours and task conflict in hospital settings.Originality/valueOur research offers a novel insight into an overlap of organizational behaviour and healthcare management research. It provides an original framework on knowledge management systems, counterproductive knowledge behaviours and task conflict in hospital settings.