private async void ServiceHistory(RequestServicesHistoryLists request)
        {
            dialogService.ShowProgress();
            ResponseServicesHistoryLists response = await apiService.GetServicesHistoryLists(request);

            ValidateResponseServicesHistoryLists(response);
            dialogService.HideProgress();
        }
        private void ValidateResponseServicesHistoryLists(ResponseServicesHistoryLists response)
        {
            if (response.Success && response.StatusCode == 0)
            {
                Cities       = new ObservableCollection <City>();
                Doctors      = new ObservableCollection <Doctor>();
                Services     = new ObservableCollection <ServicesType>();
                Specialities = new ObservableCollection <Speciality>();

                Cities.Add(new City {
                    Code = "-1", Name = " "
                });
                foreach (City city in response.ServicesHistoryLists.Cities)
                {
                    if (!string.IsNullOrEmpty(city.Code) && !string.IsNullOrEmpty(city.Name))
                    {
                        Cities.Add(city);
                    }
                }

                Doctors.Add(new Doctor {
                    Code = "-1", Name = " "
                });
                foreach (Doctor doctor in response.ServicesHistoryLists.Doctors)
                {
                    if (!string.IsNullOrEmpty(doctor.Code) && !string.IsNullOrEmpty(doctor.Name))
                    {
                        Doctors.Add(doctor);
                    }
                }

                Services.Add(new ServicesType {
                    Code = "-1", Name = " "
                });
                foreach (ServicesType service in response.ServicesHistoryLists.ServicesType)
                {
                    if (!string.IsNullOrEmpty(service.Code) && !string.IsNullOrEmpty(service.Name))
                    {
                        Services.Add(service);
                    }
                }

                Specialities.Add(new Speciality {
                    Code = "-1", Name = " "
                });
                foreach (Speciality speciality in response.ServicesHistoryLists.Specialities)
                {
                    if (!string.IsNullOrEmpty(speciality.Code) && !string.IsNullOrEmpty(speciality.Name))
                    {
                        Specialities.Add(speciality);
                    }
                }
            }
        }
        public async Task LoadData()
        {
            dialogService.ShowProgress();

            RequestMinorAuthorizations requestMinor = new RequestMinorAuthorizations
            {
                DocumentType = loginViewModel.User.DocumentType,
                Document     = loginViewModel.User.Document
            };

            Minors.Clear();

            ResponseMinorAuthorizations responseMinor = await apiService.GetMinorAuthorizations(requestMinor);

            dialogService.HideProgress();

            if (await validatorService.ValidateResponse(responseMinor) == false)
            {
                await navigationService.Back();

                return;
            }

            dialogService.ShowProgress();

            MinorSelected = new Minor
            {
                Document     = loginViewModel.User.Document,
                DocumentType = loginViewModel.User.DocumentType,
                NameOne      = loginViewModel.User.NameOne,
                NameTwo      = loginViewModel.User.NameTwo,
                LastNameOne  = loginViewModel.User.LastNameOne,
                LastNameTwo  = loginViewModel.User.LastNameTwo
            };

            IsVisiblePatient = SetUserAutenticated = responseMinor.Minors != null && responseMinor.Minors.Where(x => x.Status.Equals("1")).ToList().Count > 0;

            if (IsVisiblePatient)
            {
                Minors.Add(MinorSelected);

                foreach (Minor minor in responseMinor.Minors)
                {
                    if (minor.Status == "1")
                    {
                        Minors.Add(minor);
                    }
                }
            }

            RequestServicesHistoryLists request = new RequestServicesHistoryLists
            {
                Document     = loginViewModel.User.Document,
                DocumentType = loginViewModel.User.DocumentType
            };

            ResponseServicesHistoryLists response = await apiService.GetServicesHistoryLists(request);

            ValidateResponseServicesHistoryLists(response);
            dialogService.HideProgress();
        }