Hospitals reach agreement