A mathematical structure is developed with the aim of analyzing the quality of a composite system such as a medical service inside an hospital. The approach belongs to the so-called generalized kinetic theory, and consists of a set of balanced equations about the probablity distribution functions of the system population over a state variable that represents the perceived quality. Internal and external actions are taken into account, by means of direct interactions and ensemble terms. The analysis aims at characterizing the physical variables that control the long time (or average) dynamics and to predict the effects that possible readjustments of the structure may produce on it. Both the case of a continuous state variable (leading to a system of nonlinear, nonlocal PDE's for the probability densities) and the case of a discrete state variable (leading to a system of ODE's) will be discussed.