Esempio n. 1
0
		private void grid_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) {
			SelectedPatNum=PIn.Long(Table.Rows[e.Row]["PatNum"].ToString());
			Cursor=Cursors.WaitCursor;
			long selectedApt=PIn.Long(Table.Rows[e.Row]["AptNum"].ToString());
			//Appointment apt=Appointments.GetOneApt(selectedApt);
			FormApptEdit FormA=new FormApptEdit(selectedApt);
			FormA.PinIsVisible=true;
			FormA.ShowDialog();
			if(FormA.PinClicked) {
				PinClicked=true;
				AptSelected=selectedApt;
				DialogResult=DialogResult.OK;
				return;
			}
			else {
				FillMain();
			}
			for(int i=0;i<Table.Rows.Count;i++){
				if(PIn.Long(Table.Rows[i]["AptNum"].ToString())==selectedApt){
					grid.SetSelected(i,true);
				}
			}
			SetFamilyColors();
			Cursor=Cursors.Default;
		}
Esempio n. 2
0
        //private void tbApts_CellDoubleClicked(object sender, CellEventArgs e){

        //}

        private void grid_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            int          currentSelection = e.Row;            //tbApts.SelectedRow;
            int          currentScroll    = grid.ScrollValue; //tbApts.ScrollValue;
            FormApptEdit FormAE           = new FormApptEdit(ListUn[e.Row]);

            FormAE.PinIsVisible = true;
            FormAE.ShowDialog();
            if (FormAE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormAE.PinClicked)
            {
                PinClicked = true;
                CreateCurInfo(ListUn[e.Row]);
                DialogResult = DialogResult.OK;
            }
            else
            {
                FillGrid();
                grid.SetSelected(currentSelection, true);
                grid.ScrollValue = currentScroll;
            }
        }
Esempio n. 3
0
        private void menuItemGoToPlanned_Click(object sender, EventArgs e)
        {
            FormApptEdit FormAPT = new FormApptEdit(_apptNumPlanned);

            FormAPT.ShowDialog();
            //consider refreshing data
        }
Esempio n. 4
0
        private void grid_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            int currentSelection = e.Row;
            int currentScroll    = grid.ScrollValue;

            SelectedPatNum = ListASAP[e.Row].PatNum;
            FormApptEdit FormAE = new FormApptEdit(ListASAP[e.Row].AptNum);

            FormAE.PinIsVisible = true;
            FormAE.ShowDialog();
            if (FormAE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormAE.PinClicked)
            {
                PinClicked   = true;
                AptSelected  = ListASAP[e.Row].AptNum;
                DialogResult = DialogResult.OK;
            }
            else
            {
                FillGrid();
                grid.SetSelected(currentSelection, true);
                grid.ScrollValue = currentScroll;
            }
        }
Esempio n. 5
0
        private void tbApts_CellDoubleClicked(object sender, CellEventArgs e)
        {
            int          currentSelection = tbApts.SelectedRow;
            int          currentScroll    = tbApts.ScrollValue;
            FormApptEdit FormAE           = new FormApptEdit(ListOth[e.Row].AptNum);

            FormAE.PinIsVisible = true;
            FormAE.ShowDialog();
            if (FormAE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormAE.PinClicked)
            {
                if (!OKtoSendToPinboard(ListOth[e.Row]))
                {
                    return;
                }
                AptSelected  = ListOth[e.Row].AptNum;
                oResult      = OtherResult.CopyToPinBoard;
                DialogResult = DialogResult.OK;
            }
            else
            {
                Filltb();
                tbApts.SetSelected(currentSelection, true);
                tbApts.ScrollValue = currentScroll;
            }
        }
Esempio n. 6
0
        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;
            }
        }
Esempio n. 7
0
        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;
            }
        }
Esempio n. 8
0
        private void tbApts_CellDoubleClicked(object sender, CellEventArgs e)
        {
            SelectedPatNum = ListUn[e.Row].PatNum;
            int          currentSelection = tbApts.SelectedRow;
            int          currentScroll    = tbApts.ScrollValue;
            FormApptEdit FormAE           = new FormApptEdit(ListUn[e.Row].AptNum);

            FormAE.PinIsVisible = true;
            FormAE.ShowDialog();
            if (FormAE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormAE.PinClicked)
            {
                PinClicked   = true;
                AptSelected  = ListUn[e.Row].AptNum;
                DialogResult = DialogResult.OK;
                return;
            }
            else
            {
                FillAppointments();
                tbApts.SetSelected(currentSelection, true);
                tbApts.ScrollValue = currentScroll;
            }
        }
Esempio n. 9
0
        private void OpenEditAppointmentWindow(GridRow row)
        {
            long         aptNum = PIn.Long(row.Tag.ToString());
            FormApptEdit formAE = new FormApptEdit(aptNum);

            formAE.ShowDialog();
            if (formAE.DialogResult == DialogResult.OK)
            {
                FillGrid();
            }
        }
Esempio n. 10
0
		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;
		}
Esempio n. 11
0
        private void grid_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            int          selectedApt = PIn.PInt(table.Rows[e.Row]["AptNum"].ToString());
            Appointment  apt         = Appointments.GetOneApt(selectedApt);
            FormApptEdit FormA       = new FormApptEdit(apt);

            FormA.ShowDialog();
            //if(FormA.DialogResult==DialogResult.Cancel){
            //	Cursor=Cursors.Default;
            FillMain();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (PIn.PInt(table.Rows[i]["AptNum"].ToString()) == selectedApt)
                {
                    grid.SetSelected(i, true);
                }
            }
            SetFamilyColors();
            Cursor = Cursors.Default;
        }
Esempio n. 12
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            int  currentSelection = e.Row;
            int  currentScroll    = gridMain.ScrollValue;
            long aptNum           = gridMain.SelectedTag <long>();//Tag is AptNum

            if (IsSelectedApptOtherNull())
            {
                return;
            }
            FormApptEdit formApptEdit = new FormApptEdit(aptNum);

            formApptEdit.IsInViewPatAppts = true;
            formApptEdit.PinIsVisible     = true;
            formApptEdit.ShowDialog();
            if (formApptEdit.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (formApptEdit.PinClicked)
            {
                if (IsSelectedApptOtherNull())
                {
                    return;
                }
                SendToPinboardEvent.Fire(ODEventType.SendToPinboard, new PinBoardArgs(PatCur, SelectedApptOther, _listApptOthers));
            }
            else
            {
                RefreshData(PatCur, null);
                _actionFillFamily?.Invoke();
                FillGrid();
                gridMain.SetSelected(currentSelection, true);
                gridMain.ScrollValue = currentScroll;
            }
        }
Esempio n. 13
0
        ///<summary>Offers to use unscheduled appt.  Shows ApptEdit window. Sets Prospective, if necessary.  Fires Automation triggers.  ListAptNumsSelected will contain the AptNum of the new appointment.</summary>
        public void MakeAppointment()
        {
            //Check to see if the patient has any unscheduled appointments and inform the user.
            List <Appointment> listUnschedAppts = Appointments.GetUnschedApptsForPat(_patCur.PatNum);

            //Per Nathan, pinboard appointments will not be considered unscheduled for this logic.
            listUnschedAppts.RemoveAll(x => x.AptNum.In(_listPinboardApptNums));
            FormApptEdit formApptEdit            = null;
            long         aptNum                  = 0;
            bool         isSchedulingUnscheduled = false;

            if (listUnschedAppts.Count > 0 &&
                MsgBox.Show(this, MsgBoxButtons.YesNo, "This patient has an unscheduled appointment, would you like to use an existing unscheduled appointment?"))
            {
                if (listUnschedAppts.Count == 1)
                {
                    aptNum = listUnschedAppts[0].AptNum;
                }
                else                  //Multiple unscheduled appointments, let the user pick which one to use.
                {
                    FormUnschedListPatient formUnschedListPatient = new FormUnschedListPatient(_patCur);
                    if (formUnschedListPatient.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    //Use the appointment the user selected.
                    aptNum = formUnschedListPatient.SelectedAppt.AptNum;
                }
                isSchedulingUnscheduled = true;
            }
            formApptEdit       = new FormApptEdit(aptNum, patNum: _patCur.PatNum, useApptDrawingSettings: IsInitialDoubleClick, patient: _patCur, dateTNew: DateTNew, opNumNew: OpNumNew);
            formApptEdit.IsNew = (aptNum == 0);
            formApptEdit.IsSchedulingUnscheduledAppt = isSchedulingUnscheduled;
            formApptEdit.ShowDialog();
            if (formApptEdit.DialogResult != DialogResult.OK)
            {
                return;
            }
            Appointment aptCur = formApptEdit.GetAppointmentCur();

            if (IsInitialDoubleClick)
            {
                if (isSchedulingUnscheduled)                 //User double clicked in Appointment Module, intending to schedule appointment at a specific time/op/etc.
                {
                    Appointment aptOld = aptCur.Copy();
                    aptCur.AptDateTime = DateTimeClicked;
                    aptCur.Op          = OpNumClicked;
                    if (_patCur != null && _patCur.AskToArriveEarly > 0)
                    {
                        aptCur.DateTimeAskedToArrive = aptCur.AptDateTime.AddMinutes(-_patCur.AskToArriveEarly);
                    }
                    aptCur           = Appointments.AssignFieldsForOperatory(aptCur);
                    aptCur.AptStatus = ApptStatus.Scheduled;
                    Appointments.Update(aptCur, aptOld);
                }
                //Change PatStatus to Prospective or from Prospective.
                Operatory opCur = Operatories.GetOperatory(aptCur.Op);
                if (opCur != null)
                {
                    if (opCur.SetProspective && _patCur.PatStatus != PatientStatus.Prospective)                    //Don't need to prompt if patient is already prospective.
                    {
                        if (MsgBox.Show(this, MsgBoxButtons.OKCancel, "Patient's status will be set to Prospective."))
                        {
                            Patient patOld = _patCur.Copy();
                            _patCur.PatStatus = PatientStatus.Prospective;
                            Patients.Update(_patCur, patOld);
                        }
                    }
                    else if (!opCur.SetProspective && _patCur.PatStatus == PatientStatus.Prospective)
                    {
                        if (MsgBox.Show(this, MsgBoxButtons.OKCancel, "Patient's status will change from Prospective to Patient."))
                        {
                            Patient patOld = _patCur.Copy();
                            _patCur.PatStatus = PatientStatus.Patient;
                            Patients.Update(_patCur, patOld);
                        }
                    }
                }
            }
            ListAptNumsSelected.Add(aptCur.AptNum);
            if (IsInitialDoubleClick)
            {
                _otherResult = OtherResult.CreateNew;
            }
            else
            {
                _otherResult = OtherResult.NewToPinBoard;
            }
            if (aptCur.IsNewPatient)
            {
                AutomationL.Trigger(AutomationTrigger.CreateApptNewPat, null, aptCur.PatNum, aptCur.AptNum);
            }
            AutomationL.Trigger(AutomationTrigger.CreateAppt, null, aptCur.PatNum, aptCur.AptNum);
            DialogResult = DialogResult.OK;
        }
Esempio n. 14
0
        private void butNote_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.AppointmentCreate))
            {
                return;
            }
            if (PatRestrictionL.IsRestricted(_patCur.PatNum, PatRestrict.ApptSchedule))
            {
                return;
            }
            Appointment aptCur = new Appointment();

            aptCur.PatNum = _patCur.PatNum;
            if (_patCur.DateFirstVisit.Year < 1880 &&
                !Procedures.AreAnyComplete(_patCur.PatNum))                   //this only runs if firstVisit blank
            {
                aptCur.IsNewPatient = true;
            }
            aptCur.Pattern = "/X/";
            if (_patCur.PriProv == 0)
            {
                aptCur.ProvNum = PrefC.GetLong(PrefName.PracticeDefaultProv);
            }
            else
            {
                aptCur.ProvNum = _patCur.PriProv;
            }
            aptCur.ProvHyg    = _patCur.SecProv;
            aptCur.AptStatus  = ApptStatus.PtNote;
            aptCur.ClinicNum  = _patCur.ClinicNum;
            aptCur.TimeLocked = PrefC.GetBool(PrefName.AppointmentTimeIsLocked);
            if (IsInitialDoubleClick)             //initially double clicked on appt module
            {
                aptCur.AptDateTime = DateTimeClicked;
                aptCur.Op          = OpNumClicked;
            }
            else
            {
                //new appt will be placed on pinboard instead of specific time
            }
            try {
                if (!AppointmentL.IsSpecialtyMismatchAllowed(_patCur.PatNum, aptCur.ClinicNum))
                {
                    return;
                }
                Appointments.Insert(aptCur);
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            FormApptEdit formApptEdit = new FormApptEdit(aptCur.AptNum);

            formApptEdit.IsNew = true;
            formApptEdit.ShowDialog();
            if (formApptEdit.DialogResult != DialogResult.OK)
            {
                return;
            }
            ListAptNumsSelected.Add(aptCur.AptNum);
            if (IsInitialDoubleClick)
            {
                _otherResult = OtherResult.CreateNew;
            }
            else
            {
                _otherResult = OtherResult.NewToPinBoard;
            }
            DialogResult = DialogResult.OK;
        }
Esempio n. 15
0
        private void butNew_Click(object sender, System.EventArgs e)
        {
            Appointment AptCur = new Appointment();

            AptCur.PatNum = PatCur.PatNum;
            if (PatCur.DateFirstVisit.Year < 1880 &&
                !Procedures.AreAnyComplete(PatCur.PatNum))                   //this only runs if firstVisit blank
            {
                AptCur.IsNewPatient = true;
            }
            AptCur.Pattern = "/X/";
            if (PatCur.PriProv == 0)
            {
                AptCur.ProvNum = PIn.PInt(((Pref)PrefB.HList["PracticeDefaultProv"]).ValueString);
            }
            else
            {
                AptCur.ProvNum = PatCur.PriProv;
            }
            AptCur.ProvHyg   = PatCur.SecProv;
            AptCur.AptStatus = ApptStatus.Scheduled;
            AptCur.ClinicNum = PatCur.ClinicNum;
            if (InitialClick)            //initially double clicked on appt module
            {
                DateTime d;
                if (ContrApptSheet.IsWeeklyView)
                {
                    d = ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
                }
                else
                {
                    d = Appointments.DateSelected;
                }
                int minutes = (int)(ContrAppt.SheetClickedonMin / ContrApptSheet.MinPerIncr) * ContrApptSheet.MinPerIncr;
                AptCur.AptDateTime = new DateTime(d.Year, d.Month, d.Day
                                                  , ContrAppt.SheetClickedonHour, minutes, 0);
                AptCur.Op = ContrAppt.SheetClickedonOp;
                Operatory curOp = Operatories.GetOperatory(AptCur.Op);
                if (curOp.ProvDentist != 0)
                {
                    AptCur.ProvNum = curOp.ProvDentist;
                }
                AptCur.ProvHyg   = curOp.ProvHygienist;
                AptCur.IsHygiene = curOp.IsHygiene;
                AptCur.ClinicNum = curOp.ClinicNum;
                try {
                    Appointments.InsertOrUpdate(AptCur, null, true);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                //new appt will be placed on pinboard instead of specific time
            }
            try{
                Appointments.InsertOrUpdate(AptCur, null, true);
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            FormApptEdit FormApptEdit2 = new FormApptEdit(AptCur.AptNum);

            FormApptEdit2.IsNew = true;
            FormApptEdit2.ShowDialog();
            if (FormApptEdit2.DialogResult != DialogResult.OK)
            {
                return;
            }
            AptSelected = AptCur.AptNum;
            if (InitialClick)
            {
                oResult = OtherResult.CreateNew;
            }
            else
            {
                oResult = OtherResult.NewToPinBoard;
            }
            DialogResult = DialogResult.OK;
        }
Esempio n. 16
0
        ///<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);
        }