A theory of congestion in general hospitals