This paper analyses the decision to invest in quality by a hospital in an environment where doctors are devoted workers, i.e. they care for specific aspects of the output they produce. We assume that quality is the result of both an investment in new technology and the effort of the medical staff. Hospital services are paid on the basis of their marginal cost of production while the number of patients treated depends on a purchasing rule which discriminates for the level and timing of the investment. We show that the presence of devoted doctors affects the trade-off between investment and the purchasing rule so that for the hospital it is not always optimal to anticipate the investment decision.