private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { int currentSelection = gridMain.GetSelectedIndex(); int currentScroll = gridMain.ScrollValue; Patient pat = Patients.GetPat(_listPlannedAppts[e.Row].PatNum); //Only one can be selected at a time in this grid. FormOpenDental.S_Contr_PatientSelected(pat, true); FormApptEdit FormAE = new FormApptEdit(_listPlannedAppts[e.Row].AptNum); FormAE.PinIsVisible = true; FormAE.ShowDialog(); if (FormAE.DialogResult != DialogResult.OK) { return; } if (FormAE.PinClicked) { SendPinboard_Click(); DialogResult = DialogResult.OK; } else { RefreshAptList(); FillGrid(); gridMain.SetSelected(currentSelection, true); gridMain.ScrollValue = currentScroll; } }
private void grid_CellDoubleClick(object sender, ODGridClickEventArgs e) { int currentSelection = e.Row; //tbApts.SelectedRow; int currentScroll = grid.ScrollValue; //tbApts.ScrollValue; Patient pat = Patients.GetPat(_listUnschedApt[e.Row].PatNum); //If multiple selected, just take the one that was clicked on. FormOpenDental.S_Contr_PatientSelected(pat, true); FormApptEdit FormAE = new FormApptEdit(_listUnschedApt[e.Row].AptNum); FormAE.PinIsVisible = true; FormAE.ShowDialog(); if (FormAE.DialogResult != DialogResult.OK) { return; } if (FormAE.PinClicked) { SendPinboard_Click(); //Whatever they double clicked on will still be selected, just fire the event. DialogResult = DialogResult.OK; //this is an obsolete line. Window stays open. } else { FillGrid(); grid.SetSelected(currentSelection, true); grid.ScrollValue = currentScroll; } }
private void SelectPatient_Click() { //If multiple selected, just take the last one to remain consistent with SendPinboard_Click. long patNum = _listUnschedApt[grid.SelectedIndices[grid.SelectedIndices.Length - 1]].PatNum; Patient pat = Patients.GetPat(patNum); FormOpenDental.S_Contr_PatientSelected(pat, true); }
private void SelectPatient_Click() { if(gridConflicts.SelectedIndices.Length==0) { MsgBox.Show(this,"Please select an appointment first."); return; } //If multiple selected, just take the last one to remain consistent with SendPinboard_Click. Patient pat=_listPatients.First(x => x.PatNum==_listAppts[gridConflicts.SelectedIndices[gridConflicts.SelectedIndices.Length-1]].PatNum); FormOpenDental.S_Contr_PatientSelected(pat,true); }
private void gridMain_CellClick(object sender, ODGridClickEventArgs e) { if (gridMain.SelectedIndices.Length != 1) { return; } long goToPatNum = PIn.Long(gridMain.Rows[e.Row].Tag.ToString()); Patient pat = Patients.GetPat(goToPatNum); FormOpenDental.S_Contr_PatientSelected(pat, false); }
private void menuItemGoTo_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select one payment first."); return; } long patNum = ((Payment)gridMain.Rows[gridMain.SelectedIndices[0]].Tag).PatNum; FormOpenDental.S_Contr_PatientSelected(Patients.GetPat(patNum), false); GotoModule.GotoAccount(0); }
///<summary>If multiple patients are selected in UnchedList, will select the last patient to remain consistent with sending to pinboard behavior.</summary> private void SeeChart_Click() { if (grid.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select an appointment first."); return; } Patient pat = Patients.GetPat(_listUnschedApt[grid.SelectedIndices[grid.SelectedIndices.Length - 1]].PatNum); //If multiple selected, just take the last one to remain consistent with SendPinboard_Click. FormOpenDental.S_Contr_PatientSelected(pat, false); GotoModule.GotoChart(pat.PatNum); }
private void SeeChart_Click() { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select an appointment first."); return; } //Only one can be selected at a time in this grid, but just in case we change it in the future it will select the last one in the list to be consistent with other patient selections. Patient pat = Patients.GetPat(_listPlannedAppts[gridMain.SelectedIndices[gridMain.SelectedIndices.Length - 1]].PatNum); FormOpenDental.S_Contr_PatientSelected(pat, false); GotoModule.GotoChart(pat.PatNum); }
private void goToChartToolStripMenuItem_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length != 1) { MsgBox.Show(this, "Please select a patient first."); return; } if (!Security.IsAuthorized(Permissions.ChartModule)) { return; } long patNum = PIn.Long(gridMain.Rows[gridMain.SelectedIndices[0]].Tag.ToString()); Patient pat = Patients.GetPat(patNum); FormOpenDental.S_Contr_PatientSelected(pat, false); SendToBack(); GotoModule.GotoChart(pat.PatNum); }
private void gridConflicts_DoubleClick(object sender,ODGridClickEventArgs e) { int currentSelection=e.Row; int currentScroll=gridConflicts.ScrollValue; Appointment apptCur=(Appointment)gridConflicts.ListGridRows[e.Row].Tag; long SelectedPatNum=apptCur.PatNum; Patient pat=_listPatients.First(x => x.PatNum==SelectedPatNum); FormOpenDental.S_Contr_PatientSelected(pat,true); FormApptEdit FormAE=new FormApptEdit(apptCur.AptNum); FormAE.PinIsVisible=true; FormAE.ShowDialog(); if(FormAE.DialogResult!=DialogResult.OK) { return; } if(FormAE.PinClicked) { SendPinboard_Click(); //Whatever they double clicked on will still be selected, just fire the event to send it to the pinboard. } gridConflicts.SetSelected(currentSelection,true); gridConflicts.ScrollValue=currentScroll; }
private void butNew_Click(object sender, System.EventArgs e) { if (!Security.IsAuthorized(Permissions.AppointmentCreate)) { return; } if (PatRestrictionL.IsRestricted(_patCur.PatNum, PatRestrict.ApptSchedule)) { return; } if (AppointmentL.PromptForMerge(_patCur, out _patCur)) { FillFamily(); odApptGrid.PatCur = _patCur; odApptGrid.RefreshAppts(); FormOpenDental.S_Contr_PatientSelected(_patCur, true, false); } if (_patCur != null && _patCur.PatStatus.In(PatientStatus.Archived, PatientStatus.Deceased)) { MsgBox.Show(this, "Appointments cannot be scheduled for " + _patCur.PatStatus.ToString().ToLower() + " patients."); return; } MakeAppointment(); }
///<summary></summary> public static PlannedApptStatus CreatePlannedAppt(Patient pat, int itemOrder, List <long> listPreSelectedProcNums = null) { if (!Security.IsAuthorized(Permissions.AppointmentCreate)) { return(PlannedApptStatus.Failure); } if (PatRestrictionL.IsRestricted(pat.PatNum, PatRestrict.ApptSchedule)) { return(PlannedApptStatus.Failure); } if (PromptForMerge(pat, out pat)) { FormOpenDental.S_Contr_PatientSelected(pat, true, false); } if (pat.PatStatus.In(PatientStatus.Archived, PatientStatus.Deceased)) { MsgBox.Show("Appointments", "Appointments cannot be scheduled for " + pat.PatStatus.ToString().ToLower() + " patients."); return(PlannedApptStatus.Failure); } Appointment AptCur = new Appointment(); AptCur.PatNum = pat.PatNum; AptCur.ProvNum = pat.PriProv; AptCur.ClinicNum = pat.ClinicNum; AptCur.AptStatus = ApptStatus.Planned; AptCur.AptDateTime = DateTimeOD.Today; List <Procedure> listProcs = Procedures.GetManyProc(listPreSelectedProcNums, false); //Returns empty list if null. //If listProcs is empty then AptCur.Pattern defaults to PrefName.AppointmentWithoutProcsDefaultLength value. //See Appointments.GetApptTimePatternForNoProcs(). AptCur.Pattern = Appointments.CalculatePattern(pat, AptCur.ProvNum, AptCur.ProvHyg, listProcs, isMake5Minute: true); AptCur.TimeLocked = PrefC.GetBool(PrefName.AppointmentTimeIsLocked); Appointments.Insert(AptCur); PlannedAppt plannedAppt = new PlannedAppt(); plannedAppt.AptNum = AptCur.AptNum; plannedAppt.PatNum = pat.PatNum; plannedAppt.ItemOrder = itemOrder; PlannedAppts.Insert(plannedAppt); Procedures.UpdateAptNums(listPreSelectedProcNums, plannedAppt.AptNum, true); //Simply returns if listPreSelectedProcNums is null FormApptEdit FormApptEdit = new FormApptEdit(AptCur.AptNum); FormApptEdit.IsNew = true; FormApptEdit.ShowDialog(); if (FormApptEdit.DialogResult != DialogResult.OK) { Procedures.UpdateAptNums(listPreSelectedProcNums, 0, true); //Simply returns if listPreSelectedProcNums is null return(PlannedApptStatus.FillGridNeeded); } //Only set the appointment hygienist to this patient's secondary provider if one was not manually set within the edit window. if (AptCur.ProvHyg < 1) { List <Procedure> myProcList = Procedures.GetProcsForSingle(AptCur.AptNum, true); bool allProcsHyg = (myProcList.Count > 0 && myProcList.Select(x => ProcedureCodes.GetProcCode(x.CodeNum)).ToList().All(x => x.IsHygiene)); //Automatically set the appointments hygienist to the secondary provider of the patient if one is set. if (allProcsHyg && pat.SecProv != 0) { Appointment aptOld = AptCur.Copy(); AptCur.ProvNum = pat.SecProv; Appointments.Update(AptCur, aptOld); } } Patient patOld = pat.Copy(); pat.PlannedIsDone = false; Patients.Update(pat, patOld); FormOpenDental.S_RefreshCurrentModule(isClinicRefresh: false); //if procs were added in appt, then this will display them return(PlannedApptStatus.Success); }