public async void PromoverAppointment(Patient Patient) { var result = await dialogService.DisplayActionSheetAsync("Selecione a operação desejada para o pedido de interconsulta", "Cancelar", null, "Aceitar", "Negar"); var action = Patient.ActionCollection.FirstOrDefault(x => x.Id == Action.Id); switch (result) { case "Aceitar": action.IsRelease = false; action.IsAppointment = true; action.IsListWaiting = false; action.IsInterconsultationtion = false; await patientRepository.AddOrUpdateAsync(Patient, Patient.Id); await navigationService.GoBackAsync(); return; case "Negar": Responsible responsible = await responsibleRepository.GetAsync(Settings.UserId); Message message = new Message { Date = DateTime.Now, IdAction = Action.Id, IdFrom = Settings.UserId, NameFrom = responsible.NameCompleto, IdTo = action.ProfessorIdFrom, Body = "Recusou o pedido de interconsulta para o paciente " + Patient.NameCompleto + ", para a ação " + Action.Name }; await messageRepository.AddAsync(message); Patient.ActionCollection.Remove(action); await patientRepository.AddOrUpdateAsync(Patient, Patient.Id); await navigationService.GoBackAsync(); break; } }
public async void PromoverListWaiting(Patient Patient) { var action = Patient.ActionCollection.FirstOrDefault(x => x.Id == Action.Id); action.IsRelease = false; action.IsAppointment = false; action.IsInterconsultationtion = false; action.IsListWaiting = true; await patientRepository.AddOrUpdateAsync(Patient, Patient.Id); await navigationService.GoBackAsync(); }
public async void DarReleaseAsync() { if (await MessageService.Instance.ShowAsyncYesNo("Deseja dar alta ao usuário?")) { var action = Patient.ActionCollection.FirstOrDefault(x => x.Id == Action.Id); action.IsRelease = true; action.IsInterconsultationtion = false; action.IsAppointment = false; action.IsListWaiting = false; await patientRepository.AddOrUpdateAsync(Patient, Patient.Id); await navigationService.GoBackAsync(); } }
public async void PromoverInterconsultationtion(ActionModel actionDestino) { if (Patient.ActionCollection.FirstOrDefault(x => x.Id == actionDestino.Id) == null) { Patient.ActionCollection.Add(new ListAppointment { Id = actionDestino.Id, ProfessorIdFrom = Settings.UserId, Name = actionDestino.Name, Added = true, IsRelease = false, IsAppointment = false, IsListWaiting = false, IsInterconsultationtion = true }); Responsible responsible = await responsibleRepository.GetAsync(Settings.UserId); Message message = new Message { Date = DateTime.Now, IdAction = Action.Id, IdFrom = Settings.UserId, NameFrom = responsible.NameCompleto, Body = "Enviou um pedido de interconsulta para o paciente " + Patient.NameCompleto + ", para a ação " + Action.Name }; await messageRepository.AddAsync(message); await patientRepository.AddOrUpdateAsync(Patient, Patient.Id); await navigationService.GoBackAsync(); } else { await MessageService.Instance.ShowAsync("Este usuário já está na ação " + actionDestino.Name); } }
public async void SavePatientAsync() { await patientRepository.AddOrUpdateAsync(Patient, Patient.Id); await navigationService.GoBackAsync(); }
public async void SavePatientAsync() { await patientRepository.AddOrUpdateAsync(Patient, Patient.Id); GetPatientAsync(); }