//Adds patients meta-data into sqlite storage private void AddPatientToList() { RaiseButtonPressed(); IsBusy = true; //Must be set to false, set to true for testing IsButtonEnabled = true; try { //Connect to the local database and insert item PatientsWaintingLineDb.InsertPatient(patientObj); //Remove from PatientAwaitingCheckIn PatientAwatingCheckIn.RemoveFromList(patientObj); Task.Delay(250); //Auto close the pop up afterwards PopupNavigation.Instance.PopAllAsync(true); } catch (Exception ex) { //also send error logging to backend throw ex; } finally { IsBusy = false; IsButtonEnabled = true; } }
//Note: Not sure if this violates MVVM rules but the only way to update the Ui in a tab since it is initalized on load //Is using the onAppearing method to render any changes and this is the only way of doing it. protected override void OnAppearing() { base.OnAppearing(); viewModel.List.Clear(); foreach (var patients in PatientsWaintingLineDb.GetPatientsAsync().Result) { viewModel.List.Add(patients); } }
private ObservableCollection <PatientMeta> InitalizeList() { List = new ObservableCollection <PatientMeta>(); List.Clear(); foreach (var patientCheckedIn in PatientsWaintingLineDb.GetPatientsAsync().Result) { List.Add(patientCheckedIn); } UpdateList(List); return(List); }
protected override void OnStart() { // Handle when your app starts /* * Clear the local database **More logic based on time etc. * needed This will have to do for now */ PatientsWaintingLineDb.ClearLocalDatabase(); PrescriptionLocalDb.ClearBusket(); //Get doctors location DoctorLocationTracker doctorLocationTracker = new DoctorLocationTracker(); Task.FromResult(doctorLocationTracker.GetCurrentLocationAsync()); }
private ObservableCollection <PatientMeta> InitailizeList() { DiagnoseList = new ObservableCollection <PatientMeta>(); PatientMeta meta; foreach (var item in PatientsWaintingLineDb.GetPatientsAsync().Result) { meta = new PatientMeta() { FullName = item.FullName, ProfilePicture = item.ProfilePicture, Appointment = item.Appointment, LineNumber = lineNumber }; lineNumber++; DiagnoseList.Add(meta); } return(DiagnoseList); }
public void UpdateList(ObservableCollection <PatientMeta> _patientList) { PatientsWaintingLineDb.RefreshList(_patientList); }