private async Task SearchDiagnoses(string value, bool isCode = false) //эксперементальная функция горячего поиска, нужно прерывание и задержка { if (value.Length > (isCode ? 1 : 2)) { if (CurrentDiagnosis == null) { IsLoadingDiagnosis = true; try { var result = await _therapyDataService.GetDiagnoses(value, isCode); Diagnoses.Clear(); foreach (Diagnosis diagnosis in result) { Diagnoses.Add(diagnosis); //if (diagnosis.Title == value) CurrentDiagnosis = diagnosis; } } catch (Exception ex) { NotificationManager.AddItem(new NotificationItem(NotificationType.Error, TimeSpan.FromSeconds(3), ex.Message, true)); } IsLoadingDiagnosis = false; } } else { CurrentDiagnosisGroup = null; CurrentDiagnosis = null; } }
public void Reset() { Symptoms.Clear(); Diagnoses.Clear(); Treatments.Clear(); DialogList.Clear(); Variables.ValuesDictionary.Clear(); }
public void Copy(FlowDataCache flowDataCache) { Symptoms.Clear(); Symptoms.AddRange(flowDataCache.Symptoms); Diagnoses.Clear(); Diagnoses.AddRange(flowDataCache.Diagnoses); Treatments.Clear(); Treatments.AddRange(flowDataCache.Treatments); DialogList.Clear(); DialogList.AddRange(flowDataCache.DialogList); Variables.ValuesDictionary.Clear(); Variables.SetValues(flowDataCache.Variables.ValuesDictionary); }
private async Task GetDiagnoses(DiagnosisGroup diagnosisGroup) { IsLoadingDiagnosis = true; try { Diagnoses.Clear(); var res = await _therapyDataService.GetDiagnoses(diagnosisGroup); foreach (Diagnosis diagnosis in res) { Diagnoses.Add(diagnosis); } } catch (Exception ex) { NotificationManager.AddException(ex, 4); } IsLoadingDiagnosis = false; }