Пример #1
0
        ///<summary>Used in the case when clinics are disabled. Requires special logic that doesn't use clinics.</summary>
        private void FillComboSpecialtyNoClinics()
        {
            //Get all non-hidden specialties
            List <Def> listSpecialtyDefs = Defs.GetDefsForCategory(DefCat.ClinicSpecialty, true);
            //Fill the list of defLinks used by clones of this patient.
            List <long>    listClonePatNums   = PatientLinks.GetPatNumsLinkedFrom(_patientMaster.PatNum, PatientLinkType.Clone);
            List <DefLink> listPatCurDefLinks = DefLinks.GetListByFKeys(listClonePatNums, DefLinkType.Patient);

            //Filter out any specialties that are currently in use by clones of this patient.
            if (listPatCurDefLinks.Count > 0)
            {
                listSpecialtyDefs.RemoveAll(x => x.DefNum.In(listPatCurDefLinks.Select(y => y.DefNum).ToList()));
            }
            comboSpecialty.Items.Clear();
            //Create a dummy specialty of 0.  Always allow the user to make Unspecified clones.
            comboSpecialty.Items.Add(new ODBoxItem <Def>(Lan.g(this, "Unspecified"), new Def()
            {
                DefNum = 0
            }));
            foreach (Def specialty in listSpecialtyDefs)
            {
                comboSpecialty.Items.Add(new ODBoxItem <Def>(specialty.ItemName, specialty));
            }
            comboSpecialty.SelectedIndex = 0;
        }
Пример #2
0
        ///<summary>Fills both the Specialty and Clinic combo boxes according to the available clinics to the user and the unused specialties for the patient.
        ///Only fills the combo box of clinics with clinics that are associated to specialties that have not been used for this patient yet.
        ///E.g. Even if the user has access to Clinic X, if there is already a clone of this patient for Clinic X, it will no longer show.
        ///Throws exceptions that should be shown to the user which should then be followed by closing the window.</summary>
        private void FillClinicComboBoxes()
        {
            _dictSpecialtyClinics = new Dictionary <long, List <Clinic> >();
            //Fill the list of clinics for this user.
            List <Clinic> listClinicsForUser = Clinics.GetForUserod(Security.CurUser);
            //Make a deep copy of the list of clinics so that we can filter down to the clinics that have no specialty specified if all are hidden.
            List <Clinic> listClinicsNoSpecialty = listClinicsForUser.Select(x => x.Copy()).ToList();
            //Fill the list of defLinks used by clones of this patient.
            List <long>    listClonePatNum    = PatientLinks.GetPatNumsLinkedFrom(_patientMaster.PatNum, PatientLinkType.Clone);
            List <DefLink> listPatCurDefLinks = DefLinks.GetListByFKeys(listClonePatNum, DefLinkType.Patient);
            //Fill the list of clinics defLink
            List <DefLink> listClinicDefLinks = DefLinks.GetDefLinksByType(DefLinkType.Clinic);

            //Filter out any specialties that are currently in use by clones of this patient.
            if (listPatCurDefLinks.Count > 0)
            {
                listClinicDefLinks.RemoveAll(x => x.DefNum.In(listPatCurDefLinks.Select(y => y.DefNum).ToList()));
            }
            //Get all non-hidden specialties
            List <Def> listSpecialtyDefs = Defs.GetDefsForCategory(DefCat.ClinicSpecialty, true);

            //If there are specialties present, we need to know which clinics have no specialty set so that the user can always make clones for that specialty.
            if (listSpecialtyDefs.Count > 0)
            {
                listClinicsNoSpecialty.RemoveAll(x => x.ClinicNum.In(listClinicDefLinks.Select(y => y.FKey).ToList()));
            }
            //Remove all clinics that do not have any specialties from the original list of clinics for the user.
            listClinicsForUser.RemoveAll(x => !x.ClinicNum.In(listClinicDefLinks.Select(y => y.FKey).ToList()));
            //Filter out any specialties that are not associated to any available clinics for this user.
            listSpecialtyDefs.RemoveAll(x => !x.DefNum.In(listClinicDefLinks.Select(y => y.DefNum).ToList()));
            //Lump all of the left over specialties into a dictionary and slap the associated clinics to them.
            comboSpecialty.Items.Clear();
            //Create a dummy specialty of 0 if there are any clinics that do not have a specialty.
            if (listClinicsNoSpecialty != null && listClinicsNoSpecialty.Count > 0)
            {
                comboSpecialty.Items.Add(new ODBoxItem <Def>(Lan.g(this, "Unspecified"), new Def()
                {
                    DefNum = 0
                }));
                _dictSpecialtyClinics[0] = listClinicsNoSpecialty;
            }
            foreach (Def specialty in listSpecialtyDefs)
            {
                comboSpecialty.Items.Add(new ODBoxItem <Def>(specialty.ItemName, specialty));
                //Get a list of all deflinks for the def
                List <DefLink> listLinkForDef = listClinicDefLinks.FindAll(x => x.DefNum == specialty.DefNum).ToList();
                _dictSpecialtyClinics[specialty.DefNum] = listClinicsForUser.FindAll(x => x.ClinicNum.In(listLinkForDef.Select(y => y.FKey).ToList()));
            }
            //If there are no specialties to show, we need to let the user know that they need to associate at least one clinic to a specialty.
            if (_dictSpecialtyClinics.Count < 1)
            {
                MsgBox.Show(this, "This patient already has a clone for every Clinic Specialty available.\r\n"
                            + "In the main menu, click Setup, Definitions, Clinic Specialties category to add new specialties.\r\n"
                            + "In the main menu, click Lists, Clinics, and double click a clinic to set a Specialty.");
                DialogResult = DialogResult.Abort;
                return;
            }
            comboSpecialty.SelectedIndex = 0;
            FillComboClinic();
        }
Пример #3
0
        private void FillTabWebSchedNewPat()
        {
            int newPatApptDays = PrefC.GetInt(PrefName.WebSchedNewPatApptSearchAfterDays);

            textWebSchedNewPatApptMessage.Text              = PrefC.GetString(PrefName.WebSchedNewPatApptMessage);
            textWebSchedNewPatApptSearchDays.Text           = newPatApptDays > 0 ? newPatApptDays.ToString() : "";
            checkWebSchedNewPatForcePhoneFormatting.Checked = PrefC.GetBool(PrefName.WebSchedNewPatApptForcePhoneFormatting);
            DateTime dateWebSchedNewPatSearch = DateTime.Now;

            dateWebSchedNewPatSearch = dateWebSchedNewPatSearch.AddDays(newPatApptDays);
            textWebSchedNewPatApptsDateStart.Text = dateWebSchedNewPatSearch.ToShortDateString();
            FillListBoxWebSchedBlockoutTypes(PrefC.GetString(PrefName.WebSchedNewPatApptIgnoreBlockoutTypes).Split(new char[] { ',' }), listboxWebSchedNewPatIgnoreBlockoutTypes);
            FillGridWebSchedNewPatApptHostedURLs();
            FillGridWSNPAReasons();
            FillGridWebSchedNewPatApptOps();
            //This needs to happen after all of the previous fills because it's asynchronous.
            FillGridWebSchedNewPatApptTimeSlotsThreaded();
            long defaultStatus = PrefC.GetLong(PrefName.WebSchedNewPatConfirmStatus);

            comboWSNPConfirmStatuses.Items.AddDefs(Defs.GetDefsForCategory(DefCat.ApptConfirmed, true));
            comboWSNPConfirmStatuses.SetSelectedDefNum(defaultStatus);
            checkNewPatAllowProvSelection.Checked = PrefC.GetBool(PrefName.WebSchedNewPatAllowProvSelection);
            if (!PrefC.HasClinicsEnabled)
            {
                labelWSNPClinic.Visible    = false;
                comboWSNPClinics.Visible   = false;
                labelWSNPTimeSlots.Visible = false;
            }
            checkWSNPDoubleBooking.Checked = PrefC.GetInt(PrefName.WebSchedNewPatApptDoubleBooking) > 0;        //0 = Allow double booking, 1 = prevent
        }
        private void FillTabWebSchedNewPat()
        {
            int newPatApptDays = PrefC.GetInt(PrefName.WebSchedNewPatApptSearchAfterDays);

            textWebSchedNewPatApptMessage.Text              = PrefC.GetString(PrefName.WebSchedNewPatApptMessage);
            textWebSchedNewPatApptSearchDays.Text           = newPatApptDays > 0 ? newPatApptDays.ToString() : "";
            checkWebSchedNewPatForcePhoneFormatting.Checked = PrefC.GetBool(PrefName.WebSchedNewPatApptForcePhoneFormatting);
            DateTime dateWebSchedNewPatSearch = DateTime.Now;

            dateWebSchedNewPatSearch = dateWebSchedNewPatSearch.AddDays(newPatApptDays);
            textWebSchedNewPatApptsDateStart.Text = dateWebSchedNewPatSearch.ToShortDateString();
            FillListBoxWebSchedBlockoutTypes(PrefC.GetString(PrefName.WebSchedNewPatApptIgnoreBlockoutTypes).Split(new char[] { ',' }), listboxWebSchedNewPatIgnoreBlockoutTypes);
            FillGridWebSchedNewPatApptHostedURLs();
            FillGridWSNPAReasons();
            FillGridWebSchedNewPatApptOps();
            //This needs to happen after all of the previous fills because it's asynchronous.
            FillGridWebSchedNewPatApptTimeSlotsThreaded();
            long       defaultStatus = PrefC.GetLong(PrefName.WebSchedNewPatConfirmStatus);
            List <Def> listDefs      = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true);

            for (int i = 0; i < listDefs.Count; i++)
            {
                int idx = comboWSNPConfirmStatuses.Items.Add(listDefs[i].ItemName);
                if (listDefs[i].DefNum == defaultStatus)
                {
                    comboWSNPConfirmStatuses.SelectedIndex = idx;
                }
            }
            comboWSNPConfirmStatuses.IndexSelectOrSetText(listDefs.ToList().FindIndex(x => x.DefNum == defaultStatus),
                                                          () => { return(defaultStatus == 0 ? "" : Defs.GetName(DefCat.ApptConfirmed, defaultStatus) + " (" + Lan.g(this, "hidden") + ")"); });
            checkNewPatAllowProvSelection.Checked = PrefC.GetBool(PrefName.WebSchedNewPatAllowProvSelection);
        }
Пример #5
0
        private void FormClaimCustomTrackingUpdate_Load(object sender, EventArgs e)
        {
            if (!PrefC.GetBool(PrefName.ClaimTrackingStatusExcludesNone))
            {
                //None is allowed as an option
                comboCustomTracking.Items.AddDefNone();
                comboCustomTracking.SelectedIndex = 0;
            }
            comboCustomTracking.Items.AddDefs(Defs.GetDefsForCategory(DefCat.ClaimCustomTracking, true));
            ClaimTracking claimTrack = ListNewClaimTracks.FirstOrDefault();

            if (claimTrack == null)          //Creating a new ClaimTracking
            {
                comboCustomTracking.SelectedIndex = 0;
            }
            else
            {
                comboCustomTracking.SetSelectedDefNum(claimTrack.TrackingDefNum);
                //An existing ClaimTracking could still have a TrackingDefNum of 0='None'.
                //Even if the new pref blocks "None" from showing.
                //In that case, the setter above, will show "None", but selectedIndex will be -1,
                //preventing user from saving down below.
            }
            textNotes.Text = claimTrack?.Note ?? "";
            FillComboErrorCode();
        }
Пример #6
0
 ///<summary>Opens the appropriate form to edit the program property.</summary>
 private void PropertyTypeDirector(ProgramProperty prop)
 {
     if (ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.ImageCategory)         //imageCategory
     {
         List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ImageCats, true);
         int        idxDef   = listDefs.FindIndex(x => x.DefNum == PIn.Long(prop.PropertyValue));
         InputBox   inputBox = new InputBox("Choose an Image Category", listDefs.Select(x => x.ItemName).ToList(), idxDef);
         inputBox.ShowDialog();
         if (inputBox.DialogResult != DialogResult.OK || inputBox.SelectedIndex == -1)
         {
             return;
         }
         prop.PropertyValue = POut.Long(listDefs[inputBox.SelectedIndex].DefNum);
         ProgramProperties.Update(prop);
     }
     else
     {
         bool propIsPassword        = ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.Password;
         FormProgramProperty FormPP = new FormProgramProperty(propIsPassword);
         FormPP.ProgramPropertyCur = prop;
         FormPP.ShowDialog();
         if (FormPP.DialogResult != DialogResult.OK)
         {
             return;
         }
     }
     ProgramProperties.RefreshCache();
     FillGrid();
 }
Пример #7
0
 private void FormAccountingAutoPayEdit_Load(object sender, EventArgs e)
 {
     if (AutoPayCur == null)
     {
         MessageBox.Show("Autopay cannot be null.");                //just for debugging
     }
     _listPaymentTypeDefs = Defs.GetDefsForCategory(DefCat.PaymentTypes, true);
     for (int i = 0; i < _listPaymentTypeDefs.Count; i++)
     {
         comboPayType.Items.Add(_listPaymentTypeDefs[i].ItemName);
         if (_listPaymentTypeDefs[i].DefNum == AutoPayCur.PayType)
         {
             comboPayType.SelectedIndex = i;
         }
     }
     if (AutoPayCur.PickList == null)
     {
         AutoPayCur.PickList = "";
     }
     string[] strArray = AutoPayCur.PickList.Split(new char[] { ',' });
     accountAL = new ArrayList();
     for (int i = 0; i < strArray.Length; i++)
     {
         if (strArray[i] == "")
         {
             continue;
         }
         accountAL.Add(PIn.Long(strArray[i]));
     }
     FillList();
 }
Пример #8
0
 private void FormSupplies_Load(object sender,EventArgs e)
 {
     this.Height=SystemInformation.WorkingArea.Height;//Resize height
     this.Location=new Point(Location.X,0);//Move window to compensate for changed height
     _listSuppliers=Suppliers.GetAll();
     comboSuppliers.Items.Clear();
     comboSuppliers.IncludeAll=true;
     comboSuppliers.IsAllSelected=true;
     comboSuppliers.Items.AddList(_listSuppliers,x=>x.Name);
     if(IsSelectMode){
         butAdd.Visible=false;
         labelSuppliers.Visible=false;
         comboSuppliers.Visible=false;
         //comboSupplier.SetSelectedKey<Supply>(SelectedSupplierNum,x=>x.SupplierNum,x=>Suppliers.GetName(_listSuppliers,x));
         //comboSupplier.Enabled=false;
         checkEnterQty.Visible=false;
         butUp.Visible=false;
         butDown.Visible=false;
         groupCreateOrders.Visible=false;
         labelCreateOrder.Visible=false;
         butPrint.Visible=false;
         labelPrint.Visible=false;
     }
     else{
         butOK.Visible=false;
         butCancel.Text="Close";
     }
     comboCategories.IncludeAll=true;
     comboCategories.Items.AddDefs(Defs.GetDefsForCategory(DefCat.SupplyCats,true));//not showing hidden categories
     comboCategories.IsAllSelected=true;
     FillGrid();
 }
Пример #9
0
        private void FormTaskSearch_Load(object sender, EventArgs e)
        {
            if (IsSelectionMode)
            {
                butClose.Text = "Cancel";
            }
            //Note: DateTime strings that are empty actually are " " due to how the empty datetime control behaves.
            _listTaskPriorities = Defs.GetDefsForCategory(DefCat.TaskPriorities);
            long userNum = 0;

            comboUsers.Items.Add(Lan.g(this, "All"));
            comboUsers.Items.Add(Lan.g(this, "Me"));
            comboUsers.SelectedIndex = 0;          //Always default to All.
            _listUsers = Userods.GetDeepCopy();    //List of all users for searching.  I figure we don't want to exclude hidden ones for searching.
            _listUsers.ForEach(x => comboUsers.Items.Add(x.UserName));
            comboPriority.Items.Add(Lan.g(this, "All"));
            for (int i = 0; i < _listTaskPriorities.Count; i++)
            {
                comboPriority.Items.Add(_listTaskPriorities[i].ItemName);
            }
            comboPriority.SelectedIndex = 0;
            checkLimit.Checked          = true;
            if (PrefC.HasReportServer)
            {
                checkReportServer.Checked = true;
            }
            else
            {
                checkReportServer.Visible = false;
            }
            _tableTasks = Tasks.GetDataSet(userNum, new List <long>(), 0, " ", " ", " ", " ", textDescription.Text, 0, 0, checkBoxIncludesTaskNotes.Checked,
                                           checkBoxIncludeCompleted.Checked, true, checkReportServer.Checked);
            FillGrid();
        }
Пример #10
0
        /// <summary>Chooses which type of form to open based on current program and selected property.</summary>
        private void gridMain_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e)
        {
            ProgramProperty programProperty = (ProgramProperty)gridMain.ListGridRows[e.Row].Tag;

            switch (ProgramCur.ProgName)
            {
            case nameof(ProgramName.XVWeb):
                switch (programProperty.PropertyDesc)
                {
                case XVWeb.ProgramProps.ImageCategory:
                    List <string> listDefNums   = Defs.GetDefsForCategory(DefCat.ImageCats, true).Select(x => POut.Long(x.DefNum)).ToList();
                    List <string> listItemNames = Defs.GetDefsForCategory(DefCat.ImageCats, true).Select(x => x.ItemName).ToList();
                    ShowComboBoxForProgramProperty(programProperty, listDefNums, listItemNames, Lans.g(this, "Choose an Image Category"));
                    return;

                case XVWeb.ProgramProps.ImageQuality:
                    List <string> listOptions = Enum.GetValues(typeof(XVWebImageQuality)).Cast <XVWebImageQuality>().Select(x => x.ToString()).ToList();
                    List <string> listDisplay = listOptions.Select(x => Lans.g(this, x)).ToList();
                    ShowComboBoxForProgramProperty(programProperty, listOptions, listDisplay, Lans.g(this, "Choose an Image Quality"));
                    return;
                }
                break;
            }
            ShowFormProgramProperty(programProperty);
        }
Пример #11
0
 private void FormRpFinanceCharge_Load(object sender, System.EventArgs e)
 {
     textDateFrom.Text    = PrefC.GetDate(PrefName.FinanceChargeLastRun).ToShortDateString();
     textDateTo.Text      = PrefC.GetDate(PrefName.FinanceChargeLastRun).ToShortDateString();
     _listProviders       = Providers.GetListReports();
     _listBillingTypeDefs = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
     foreach (Def billingType in _listBillingTypeDefs)
     {
         listBillingType.Items.Add(billingType.ItemName);
     }
     if (listBillingType.Items.Count > 0)
     {
         listBillingType.SelectedIndex = 0;
     }
     foreach (Provider prov in _listProviders)
     {
         listProv.Items.Add(prov.GetLongDesc());
     }
     if (listProv.Items.Count > 0)
     {
         listProv.SelectedIndex = 0;
     }
     checkAllProv.Checked    = true;
     checkAllBilling.Checked = true;
     listProv.Visible        = false;
     listBillingType.Visible = false;
 }
Пример #12
0
        private void FormScheduleBlockEdit_Load(object sender, System.EventArgs e)
        {
            listType.Items.Clear();
            //This list will be null if there isn't a passed in list.  We pass in lists if we want to show a special modified list.
            if (_listBlockoutCatDefs == null)
            {
                _listBlockoutCatDefs = Defs.GetDefsForCategory(DefCat.BlockoutTypes, true);
            }
            for (int i = 0; i < _listBlockoutCatDefs.Count; i++)
            {
                listType.Items.Add(_listBlockoutCatDefs[i].ItemName);
                if (_schedCur.BlockoutType == _listBlockoutCatDefs[i].DefNum)
                {
                    listType.SelectedIndex = i;
                }
            }
            if (listType.Items.Count == 0)
            {
                MsgBox.Show(this, "You must setup blockout types first in Setup-Definitions.");
                DialogResult = DialogResult.Cancel;
                return;
            }
            if (listType.SelectedIndex == -1)
            {
                listType.SelectedIndex = 0;
            }
            listOp.Items.Clear();
            //Filter clinics by the clinic passed in.
            List <Operatory> listOpsShort = Operatories.GetDeepCopy(true);

            _listOps = new List <Operatory>();
            for (int i = 0; i < listOpsShort.Count; i++)
            {
                if (!PrefC.GetBool(PrefName.EasyNoClinics) && _clinicNum != 0)               //Using clinics and a clinic filter was passed in.
                {
                    if (listOpsShort[i].ClinicNum != _clinicNum)
                    {
                        continue;
                    }
                }
                listOp.Items.Add(listOpsShort[i].OpName);
                _listOps.Add(listOpsShort[i]);
                if (_schedCur.Ops.Contains(listOpsShort[i].OperatoryNum))
                {
                    listOp.SetSelected(listOp.Items.Count - 1, true);                 //Select the item that was just added.
                }
            }
            DateTime time;

            for (int i = 0; i < 24; i++)
            {
                time = DateTime.Today + TimeSpan.FromHours(7) + TimeSpan.FromMinutes(30 * i);
                comboStart.Items.Add(time.ToShortTimeString());
                comboStop.Items.Add(time.ToShortTimeString());
            }
            comboStart.Text = _schedCur.StartTime.ToShortTimeString();
            comboStop.Text  = _schedCur.StopTime.ToShortTimeString();
            textNote.Text   = _schedCur.Note;
            comboStart.Select();
        }
Пример #13
0
		private void FillCount(List<Job> listJobs) {
			textConceptJobs.Text=listJobs.Count(x => x.PhaseCur==JobPhase.Concept).ToString();
			textWriteupJobs.Text=listJobs.Count(x => x.OwnerAction==JobAction.WriteConcept || x.OwnerAction==JobAction.WriteJob).ToString();
			textDevelopmentJobs.Text=listJobs.Count(x => x.PhaseCur==JobPhase.Development).ToString();
			textActiveAdvisorJobs.Text=listJobs.Count(x => x.OwnerAction==JobAction.Advise).ToString();
			textJobsOnHold.Text=listJobs.Count(x => x.Priority==Defs.GetDefsForCategory(DefCat.JobPriorities,true).FirstOrDefault(y => y.ItemValue.Contains("OnHold")).DefNum).ToString();
		}
Пример #14
0
        private void FormLetterMerges_Load(object sender, System.EventArgs e)
        {
            mergePath = PrefC.GetString(PrefName.LetterMergePath);
            FillCats();
            if (listCategories.Items.Count > 0)
            {
                listCategories.SelectedIndex = 0;
            }
            FillLetters();
            if (listLetters.Items.Count > 0)
            {
                listLetters.SelectedIndex = 0;
            }
            List <Def> listImageCatDefs = Defs.GetDefsForCategory(DefCat.ImageCats, true);

            comboImageCategory.Items.Clear();
            //Create None image category
            comboImageCategory.Items.Add(new ODBoxItem <Def>(Lan.g(this, "None"), new Def()
            {
                DefNum = 0
            }));
            foreach (Def imageCat in listImageCatDefs)
            {
                comboImageCategory.Items.Add(new ODBoxItem <Def>(imageCat.ItemName, imageCat));
            }
            SelectImageCat();
        }
        private void FillComboErrorCode()
        {
            Def[] arrayErrorCodeDefs = Defs.GetDefsForCategory(DefCat.ClaimErrorCode, true).ToArray();
            comboErrorCode.Items.Clear();
            //Add "none" option.
            comboErrorCode.Items.Add(new ODBoxItem <Def>(Lan.g(this, "None"), new Def()
            {
                ItemValue = "", DefNum = 0
            }));
            comboErrorCode.SelectedIndex = 0;
            if (arrayErrorCodeDefs.Length == 0)
            {
                //if the list is empty, then disable the comboBox.
                comboErrorCode.Enabled = false;
                return;
            }
            //Fill comboErrorCode.
            ClaimTracking claimTrack = ListNewClaimTracks.FirstOrDefault();

            for (int i = 0; i < arrayErrorCodeDefs.Length; i++)
            {
                //hooray for using new ODBoxItems!
                comboErrorCode.Items.Add(new ODBoxItem <Def>(arrayErrorCodeDefs[i].ItemName, arrayErrorCodeDefs[i]));
                if (claimTrack?.TrackingErrorDefNum == arrayErrorCodeDefs[i].DefNum)
                {
                    comboErrorCode.SelectedIndex = i + 1;                //adding 1 to the index because we have added a 'none' option above
                }
            }
        }
Пример #16
0
        public static long CreateTask(Patient pat, BugSubmission sub)
        {
            //Button is only enabled if _patCur is not null (user has 1 row selected).
            //Mimics FormOpenDental.OnTask_Click()
            FormTaskListSelect FormT = new FormTaskListSelect(TaskObjectType.Patient);

            //FormT.Location=new Point(50,50);
            FormT.Text = Lan.g(FormT, "Add Task") + " - " + FormT.Text;
            FormT.ShowDialog();
            if (FormT.DialogResult != DialogResult.OK)
            {
                return(0);
            }
            Task task = new Task();

            task.TaskListNum = -1;          //don't show it in any list yet.
            Tasks.Insert(task);
            Task taskOld = task.Copy();

            if (pat.PatNum != 0)
            {
                task.KeyNum     = pat.PatNum;
                task.ObjectType = TaskObjectType.Patient;
            }
            task.TaskListNum = FormT.ListSelectedLists[0];
            task.UserNum     = Security.CurUser.UserNum;
            //Mimics the ?bug quick note at HQ.
            task.Descript       = BugSubmissions.GetSubmissionDescription(pat, sub);
            task.PriorityDefNum = Defs.GetDefsForCategory(DefCat.TaskPriorities).FirstOrDefault(x => x.ItemName.ToLower().Contains("yellow"))?.DefNum ?? 0;
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            FormTE.ShowDialog();
            return(task.TaskNum);
        }
Пример #17
0
 private void FormAutoNoteCompose_Load(object sender, EventArgs e)
 {
     _listAutoNoteCatDefs = Defs.GetDefsForCategory(DefCat.AutoNoteCats, true);
     _listAutoNotePrompts = new List <AutoNoteListItem>();
     _userOdCurPref       = UserOdPrefs.GetByUserAndFkeyType(Security.CurUser.UserNum, UserOdFkeyType.AutoNoteExpandedCats).FirstOrDefault();
     FillListTree();
 }
Пример #18
0
 private void FormRpTpPreAllocation_Load(object sender, EventArgs e)
 {
     odDateRangePicker.SetDateTimeFrom(DateTime.Today.AddMonths(-1));
     odDateRangePicker.SetDateTimeTo(DateTime.Today);
     if (PrefC.HasClinicsEnabled)
     {
         labelClinic.Visible     = true;
         checkAllClinics.Visible = true;
         checkAllClinics.Checked = true;
         listBoxClinic.Visible   = true;
         listBoxClinic.SelectedIndices.Clear();
         _listClinics = Clinics.GetForUserod(Security.CurUser, (!Security.CurUser.ClinicIsRestricted), "Unassigned");
         foreach (Clinic clinic in _listClinics)
         {
             ODBoxItem <Clinic> boxClinic = new ODBoxItem <Clinic>(clinic.Abbr, clinic);
             listBoxClinic.Items.Add(boxClinic);
         }
     }
     else
     {
         _listClinics = new List <Clinic>();
     }
     _listProviders = Providers.GetListReports();
     _listProviders.Insert(0, Providers.GetUnearnedProv());
     checkAllProv.Checked = true;
     listBoxProv.SetItems(_listProviders, x => x.Abbr);
     _listUnearnedTypes            = Defs.GetDefsForCategory(DefCat.PaySplitUnearnedType).Where(x => !string.IsNullOrEmpty(x.ItemValue)).ToList();
     checkAllUnearnedTypes.Checked = true;
     listBoxUnearnedTypes.SetItems(_listUnearnedTypes, x => x.ItemName);
 }
Пример #19
0
 private void FillCategories()
 {
     ProcButtonQuicks.ValidateAll();
     listCategories.Items.Clear();
     listCategories.Items.Add("Quick Buttons");            //hardcoded category.
     _listProcButtonCatDefs = Defs.GetDefsForCategory(DefCat.ProcButtonCats, true);
     if (_listProcButtonCatDefs.Count == 0)
     {
         selectedCat = 0;
         listCategories.SelectedIndex = 0;
         return;
     }
     for (int i = 0; i < _listProcButtonCatDefs.Count; i++)
     {
         listCategories.Items.Add(_listProcButtonCatDefs[i].ItemName);
         if (selectedCat == _listProcButtonCatDefs[i].DefNum)
         {
             listCategories.SelectedIndex = i + 1;
         }
     }
     if (listCategories.SelectedIndex == -1)          //category was hidden, or just openning the form
     {
         listCategories.SelectedIndex = 0;
         selectedCat = 0;
     }
     if (listCategories.SelectedIndex > 0)           //hardcoded category doesn't have a DefNum.
     {
         selectedCat = _listProcButtonCatDefs[listCategories.SelectedIndex - 1].DefNum;
     }
 }
Пример #20
0
        ///<summary></summary>
        private void FormWebSchedAppts_Load(object sender, System.EventArgs e)
        {
            //Set the initial date
            datePicker.SetDateTimeFrom(DateTime.Today);
            datePicker.SetDateTimeTo(DateTime.Today.AddDays(7));
            //Add the appointment confirmation types
            comboBoxMultiConfStatus.Items.Clear();
            long defaultStatus = PrefC.GetLong(PrefName.WebSchedNewPatConfirmStatus);

            if (!checkWebSchedNewPat.Checked && checkWebSchedRecall.Checked)
            {
                defaultStatus = PrefC.GetLong(PrefName.WebSchedRecallConfirmStatus);
            }
            List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true);

            foreach (Def defCur in listDefs)
            {
                ODBoxItem <long> defItem = new ODBoxItem <long>(defCur.ItemName, defCur.DefNum);
                int idx = comboBoxMultiConfStatus.Items.Add(defItem);
                if ((checkWebSchedNewPat.Checked || checkWebSchedRecall.Checked) && defCur.DefNum == defaultStatus)
                {
                    comboBoxMultiConfStatus.SetSelected(idx, true);
                }
            }
            FillGrid();
        }
Пример #21
0
 private void FormSupplyEdit_Load(object sender, EventArgs e)
 {
     textSupplier.Text  = Suppliers.GetName(ListSupplier, Supp.SupplierNum);
     SuppOriginal       = Supp.Copy();
     _listSupplyCatDefs = Defs.GetDefsForCategory(DefCat.SupplyCats, true);
     for (int i = 0; i < _listSupplyCatDefs.Count; i++)
     {
         comboCategory.Items.Add(_listSupplyCatDefs[i].ItemName);
         if (Supp.Category == _listSupplyCatDefs[i].DefNum)
         {
             comboCategory.SelectedIndex = i;
         }
     }
     if (comboCategory.SelectedIndex == -1)
     {
         comboCategory.SelectedIndex = 0;              //There are no hidden cats, and presence of cats is checked before allowing user to add new.
     }
     categoryInitialVal     = Supp.Category;
     textCatalogNumber.Text = Supp.CatalogNumber;
     textDescript.Text      = Supp.Descript;
     if (Supp.LevelDesired != 0)
     {
         textLevelDesired.Text = Supp.LevelDesired.ToString();
     }
     if (Supp.LevelOnHand != 0)
     {
         textLevelOnHand.Text = Supp.LevelOnHand.ToString();
     }
     if (Supp.Price != 0)
     {
         textPrice.Text = Supp.Price.ToString("n");
     }
     checkIsHidden.Checked = Supp.IsHidden;
     isHiddenInitialVal    = Supp.IsHidden;
 }
Пример #22
0
        ///<summary>Fills the Global Task filter combobox with options.  Only visible if Clinics are enabled, or if previous selection no is longer
        ///available, example: Clinics have been turned off, Clinic filter no longer available.</summary>
        private void FillComboGlobalFilter()
        {
            GlobalTaskFilterType globalPref = (GlobalTaskFilterType)PrefC.GetInt(PrefName.TasksGlobalFilterType);

            comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.Disabled.GetDescription()), GlobalTaskFilterType.Disabled);
            comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.None.GetDescription()), GlobalTaskFilterType.None);
            if (PrefC.HasClinicsEnabled)
            {
                labelGlobalFilter.Visible = true;
                comboGlobalFilter.Visible = true;
                comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.Clinic.GetDescription()), GlobalTaskFilterType.Clinic);
                if (Defs.GetDefsForCategory(DefCat.Regions).Count > 0)
                {
                    comboGlobalFilter.Items.Add(Lan.g(this, GlobalTaskFilterType.Region.GetDescription()), GlobalTaskFilterType.Region);
                }
            }
            comboGlobalFilter.SetSelectedEnum(globalPref);
            if (comboGlobalFilter.SelectedIndex == -1)
            {
                labelGlobalFilter.Visible = true;
                comboGlobalFilter.Visible = true;
                errorProvider1.SetError(comboGlobalFilter, $"Previous selection \"{globalPref.GetDescription()}\" is no longer available.  "
                                        + "Saving will overwrite previous setting.");
                comboGlobalFilter.SelectedIndex = 0;
            }
        }
Пример #23
0
 private void FormReleaseCalculator_Load(object sender, EventArgs e)
 {
     textAvgJobHours.Text   = _avgJobHours.ToString();
     textEngJobPercent.Text = _jobTimePercent.ToString();
     textBreakHours.Text    = _avgBreakHours.ToString();
     foreach (Def def in Defs.GetDefsForCategory(DefCat.JobPriorities, true).OrderBy(x => x.ItemOrder).ToList())
     {
         listPriorities.Items.Add(new ODBoxItem <Def>(def.ItemName, def));
         if (def.DefNum.In(597, 601))
         {
             listPriorities.SelectedIndices.Add(listPriorities.Items.Count - 1);
         }
     }
     foreach (JobPhase phase in Enum.GetValues(typeof(JobPhase)))
     {
         listPhases.Items.Add(new ODBoxItem <JobPhase>(phase.ToString(), phase));
         if (phase.In(JobPhase.Definition, JobPhase.Development))
         {
             listPhases.SelectedIndices.Add(listPhases.Items.Count - 1);
         }
     }
     foreach (JobCategory category in Enum.GetValues(typeof(JobCategory)))
     {
         listCategories.Items.Add(new ODBoxItem <JobCategory>(category.ToString(), category));
         if (category.In(JobCategory.Enhancement, JobCategory.Feature, JobCategory.HqRequest, JobCategory.InternalRequest, JobCategory.ProgramBridge))
         {
             listCategories.SelectedIndices.Add(listCategories.Items.Count - 1);
         }
     }
     foreach (Employee emp in JobHelper.ListEngineerEmployees)
     {
         listEngineers.Items.Add(new ODBoxItem <Employee>(emp.FName, emp));
         listEngineers.SelectedIndices.Add(listEngineers.Items.Count - 1);
     }
 }
Пример #24
0
        public static bool HideDef(ODGrid gridDefs, DefCatOptions selectedDefCatOpt)
        {
            if (gridDefs.GetSelectedIndex() == -1)
            {
                MsgBox.Show(_lanThis, "Please select item first,");
                return(false);
            }
            Def selectedDef = (Def)gridDefs.Rows[gridDefs.GetSelectedIndex()].Tag;

            //Warn the user if they are about to hide a billing type currently in use.
            if (selectedDefCatOpt.DefCat == DefCat.BillingTypes && Patients.IsBillingTypeInUse(selectedDef.DefNum))
            {
                if (!MsgBox.Show(_lanThis, MsgBoxButtons.OKCancel, "Warning: Billing type is currently in use by patients, insurance plans, or preferences."))
                {
                    return(false);
                }
            }
            if (selectedDef.Category == DefCat.ProviderSpecialties &&
                (Providers.IsSpecialtyInUse(selectedDef.DefNum) ||
                 Referrals.IsSpecialtyInUse(selectedDef.DefNum)))
            {
                MsgBox.Show(_lanThis, "You cannot hide a specialty if it is in use by a provider or a referral source.");
                return(false);
            }
            if (Defs.IsDefinitionInUse(selectedDef))
            {
                if (selectedDef.DefNum == PrefC.GetLong(PrefName.BrokenAppointmentAdjustmentType) ||
                    selectedDef.DefNum == PrefC.GetLong(PrefName.AppointmentTimeArrivedTrigger) ||
                    selectedDef.DefNum == PrefC.GetLong(PrefName.AppointmentTimeSeatedTrigger) ||
                    selectedDef.DefNum == PrefC.GetLong(PrefName.AppointmentTimeDismissedTrigger) ||
                    selectedDef.DefNum == PrefC.GetLong(PrefName.TreatPlanDiscountAdjustmentType) ||
                    selectedDef.DefNum == PrefC.GetLong(PrefName.BillingChargeAdjustmentType) ||
                    selectedDef.DefNum == PrefC.GetLong(PrefName.PracticeDefaultBillType) ||
                    selectedDef.DefNum == PrefC.GetLong(PrefName.FinanceChargeAdjustmentType))
                {
                    MsgBox.Show(_lanThis, "You cannot hide a definition if it is in use within Module Preferences.");
                    return(false);
                }
                else
                {
                    if (!MsgBox.Show(_lanThis, MsgBoxButtons.OKCancel, "Warning: This definition is currently in use within the program."))
                    {
                        return(false);
                    }
                }
            }
            //Stop users from hiding the last definition in categories that must have at least one def in them.
            if (Defs.IsHidable(selectedDef.Category))
            {
                List <Def> listDefsCurNotHidden = Defs.GetDefsForCategory(selectedDefCatOpt.DefCat, true);
                if (listDefsCurNotHidden.Count == 1)
                {
                    MsgBox.Show(_lanThis, "You cannot hide the last definition in this category.");
                    return(false);
                }
            }
            Defs.HideDef(selectedDef);
            return(true);
        }
Пример #25
0
 private void FormProcCodeNew_Load(object sender, EventArgs e)
 {
     ProcedureCodes.RefreshCache();
     listType.Items.Add(Lan.g(this, "none"));
     listType.Items.Add(Lan.g(this, "Exam"));
     listType.Items.Add(Lan.g(this, "Xray"));
     listType.Items.Add(Lan.g(this, "Prophy"));
     listType.Items.Add(Lan.g(this, "Fluoride"));
     listType.Items.Add(Lan.g(this, "Sealant"));
     listType.Items.Add(Lan.g(this, "Amalgam"));
     listType.Items.Add(Lan.g(this, "Composite, Anterior"));
     listType.Items.Add(Lan.g(this, "Composite, Posterior"));
     listType.Items.Add(Lan.g(this, "Buildup/Post"));
     listType.Items.Add(Lan.g(this, "Pulpotomy"));
     listType.Items.Add(Lan.g(this, "RCT"));
     listType.Items.Add(Lan.g(this, "SRP"));
     listType.Items.Add(Lan.g(this, "Denture"));
     listType.Items.Add(Lan.g(this, "RPD"));
     listType.Items.Add(Lan.g(this, "Denture Repair"));
     listType.Items.Add(Lan.g(this, "Reline"));
     listType.Items.Add(Lan.g(this, "Ceramic Inlay"));
     listType.Items.Add(Lan.g(this, "Metallic Inlay"));
     listType.Items.Add(Lan.g(this, "Whitening"));
     listType.Items.Add(Lan.g(this, "All-Ceramic Crown"));
     listType.Items.Add(Lan.g(this, "PFM Crown"));
     listType.Items.Add(Lan.g(this, "Full Gold Crown"));
     listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - Ceramic"));
     listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - PFM"));
     listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - Metal"));
     listType.Items.Add(Lan.g(this, "Extraction"));
     listType.Items.Add(Lan.g(this, "Ortho"));
     listType.Items.Add(Lan.g(this, "Nitrous"));
     if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
     {
         labelListType.Visible  = false;
         listType.Visible       = false;
         labelTreatArea.Visible = false;
         comboTreatArea.Visible = false;
     }
     listType.SelectedIndex = 0;
     for (int i = 0; i < Enum.GetNames(typeof(ToothPaintingType)).Length; i++)
     {
         comboPaintType.Items.Add(Enum.GetNames(typeof(ToothPaintingType))[i]);
     }
     comboPaintType.SelectedIndex = (int)ToothPaintingType.None;
     for (int i = 1; i < Enum.GetNames(typeof(TreatmentArea)).Length; i++)
     {
         comboTreatArea.Items.Add(Lan.g(this, Enum.GetNames(typeof(TreatmentArea))[i]));
     }
     comboTreatArea.SelectedIndex = (int)TreatmentArea.Mouth - 1;
     _listProcCodeCatDefs         = Defs.GetDefsForCategory(DefCat.ProcCodeCats, true);
     for (int i = 0; i < _listProcCodeCatDefs.Count; i++)
     {
         comboCategory.Items.Add(_listProcCodeCatDefs[i].ItemName);
     }
     comboCategory.SelectedIndex = 0;
     textNewCode.Focus();
     textNewCode.Select(textNewCode.Text.Length, 1);
 }
 public override void OnProcessSignals(List <Signalod> listSignals)
 {
     if (!listSignals.Exists(x => x.IType == InvalidType.Defs))
     {
         return;                //no job signals;
     }
     _listJobPriorities = Defs.GetDefsForCategory(DefCat.JobPriorities);
 }
Пример #27
0
 private void FormDailyAdjustment_Load(object sender, System.EventArgs e)
 {
     date1.SelectionStart = DateTime.Today;
     date2.SelectionStart = DateTime.Today;
     _listProviders       = Providers.GetListReports();
     if (!Security.IsAuthorized(Permissions.ReportDailyAllProviders, true))
     {
         //They either have permission or have a provider at this point.  If they don't have permission they must have a provider.
         _listProviders       = _listProviders.FindAll(x => x.ProvNum == Security.CurUser.ProvNum);
         checkAllProv.Checked = false;
         checkAllProv.Enabled = false;
     }
     for (int i = 0; i < _listProviders.Count; i++)
     {
         listProv.Items.Add(_listProviders[i].GetLongDesc());
     }
     if (checkAllProv.Enabled == false && _listProviders.Count > 0)
     {
         listProv.SetSelected(0, true);
     }
     if (PrefC.GetBool(PrefName.EasyNoClinics))
     {
         listClin.Visible     = false;
         labelClin.Visible    = false;
         checkAllClin.Visible = false;
         _hasClinicsEnabled   = false;
     }
     else
     {
         _listClinics       = Clinics.GetForUserod(Security.CurUser);
         _hasClinicsEnabled = true;
         if (!Security.CurUser.ClinicIsRestricted)
         {
             listClin.Items.Add(Lan.g(this, "Unassigned"));
             listClin.SetSelected(0, true);
         }
         for (int i = 0; i < _listClinics.Count; i++)
         {
             int curIndex = listClin.Items.Add(_listClinics[i].Abbr);
             if (Clinics.ClinicNum == 0)
             {
                 listClin.SetSelected(curIndex, true);
                 checkAllClin.Checked = true;
             }
             if (_listClinics[i].ClinicNum == Clinics.ClinicNum)
             {
                 listClin.SelectedIndices.Clear();
                 listClin.SetSelected(curIndex, true);
             }
         }
     }
     _listAdjTypeDefs = Defs.GetDefsForCategory(DefCat.AdjTypes, true);
     for (int i = 0; i < _listAdjTypeDefs.Count; i++)
     {
         listType.Items.Add(_listAdjTypeDefs[i].ItemName);
         listType.SetSelected(i, true);
     }
 }
Пример #28
0
 private void FormClinics_Load(object sender, System.EventArgs e)
 {
     if (ListClinics == null)
     {
         ListClinics = Clinics.GetAllForUserod(Security.CurUser);
     }
     if (_listClinicDefLinksAll == null)
     {
         _listClinicDefLinksAll = DefLinks.GetDefLinksByType(DefLinkType.Clinic);
     }
     ListClinicsOld                 = ListClinics.Select(x => x.Copy()).ToList();
     _listClinicDefLinksAllOld      = _listClinicDefLinksAll.Select(x => x.Copy()).ToList();
     _listDefLinkClinicSpecialties  = GetDefLinkClinicList();
     _listClinicSpecialtyDefs       = Defs.GetDefsForCategory(DefCat.ClinicSpecialty);
     checkOrderAlphabetical.Checked = PrefC.GetBool(PrefName.ClinicListIsAlphabetical);
     _dictClinicalCounts            = Clinics.GetClinicalPatientCount();
     if (IsSelectionMode)
     {
         butAdd.Visible           = false;
         butOK.Visible            = true;
         groupClinicOrder.Visible = false;
         groupMovePats.Visible    = false;
         int widthDiff = (groupClinicOrder.Width - butOK.Width);
         this.MinimumSize        = new Size(this.MinimumSize.Width - widthDiff, this.MinimumSize.Height);
         this.Width             -= widthDiff;
         gridMain.Width         += widthDiff;
         checkShowHidden.Visible = false;
         checkShowHidden.Checked = false;
     }
     else
     {
         if (checkOrderAlphabetical.Checked)
         {
             butUp.Enabled   = false;
             butDown.Enabled = false;
         }
         else
         {
             butUp.Enabled   = true;
             butDown.Enabled = true;
         }
     }
     if (IsMultiSelect)
     {
         butSelectAll.Visible   = true;
         butSelectNone.Visible  = true;
         gridMain.SelectionMode = GridSelectionMode.MultiExtended;
     }
     FillGrid();
     for (int i = 0; i < gridMain.Rows.Count; i++)
     {
         if (ListSelectedClinicNums.Contains(((Clinic)gridMain.Rows[i].Tag).ClinicNum))
         {
             gridMain.SetSelected(i, true);
         }
     }
 }
Пример #29
0
 private void FillCats()
 {
     _listLetterMergeCatDefs = Defs.GetDefsForCategory(DefCat.LetterMergeCats, true);
     listCategories.Items.Clear();
     for (int i = 0; i < _listLetterMergeCatDefs.Count; i++)
     {
         listCategories.Items.Add(_listLetterMergeCatDefs[i].ItemName);
     }
 }
Пример #30
0
 private void FormApptQuickAdd_Load(object sender, EventArgs e)
 {
     _listApptProcsQuickAddDefs = Defs.GetDefsForCategory(DefCat.ApptProcsQuickAdd, true);
     for (int i = 0; i < _listApptProcsQuickAddDefs.Count; i++)
     {
         listQuickAdd.Items.Add(_listApptProcsQuickAddDefs[i].ItemName);
     }
     this.Location = new Point(this.ParentFormLocation.X + 75, this.ParentFormLocation.Y + 25);
 }