private async Task GetEntry(int entryId) { IsLoading = true; try { CurrentEntry = await _ambulatoryDataService.GetEntryById(entryId); if (CurrentEntry.EntryStatus == Enum.Parse <EntryStatus>("3")) { IsEditable = true; } else { IsEditable = false; } if (CurrentEntry.MedCard == null) { CurrentEntry.MedCard = new MedCard { Patient = CurrentEntry.Patient } } ; await Task.WhenAll(DiagnosticViewModel.Initialize(CurrentEntry), TherapyViewModel.Initialize(CurrentEntry)); EntryViewModel.Initialize(CurrentEntry); Caption = CurrentEntry.TargetDateTime.ToShortTimeString(); } catch (Exception ex) { NotificationManager.AddException(ex, 5); } IsLoading = false; }
public AmbulatoryViewModel(int entryId, AmbulatoryDataService ambulatoryDataService, DiagnosticViewModel diagnosticViewModel, TherapyViewModel therapyViewModel, EntryViewModel entryViewModel) { _ambulatoryDataService = ambulatoryDataService; _diagnosticViewModel = diagnosticViewModel; _therapyViewModel = therapyViewModel; _entryViewModel = entryViewModel; EntryId = entryId; GetEntry(entryId).ConfigureAwait(true); }