SA government settles hospitals dispute