Civil judge pays surprise visit to hospital