Bayesian semiparametric logit models are fitted to grouped data related to in-hospital survival outcome of patients hospitalized with an ST-segment elevation myocardial infarction diagnosis. Dependent Dirichlet process priors are considered for modelling the random-effects distribution of the grouping factor (hospital of admission), to provide a cluster analysis of the hospitals. The clustering structure is highlighted through the optimal random partition that minimizes the posterior expected value of a suitable loss function. There are two main goals of the work: to provide model-based clustering and ranking of the providers according to the similarity of their effect on patients' outcomes, and to make reliable predictions on the survival outcome at the patient's level, even when the survival rate itself is strongly unbalanced. The study is within a project, named the ‘Strategic program of Regione Lombardia’, and is aimed at supporting decisions in healthcare policies.