findClosestAppointment implemented in db