private void ButtonYes_Click(object sender, RoutedEventArgs e)
        {
            PageShowAppointments pageShowAppointments;

            if (patients.Count == 1)
            {
                pageShowAppointments = new PageShowAppointments(patients[0], false);
            }
            else
            {
                GridVisitedAppointmentsQuestion.Visibility = Visibility.Hidden;
                GridMultiplePatients.Visibility            = Visibility.Visible;
                pageShowAppointments = new PageShowAppointments(selectedPatient, true);
            }

            NavigationService.Navigate(pageShowAppointments);
        }
        private void CheckPatientStateAndShowAppointments(ItemPatient patient)
        {
            PageNotification.NotificationType?notificationType = null;
            selectedPatient = patient;

            if (patient.StopCodesCurrent.Contains(ItemPatient.StopCode.FirstTime))
            {
                notificationType = PageNotification.NotificationType.FirstVisit;
            }
            //else if (patient.StopCodesCurrent.Contains(ItemPatient.StopCodes.NotAvailableNow))
            //	notificationType = PageNotification.NotificationType.NoAppointmentsForNow;
            else if (patient.StopCodesCurrent.Contains(ItemPatient.StopCode.Cash))
            {
                notificationType = PageNotification.NotificationType.Cash;
            }
            else if (patient.StopCodesCurrent.Count > 0)
            {
                notificationType = PageNotification.NotificationType.VisitRegistryToCheckIn;
            }

            if (notificationType.HasValue)
            {
                NavigationService.Navigate(new PageNotification(notificationType.Value, returnBack: returnBack));
                SetImage(patient, false);
                return;
            }

            bool isOk = true;

            if (patient.AppointmentsNotAvailable.Count >= 0 &&
                patient.AppointmentsAvailable.Count == 0 &&
                patient.AppointmentsVisited.Count == 0)
            {
                PageNotification pageAppointmentsNotFound =
                    new PageNotification(PageNotification.NotificationType.NoAppointmentsForNow, returnBack: returnBack);
                NavigationService.Navigate(pageAppointmentsNotFound);
                isOk = false;
            }
            else if (
                patient.AppointmentsVisited.Count >= 0 &&
                patient.AppointmentsAvailable.Count == 0)
            {
                //do you want to see already checked appointments?
                BindingValues.Instance.SetUpMainWindow(patient.Name + ",", false, false);
                GridVisitedAppointmentsQuestion.Visibility = Visibility.Visible;

                if (patients.Count == 1)
                {
                    GridSinglePatient.Visibility = Visibility.Hidden;
                }
                else
                {
                    GridMultiplePatients.Visibility = Visibility.Hidden;
                }
            }
            else
            {
                PageShowAppointments pageAppointmentsShow = new PageShowAppointments(patient, returnBack);
                NavigationService.Navigate(pageAppointmentsShow);
            }

            SetImage(patient, isOk);
        }