private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g(this, "Date"), 100);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Category"), 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Description"), 300);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            Docs = Documents.GetAllWithPat(PatNum);
            for (int i = 0; i < Docs.Length; i++)
            {
                row = new GridRow();
                row.Cells.Add(Docs[i].DateCreated.ToString());
                row.Cells.Add(Defs.GetName(DefCat.ImageCats, Docs[i].DocCategory));
                row.Cells.Add(Docs[i].Description);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Example #2
0
        public static GridRow CreateRowForPaySplit(DataRow rowBundlePayment, PaySplit paySplit, bool isDynamic = false)
        {
            string descript = Defs.GetName(DefCat.PaymentTypes, PIn.Long(rowBundlePayment["PayType"].ToString()));

            if (rowBundlePayment["CheckNum"].ToString() != "")
            {
                descript += " #" + rowBundlePayment["CheckNum"].ToString();
            }
            descript += " " + paySplit.SplitAmt.ToString("c");
            if (PIn.Double(rowBundlePayment["PayAmt"].ToString()) != paySplit.SplitAmt)
            {
                descript += Lans.g("PayPlanL", "(split)");
            }
            GridRow row = new GridRow();

            row.Cells.Add(paySplit.DatePay.ToShortDateString());                                //0 Date
            row.Cells.Add(Providers.GetAbbr(PIn.Long(rowBundlePayment["ProvNum"].ToString()))); //1 Prov Abbr
            row.Cells.Add(descript);                                                            //2 Descript
            row.Cells.Add("");                                                                  //3 Principal
            row.Cells.Add("");                                                                  //4 Interest
            row.Cells.Add("");                                                                  //5 Due
            row.Cells.Add(paySplit.SplitAmt.ToString("n"));                                     //6 Payment
            if (!isDynamic)
            {
                row.Cells.Add("");        //7 Adjustment - Does not exist for dynamic payment plans
            }
            row.Cells.Add("");            //8 Balance (filled later)
            row.Tag       = paySplit;
            row.ColorText = Defs.GetDefByExactName(DefCat.AccountColors, "Payment").ItemColor;
            return(row);
        }
Example #3
0
        private void FillGrid()
        {
            ODProgress.ShowAction(            //Show progress window while filling the grid.
                () => {
                gridMain.BeginUpdate();
                gridMain.ListGridColumns.Clear();
                GridColumn col = new GridColumn(Lan.g(this, "Patient"), 140);
                gridMain.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g(this, "Date"), 65);
                gridMain.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g(this, "Status"), 110);
                gridMain.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g(this, "Prov"), 50);
                gridMain.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g(this, "Procedures"), 150);
                gridMain.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g(this, "Notes"), 200);
                gridMain.ListGridColumns.Add(col);
                gridMain.ListGridRows.Clear();
                GridRow row;
                Dictionary <long, string> dictPatNames = Patients.GetLimForPats(_listPlannedAppts.Select(x => x.PatNum).ToList())
                                                         .ToDictionary(x => x.PatNum, x => x.GetNameLF());
                foreach (Appointment apt in _listPlannedAppts)
                {
                    row            = new GridRow();
                    string patName = Lan.g(this, "UNKNOWN");
                    dictPatNames.TryGetValue(apt.PatNum, out patName);
                    row.Cells.Add(patName);
                    if (apt.AptDateTime.Year < 1880)
                    {
                        row.Cells.Add("");
                    }
                    else
                    {
                        row.Cells.Add(apt.AptDateTime.ToShortDateString());
                    }
                    row.Cells.Add(Defs.GetName(DefCat.RecallUnschedStatus, apt.UnschedStatus));
                    if (apt.IsHygiene)
                    {
                        Provider provHyg = Providers.GetFirstOrDefault(x => x.ProvNum == apt.ProvHyg);
                        row.Cells.Add(provHyg == null?Lan.g(this, "INVALID"):provHyg.Abbr);
                    }
                    else
                    {
                        Provider prov = Providers.GetFirstOrDefault(x => x.ProvNum == apt.ProvNum);
                        row.Cells.Add(prov == null?Lan.g(this, "INVALID"):prov.Abbr);
                    }
                    row.Cells.Add(apt.ProcDescript);
                    row.Cells.Add(apt.Note);

                    gridMain.ListGridRows.Add(row);
                }
                gridMain.EndUpdate();
            },
                startingMessage: Lans.g(this, "Filling the Planned Appointments Grid..."),
                eventType: typeof(PlannedTrackerEvent),
                odEventType: ODEventType.PlannedTracker
                );
        }
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableInvoiceItems", "Date"), 70);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "PatName"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Prov"), 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Code"), 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Tooth"), 50);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Description"), 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableInvoiceItems", "Fee"), 60, HorizontalAlignment.Right);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;
            List <ProcedureCode> listProcCodes = ProcedureCodes.GetAllCodes();

            foreach (DataRow tableRow in _tableSuperFamAcct.Rows)
            {
                row = new GridRow();
                row.Cells.Add(PIn.DateT(tableRow["Date"].ToString()).ToShortDateString());
                row.Cells.Add(tableRow["PatName"].ToString());
                row.Cells.Add(Providers.GetAbbr(PIn.Long(tableRow["Prov"].ToString())));
                if (!string.IsNullOrWhiteSpace(tableRow["AdjType"].ToString()))                             //It's an adjustment
                {
                    row.Cells.Add(Lan.g(this, "Adjust"));                                                   //Adjustment
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(Defs.GetName(DefCat.AdjTypes, PIn.Long(tableRow["AdjType"].ToString()))); //Adjustment type
                }
                else if (!string.IsNullOrWhiteSpace(tableRow["ChargeType"].ToString()))                     //It's a payplan charge
                {
                    if (PrefC.GetInt(PrefName.PayPlansVersion) != (int)PayPlanVersions.AgeCreditsAndDebits)
                    {
                        continue;                        //They can only attach debits to invoices and they can only do so if they're on version 2.
                    }
                    row.Cells.Add(Lan.g(this, "Pay Plan"));
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(PIn.Enum <PayPlanChargeType>(PIn.Int(tableRow["ChargeType"].ToString())).GetDescription()); //Pay Plan charge type
                }
                else                                                                                                          //It's a procedure
                {
                    ProcedureCode procCode = ProcedureCodes.GetProcCode(PIn.Long(tableRow["Code"].ToString()), listProcCodes);
                    row.Cells.Add(procCode.ProcCode);
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(procCode.Descript);
                }
                row.Cells.Add(PIn.Double(tableRow["Amount"].ToString()).ToString("F"));
                row.Tag = tableRow;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Example #5
0
        private void FillGrid()
        {
            Automations.RefreshCache();
            _listAutomations = Automations.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Description", 200);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Trigger", 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Action", 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Details", 200);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            UI.GridRow row;
            string     detail;

            for (int i = 0; i < _listAutomations.Count; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(_listAutomations[i].Description);
                if (_listAutomations[i].Autotrigger == AutomationTrigger.CompleteProcedure)
                {
                    row.Cells.Add(_listAutomations[i].ProcCodes);
                }
                else
                {
                    row.Cells.Add(_listAutomations[i].Autotrigger.ToString());
                }
                row.Cells.Add(_listAutomations[i].AutoAction.ToString());
                //details:
                detail = "";
                if (_listAutomations[i].AutoAction == AutomationAction.CreateCommlog)
                {
                    detail += Defs.GetName(DefCat.CommLogTypes, _listAutomations[i].CommType)
                              + ".  " + _listAutomations[i].MessageContent;
                }
                else if (_listAutomations[i].AutoAction == AutomationAction.PrintPatientLetter)
                {
                    detail += SheetDefs.GetDescription(_listAutomations[i].SheetDefNum);
                }
                else if (_listAutomations[i].AutoAction == AutomationAction.PrintReferralLetter)
                {
                    detail += SheetDefs.GetDescription(_listAutomations[i].SheetDefNum);
                }
                else if (_listAutomations[i].AutoAction == AutomationAction.ChangePatStatus)
                {
                    detail += Lans.g("enum" + nameof(PatientStatus), _listAutomations[i].PatStatus.GetDescription());
                }
                row.Cells.Add(detail);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Example #6
0
        private void FillGrid()
        {
            Cursor = Cursors.WaitCursor;
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "Patient"), 140);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Date"), 65);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Status"), 110);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Prov"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Procedures"), 150);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Notes"), 200);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;
            Dictionary <long, string> dictPatNames = Patients.GetLimForPats(_listPlannedAppts.Select(x => x.PatNum).ToList())
                                                     .ToDictionary(x => x.PatNum, x => x.GetNameLF());

            foreach (Appointment apt in _listPlannedAppts)
            {
                row = new ODGridRow();
                string patName = Lan.g(this, "UNKNOWN");
                dictPatNames.TryGetValue(apt.PatNum, out patName);
                row.Cells.Add(patName);
                if (apt.AptDateTime.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(apt.AptDateTime.ToShortDateString());
                }
                row.Cells.Add(Defs.GetName(DefCat.RecallUnschedStatus, apt.UnschedStatus));
                if (apt.IsHygiene)
                {
                    Provider provHyg = Providers.GetFirstOrDefault(x => x.ProvNum == apt.ProvHyg);
                    row.Cells.Add(provHyg == null?Lan.g(this, "INVALID"):provHyg.Abbr);
                }
                else
                {
                    Provider prov = Providers.GetFirstOrDefault(x => x.ProvNum == apt.ProvNum);
                    row.Cells.Add(prov == null?Lan.g(this, "INVALID"):prov.Abbr);
                }
                row.Cells.Add(apt.ProcDescript);
                row.Cells.Add(apt.Note);

                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            Cursor = Cursors.Default;
        }
 private void FormSupplyOrderItemEdit_Load(object sender, EventArgs e)
 {
     Supp = Supplies.GetSupply(ItemCur.SupplyNum);
     textSupplier.Text      = Suppliers.GetName(ListSupplier, Supp.SupplierNum);
     textCategory.Text      = Defs.GetName(DefCat.SupplyCats, Supp.Category);
     textCatalogNumber.Text = Supp.CatalogNumber;
     textDescript.Text      = Supp.Descript;
     textQty.Text           = ItemCur.Qty.ToString();
     textPrice.Text         = ItemCur.Price.ToString("n");
 }
Example #8
0
        private void butChangePlanFrom_Click(object sender, EventArgs e)
        {
            FormDiscountPlans FormDPs = new FormDiscountPlans();

            FormDPs.IsSelectionMode = true;
            if (FormDPs.ShowDialog() == DialogResult.OK)
            {
                _planFrom = FormDPs.SelectedPlan;
                textDescriptionFrom.Text = _planFrom.Description;
                textFeeSchedFrom.Text    = FeeScheds.GetDescription(_planFrom.FeeSchedNum);
                textAdjTypeFrom.Text     = Defs.GetName(DefCat.AdjTypes, _planFrom.DefNum);
            }
            CheckUIState();
        }
        private void FillGrid(bool isShowAll)
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableUnallocatedPaysplits", "Date"), 70);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableUnallocatedPaysplits", "Patient Name"), 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableUnallocatedPaysplits", "Prov"), 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableUnallocatedPaysplits", "UnearnedType"), 150);
            gridMain.ListGridColumns.Add(col);
            if (isShowAll)
            {
                //Original because we don't know how much has been allocated
                col = new GridColumn(Lan.g("TableUnallocatedPaysplits", "Amt Original"), 60, HorizontalAlignment.Right);
            }
            else
            {
                col = new GridColumn(Lan.g("TableUnallocatedPaysplits", "Amt End"), 60, HorizontalAlignment.Right);
            }
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            foreach (PaySplit paySplit in _listPaySplits)
            {
                row = new GridRow();
                row.Cells.Add(paySplit.DatePay.ToShortDateString());
                row.Cells.Add(Patients.GetNameLF(paySplit.PatNum));
                row.Cells.Add(Providers.GetAbbr(paySplit.ProvNum));
                row.Cells.Add(Defs.GetName(DefCat.PaySplitUnearnedType, paySplit.UnearnedType));
                if (isShowAll || !_dictLeftOverAmounts.ContainsKey(paySplit.SplitNum))
                {
                    row.Cells.Add(paySplit.SplitAmt.ToString("F"));                    //show the original amount
                }
                else
                {
                    row.Cells.Add(_dictLeftOverAmounts[paySplit.SplitNum].ToString("F"));                    //show amount remaining
                }
                row.Tag = paySplit;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Example #10
0
        private void FillGrid()
        {
            _listAdjustmentsFiltered = _listAdjustments;
            if (checkUnattached.Checked)
            {
                _listAdjustmentsFiltered = _listAdjustments.FindAll(x => x.ProcNum == 0);
            }
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g(this, "Date"), 90);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "PatNum"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Type"), 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Amount"), 70);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Has Proc"), 0, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            foreach (Adjustment adjCur in _listAdjustmentsFiltered)
            {
                row = new GridRow();
                row.Cells.Add(adjCur.AdjDate.ToShortDateString());
                row.Cells.Add(adjCur.PatNum.ToString());
                row.Cells.Add(Defs.GetName(DefCat.AdjTypes, adjCur.AdjType));
                row.Cells.Add(adjCur.AdjAmt.ToString("F"));
                if (adjCur.ProcNum != 0)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Tag = adjCur;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
        private void FillGrid()
        {
            int curSelection = gridMain.GetSelectedIndex();

            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Attached"), 60, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Date"), 80, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Category"), 80, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Desc"), 180, HorizontalAlignment.Left));
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < _listPatientDocuments.Count; i++)
            {
                if (_listPatientDocuments[i].DocNum <= 0)                //Invalid doc num indicates 'Waiting for images'. This flag is set in the Load event.
                {
                    continue;
                }
                //Test if this is a valid image.
                Bitmap bmp = ImageStore.OpenImage(_listPatientDocuments[i], _patFolder);
                if (bmp == null)
                {
                    continue;
                }
                bmp.Dispose();
                bmp = null;
                bool isAttached = EhrLabImages.GetDocNumExistsInList(_ehrLabNum, _listPatientDocuments[i].DocNum, _listAttached);
                row = new GridRow();
                row.Cells.Add(isAttached?"X":"");
                row.Cells.Add(_listPatientDocuments[i].DateCreated.ToString());
                row.Cells.Add(Defs.GetName(DefCat.ImageCats, _listPatientDocuments[i].DocCategory));
                row.Cells.Add(_listPatientDocuments[i].Description);
                row.Tag = _listPatientDocuments[i];
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            if (curSelection >= 0)
            {
                gridMain.SetSelected(curSelection, true);
            }
        }
Example #12
0
        public static GridRow CreateRowForClaimProcs(DataRow rowBundleClaimProc, bool isDynamic = false)
        {
            //Either a claimpayment or a bundle of claimprocs with no claimpayment that were on the same date.
            string descript = Defs.GetName(DefCat.InsurancePaymentType, PIn.Long(rowBundleClaimProc["PayType"].ToString()));

            if (rowBundleClaimProc["CheckNum"].ToString() != "")
            {
                descript += " #" + rowBundleClaimProc["CheckNum"];
            }
            if (PIn.Long(rowBundleClaimProc["ClaimPaymentNum"].ToString()) == 0)
            {
                descript += "No Finalized Payment";
            }
            else
            {
                double checkAmt = PIn.Double(rowBundleClaimProc["CheckAmt"].ToString());
                descript += " " + checkAmt.ToString("c");
                double insPayAmt = PIn.Double(rowBundleClaimProc["InsPayAmt"].ToString());
                if (checkAmt != insPayAmt)
                {
                    descript += " " + Lans.g("PayPlanL", "(split)");
                }
            }
            GridRow row = new GridRow();

            row.Cells.Add(PIn.DateT(rowBundleClaimProc["DateCP"].ToString()).ToShortDateString()); //0 Date
            row.Cells.Add(Providers.GetLName(PIn.Long(rowBundleClaimProc["ProvNum"].ToString()))); //1 Prov Abbr
            row.Cells.Add(descript);                                                               //2 Descript
            row.Cells.Add("");                                                                     //3 Principal
            row.Cells.Add("");                                                                     //4 Interest
            row.Cells.Add("");                                                                     //5 Due
            row.Cells.Add(PIn.Double(rowBundleClaimProc["InsPayAmt"].ToString()).ToString("n"));   //6 Payment
            if (!isDynamic)
            {
                row.Cells.Add("");        //7 Adjustment
            }
            row.Cells.Add("");            //8 Balance (filled later)
            row.Tag       = rowBundleClaimProc;
            row.ColorText = Defs.GetDefByExactName(DefCat.AccountColors, "Insurance Payment").ItemColor;
            return(row);
        }
Example #13
0
 public static bool IsPrimary(Provider prov)
 {
     if (prov.IsSecondary)
     {
         return(false);
     }
     if (Defs.GetName(DefCat.ProviderSpecialties, prov.Specialty).ToLower() == "hygienist" ||
         Defs.GetName(DefCat.ProviderSpecialties, prov.Specialty).ToLower() == "assistant" ||
         Defs.GetName(DefCat.ProviderSpecialties, prov.Specialty).ToLower() == "labtech" ||
         Defs.GetName(DefCat.ProviderSpecialties, prov.Specialty).ToLower() == "other" ||
         Defs.GetName(DefCat.ProviderSpecialties, prov.Specialty).ToLower() == "notes" ||
         Defs.GetName(DefCat.ProviderSpecialties, prov.Specialty).ToLower() == "none"
         )
     {
         return(false);
     }
     if (prov.IsNotPerson)
     {
         return(false);
     }
     return(true);
 }
Example #14
0
        private void FormLetterMergeEdit_Load(object sender, System.EventArgs e)
        {
            textDescription.Text    = LetterMergeCur.Description;
            mergePath               = PrefC.GetString(PrefName.LetterMergePath);
            textPath.Text           = mergePath;
            textTemplateName.Text   = LetterMergeCur.TemplateName;
            textDataFileName.Text   = LetterMergeCur.DataFileName;
            _listLetterMergeCatDefs = Defs.GetDefsForCategory(DefCat.LetterMergeCats, true);
            for (int i = 0; i < _listLetterMergeCatDefs.Count; i++)
            {
                comboCategory.Items.Add(_listLetterMergeCatDefs[i].ItemName);
                if (LetterMergeCur.Category == _listLetterMergeCatDefs[i].DefNum)
                {
                    comboCategory.SelectedIndex = i;
                }
            }
            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
            }));
            comboImageCategory.SelectedIndex = 0;
            foreach (Def imageCat in listImageCatDefs)
            {
                comboImageCategory.Items.Add(new ODBoxItem <Def>(imageCat.ItemName, imageCat));
            }
            if (LetterMergeCur.ImageFolder != 0)
            {
                comboImageCategory.SetSelectedItem <Def>(x => x.DefNum == LetterMergeCur.ImageFolder
                                                         , Defs.GetName(DefCat.ImageCats, LetterMergeCur.ImageFolder) + " " + Lan.g(this, "(hidden)"));
            }
            FillPatSelect();
            FillListReferral();
            FillListOther();
        }
Example #15
0
 private void FillGrid(bool refresh=true)
 {
     List<long> listSupplierNums=null;
     if(IsSelectMode){
         listSupplierNums=new List<long>();
         listSupplierNums.Add(SelectedSupplierNum);
     }
     else if(comboSuppliers.IsAllSelected){
         listSupplierNums=null;
     }
     else{
         listSupplierNums=comboSuppliers.GetListSelected<Supplier>().Select(x=>x.SupplierNum).ToList();
     }
     List<long> listCategories=null;
     if(!comboCategories.IsAllSelected){
         listCategories=comboCategories.GetListSelected<Def>().Select(x=>x.DefNum).ToList();
     }
     if(refresh){
         _listSupplies=Supplies.GetList(listSupplierNums,checkShowHidden.Checked,textFind.Text,listCategories);
     }
     if(textFind.Text=="" && comboSuppliers.IsAllSelected){
         //check orders.  Simply look for any two sequential itemOrders that are the same.  This indicates fix required for that category.
         //Works for hidden or not, but won't fire repeatedly unless user is switching back and forth between hidden and unhidden.
         bool didFix=false;
         for(int i=1;i<_listSupplies.Count;i++){//starts at 1
             if(_listSupplies[i].Category != _listSupplies[i-1].Category){
                 //if previous item is different category, then we don't need to compare
                 continue;
             }
             if(_listSupplies[i].ItemOrder == _listSupplies[i-1].ItemOrder){//duplicate found
                 didFix=true;
                 FixItemOrders(_listSupplies[i].Category);
                 while(i<_listSupplies.Count
                     && _listSupplies[i].Category == _listSupplies[i-1].Category)
                 {
                     i++;//skip ahead to next category
                 }
             }
         }
         if(didFix){
             //get list again
             _listSupplies=Supplies.GetList(listSupplierNums,checkShowHidden.Checked,textFind.Text,listCategories);
         }
     }
     gridMain.BeginUpdate();
     gridMain.ListGridColumns.Clear();
     GridColumn col=new GridColumn(Lan.g(this,"Category"),130);
     gridMain.ListGridColumns.Add(col);
     col=new GridColumn(Lan.g(this,"Catalog #"),80);
     gridMain.ListGridColumns.Add(col);
     col=new GridColumn(Lan.g(this,"Supplier"),100);
     gridMain.ListGridColumns.Add(col);
     col=new GridColumn(Lan.g(this,"Description"),200);
     gridMain.ListGridColumns.Add(col);
     col=new GridColumn(Lan.g(this,"Price"),60,HorizontalAlignment.Right);
     gridMain.ListGridColumns.Add(col);
     col=new GridColumn(Lan.g(this,"Stock"),50,HorizontalAlignment.Center);
     gridMain.ListGridColumns.Add(col);
     col=new GridColumn(Lan.g(this,"Order"),50,HorizontalAlignment.Center);
     if(checkEnterQty.Checked){
         col.IsEditable=true;
     }
     gridMain.ListGridColumns.Add(col);
     col=new GridColumn(Lan.g(this,"Hidden"),50,HorizontalAlignment.Center);
     gridMain.ListGridColumns.Add(col);
     gridMain.ListGridRows.Clear();
     GridRow row;
     for(int i=0;i<_listSupplies.Count;i++) {
         row=new GridRow();
         if(gridMain.ListGridRows.Count==0 || _listSupplies[i].Category != _listSupplies[i-1].Category) {
             row.Cells.Add(Defs.GetName(DefCat.SupplyCats,_listSupplies[i].Category));//Add the new category header in this row if it doesn't match the previous row's category.
         }
         else {
             row.Cells.Add("");
         }
         row.Cells.Add(_listSupplies[i].CatalogNumber);
         row.Cells.Add(Suppliers.GetName(_listSuppliers,_listSupplies[i].SupplierNum));
         row.Cells.Add(_listSupplies[i].Descript);//_listSupplies[i].ItemOrder.ToString()+"  "+_listSupplies[i].Descript);
         if(_listSupplies[i].Price==0) {
             row.Cells.Add("");
         }
         else {
             row.Cells.Add(_listSupplies[i].Price.ToString("n"));
         }
         //stock:
         if(_listSupplies[i].LevelDesired==0) {
             row.Cells.Add("");
         }
         else {
             row.Cells.Add(_listSupplies[i].LevelDesired.ToString());
         }
         //order:
         if(_listSupplies[i].OrderQty==0) {
             row.Cells.Add("");
         }
         else {
             row.Cells.Add(_listSupplies[i].OrderQty.ToString());
         }
         //hidden:
         row.Cells.Add(_listSupplies[i].IsHidden?"X":"");
         //row.Tag=_listSupplies[i];
         gridMain.ListGridRows.Add(row);
     }
     gridMain.EndUpdate();
     //for(int i=0;i<gridMain.ListGridRows.Count;i++) {
     //	if(_listSelectedSupplies.Contains(((Supply)gridMain.ListGridRows[i].Tag))) {
     //		gridMain.SetSelected(i,true);
     //	}
     //}
 }
Example #16
0
        private void SelectImageCat()
        {
            long defNumLetter = 0;

            if (listLetters.Items.Count > 0 && listLetters.SelectedIndex >= 0)
            {
                LetterMerge letterMergeSelected = ListForCat[listLetters.SelectedIndex];
                if (letterMergeSelected != null)
                {
                    defNumLetter = letterMergeSelected.ImageFolder;
                }
            }
            if (defNumLetter != 0)
            {
                comboImageCategory.SetSelectedItem <Def>(x => x.DefNum == defNumLetter, Defs.GetName(DefCat.ImageCats, defNumLetter) + " " + Lan.g(this, "(hidden)"));
            }
            else
            {
                comboImageCategory.SelectedIndex = 0;
            }
        }
Example #17
0
        private void FillTable()
        {
            Referrals.RefreshCache();
            listRef = Referrals.GetDeepCopy();
            if (!checkHidden.Checked)
            {
                listRef.RemoveAll(x => x.IsHidden);
            }
            if (!checkShowPat.Checked)
            {
                listRef.RemoveAll(x => x.PatNum > 0);
            }
            if (!checkShowDoctor.Checked)
            {
                listRef.RemoveAll(x => x.IsDoctor);
            }
            if (!checkShowOther.Checked)
            {
                listRef.RemoveAll(x => x.PatNum == 0 && !x.IsDoctor);
            }
            if (checkPreferred.Checked)
            {
                listRef.RemoveAll(x => !x.IsPreferred);
            }
            if (!string.IsNullOrWhiteSpace(textSearch.Text))
            {
                string[] searchTokens = textSearch.Text.ToLower().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                listRef.RemoveAll(x => searchTokens.Any(y => !x.FName.ToLower().Contains(y) && !x.LName.ToLower().Contains(y)));
            }
            int  scrollValue    = gridMain.ScrollValue;
            long selectedRefNum = -1;

            if (gridMain.GetSelectedIndex() > -1)
            {
                selectedRefNum = ((Referral)gridMain.Rows[gridMain.GetSelectedIndex()].Tag).ReferralNum;
            }
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "LastName"), 150));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "FirstName"), 80));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "MI"), 30));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Title"), 70));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Specialty"), 60));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Patient"), 45));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableSelectRefferal", "Note"), 250));
            gridMain.Rows.Clear();
            ODGridRow row;
            int       indexSelectedRef = -1;

            foreach (Referral refCur in listRef)
            {
                row = new ODGridRow();
                row.Cells.Add(refCur.LName);
                row.Cells.Add(refCur.FName);
                row.Cells.Add(refCur.MName.Left(1).ToUpper());                //Left(1) will return empty string if MName is null or empty string, so ToUpper is null safe
                row.Cells.Add(refCur.Title);
                row.Cells.Add(refCur.IsDoctor?Lan.g("enumDentalSpecialty", Defs.GetName(DefCat.ProviderSpecialties, refCur.Specialty)):"");
                row.Cells.Add(refCur.PatNum > 0?"X":"");
                row.Cells.Add(refCur.Note);
                if (refCur.IsHidden)
                {
                    row.ColorText = Color.Gray;
                }
                row.Tag = refCur;
                gridMain.Rows.Add(row);
                if (refCur.ReferralNum == selectedRefNum)
                {
                    indexSelectedRef = gridMain.Rows.Count - 1;
                }
            }
            gridMain.EndUpdate();
            if (indexSelectedRef > -1)
            {
                gridMain.SetSelected(indexSelectedRef, true);
            }
            gridMain.ScrollValue  = scrollValue;
            labelResultCount.Text = gridMain.Rows.Count.ToString() + Lan.g(this, " results found");
        }
Example #18
0
        private void FillGrid()
        {
            this.Cursor = Cursors.WaitCursor;
            string order = "";

            switch (comboOrder.SelectedIndex)
            {
            case 0:
                order = "status";
                break;

            case 1:
                order = "alph";
                break;

            case 2:
                order = "date";
                break;
            }
            long provNum = 0;

            if (comboProv.SelectedIndex != 0)
            {
                provNum = _listProviders[comboProv.SelectedIndex - 1].ProvNum;
            }
            long siteNum = 0;

            if (!PrefC.GetBool(PrefName.EasyHidePublicHealth) && comboSite.SelectedIndex != 0)
            {
                siteNum = _listSites[comboSite.SelectedIndex - 1].SiteNum;
            }
            long clinicNum = 0;

            //if clinics are not enabled, comboClinic.SelectedIndex will be -1, so clinicNum will be 0 and list will not be filtered by clinic
            if (Security.CurUser.ClinicIsRestricted && comboClinic.SelectedIndex > -1)
            {
                clinicNum = _listUserClinics[comboClinic.SelectedIndex].ClinicNum;
            }
            else if (comboClinic.SelectedIndex > 0)                                    //if user is not restricted, clinicNum will be 0 and the query will get all clinic data
            {
                clinicNum = _listUserClinics[comboClinic.SelectedIndex - 1].ClinicNum; //if user is not restricted, comboClinic will contain "All" so minus 1
            }
            bool showBrokenAppts;

            showBrokenAppts = checkBrokenAppts.Checked;
            string codeStart = "";
            string codeEnd   = "";

            if (textCodeRange.Text.Trim() != "")
            {
                if (textCodeRange.Text.Contains("-"))
                {
                    string[] codeSplit = textCodeRange.Text.Split('-');
                    codeStart = codeSplit[0].Trim().Replace('d', 'D');
                    codeEnd   = codeSplit[1].Trim().Replace('d', 'D');
                }
                else
                {
                    codeStart = textCodeRange.Text.Trim().Replace('d', 'D');
                    codeEnd   = textCodeRange.Text.Trim().Replace('d', 'D');
                }
            }
            _listUnschedApt = Appointments.RefreshUnsched(order, provNum, siteNum, showBrokenAppts, clinicNum, codeStart, codeEnd, dateRangePicker.GetDateTimeFrom(), dateRangePicker.GetDateTimeTo());
            int scrollVal = grid.ScrollValue;

            grid.BeginUpdate();
            grid.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableUnsched", "Patient"), 140);

            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Date"), 65);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "AptStatus"), 90);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "UnschedStatus"), 110);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Prov"), 50);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Procedures"), 150);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Notes"), 200);
            grid.Columns.Add(col);
            grid.Rows.Clear();
            ODGridRow row;
            Dictionary <long, string> dictPatNames = Patients.GetPatientNames(_listUnschedApt.Select(x => x.PatNum).ToList());

            foreach (Appointment apt in _listUnschedApt)
            {
                row = new ODGridRow();
                string patName = Lan.g(this, "UNKNOWN");
                dictPatNames.TryGetValue(apt.PatNum, out patName);
                row.Cells.Add(patName);
                if (apt.AptDateTime.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(apt.AptDateTime.ToShortDateString());
                }
                if (apt.AptStatus == ApptStatus.Broken)
                {
                    row.Cells.Add(Lan.g(this, "Broken"));
                }
                else
                {
                    row.Cells.Add(Lan.g(this, "Unscheduled"));
                }
                row.Cells.Add(Defs.GetName(DefCat.RecallUnschedStatus, apt.UnschedStatus));
                row.Cells.Add(Providers.GetAbbr(apt.ProvNum));
                row.Cells.Add(apt.ProcDescript);
                row.Cells.Add(apt.Note);
                grid.Rows.Add(row);
            }
            grid.EndUpdate();
            grid.ScrollValue = scrollVal;
            Cursor           = Cursors.Default;
        }
Example #19
0
        private void FillTabECR()
        {
            FillECRActivationButtons();
            checkEnableNoClinic.Checked = PrefC.GetBool(PrefName.ApptConfirmEnableForClinicZero);
            if (PrefC.HasClinicsEnabled)             //CLINICS
            {
                checkUseDefaultsEC.Visible    = true;
                checkUseDefaultsEC.Enabled    = false;           //when loading form we will be viewing defaults.
                checkIsConfirmEnabled.Visible = true;
                groupAutomationStatuses.Text  = Lan.g(this, "eConfirmation Settings") + " - " + Lan.g(this, "Affects all Clinics");
            }
            else              //NO CLINICS
            {
                checkUseDefaultsEC.Visible    = false;
                checkUseDefaultsEC.Enabled    = false;
                checkUseDefaultsEC.Checked    = false;
                checkIsConfirmEnabled.Visible = false;
                checkEnableNoClinic.Visible   = false;
                groupAutomationStatuses.Text  = Lan.g(this, "eConfirmation Settings");
            }
            setListClinicsAndDictRulesHelper();
            comboClinicEConfirm.SelectedIndex = 0;
            _listDefsApptStatus = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true);
            comboStatusESent.Items.Clear();
            comboStatusEAccepted.Items.Clear();
            comboStatusEDeclined.Items.Clear();
            comboStatusEFailed.Items.Clear();
            _listDefsApptStatus.ForEach(x => comboStatusESent.Items.Add(x.ItemName));
            _listDefsApptStatus.ForEach(x => comboStatusEAccepted.Items.Add(x.ItemName));
            _listDefsApptStatus.ForEach(x => comboStatusEDeclined.Items.Add(x.ItemName));
            _listDefsApptStatus.ForEach(x => comboStatusEFailed.Items.Add(x.ItemName));
            long prefApptEConfirmStatusSent       = PrefC.GetLong(PrefName.ApptEConfirmStatusSent);
            long prefApptEConfirmStatusAccepted   = PrefC.GetLong(PrefName.ApptEConfirmStatusAccepted);
            long prefApptEConfirmStatusDeclined   = PrefC.GetLong(PrefName.ApptEConfirmStatusDeclined);
            long prefApptEConfirmStatusSendFailed = PrefC.GetLong(PrefName.ApptEConfirmStatusSendFailed);

            //SENT
            if (prefApptEConfirmStatusSent > 0)
            {
                //Selects combo box option if it exists, if it doesn't it sets the text of the combo box to the hidden one.
                comboStatusESent.IndexSelectOrSetText(_listDefsApptStatus.FindIndex(x => x.DefNum == prefApptEConfirmStatusSent), () => {
                    return(Defs.GetName(DefCat.ApptConfirmed, prefApptEConfirmStatusSent) + " (hidden)");
                });
            }
            else
            {
                comboStatusESent.SelectedIndex = 0;
            }
            //CONFIRMED
            if (prefApptEConfirmStatusAccepted > 0)
            {
                //Selects combo box option if it exists, if it doesn't it sets the text of the combo box to the hidden one.
                comboStatusEAccepted.IndexSelectOrSetText(_listDefsApptStatus.FindIndex(x => x.DefNum == prefApptEConfirmStatusAccepted), () => {
                    return(Defs.GetName(DefCat.ApptConfirmed, prefApptEConfirmStatusAccepted) + " (hidden)");
                });
            }
            else
            {
                comboStatusEAccepted.SelectedIndex = 0;
            }
            //NOT CONFIRMED
            if (prefApptEConfirmStatusDeclined > 0)
            {
                //Selects combo box option if it exists, if it doesn't it sets the text of the combo box to the hidden one.
                comboStatusEDeclined.IndexSelectOrSetText(_listDefsApptStatus.FindIndex(x => x.DefNum == prefApptEConfirmStatusDeclined), () => {
                    return(Defs.GetName(DefCat.ApptConfirmed, prefApptEConfirmStatusDeclined) + " (hidden)");
                });
            }
            else
            {
                comboStatusEDeclined.SelectedIndex = 0;
            }
            //Failed
            if (prefApptEConfirmStatusSendFailed > 0)
            {
                //Selects combo box option if it exists, if it doesn't it sets the text of the combo box to the hidden one.
                comboStatusEFailed.IndexSelectOrSetText(_listDefsApptStatus.FindIndex(x => x.DefNum == prefApptEConfirmStatusSendFailed), () => {
                    return(Defs.GetName(DefCat.ApptConfirmed, prefApptEConfirmStatusSendFailed) + " (hidden)");
                });
            }
            else
            {
                comboStatusEFailed.SelectedIndex = 0;
            }
            if (PrefC.GetBool(PrefName.ApptEConfirm2ClickConfirmation))
            {
                radio2ClickConfirm.Checked = true;
            }
            else
            {
                radio1ClickConfirm.Checked = true;
            }
            FillConfStatusesGrid();
            FillRemindConfirmData();
        }
        private List <GridRow> CreateChargeRows(List <AccountEntry> listEntries, List <int> listExpandedRows)
        {
            List <GridRow> listRows = new List <GridRow>();
            //Parent row
            GridRow row = new GridRow();

            //A placeholder accountEntry.  The Tag being null tells us it's a parent row.
            row.Tag = new AccountEntry()
            {
                ProvNum = listEntries[0].ProvNum, PatNum = listEntries[0].PatNum, ClinicNum = listEntries[0].ClinicNum
            };
            row.Cells.Add(Providers.GetAbbr(listEntries[0].ProvNum));            //Provider
            Patient pat;

            if (!_dictPatients.TryGetValue(listEntries[0].PatNum, out pat))
            {
                pat = Patients.GetLim(listEntries[0].PatNum);
                _dictPatients[pat.PatNum] = pat;
            }
            row.Cells.Add(pat.LName + ", " + pat.FName);        //Patient
            if (PrefC.HasClinicsEnabled)
            {
                row.Cells.Add(Clinics.GetAbbr(listEntries[0].ClinicNum));
            }
            string procCodes  = "";
            int    addedCodes = 0;

            for (int i = 0; i < listEntries.Count; i++)
            {
                if (Math.Round(listEntries[i].AmountStart, 3) == 0)
                {
                    continue;
                }
                if (listEntries[i].GetType() == typeof(Procedure))
                {
                    if (procCodes != "")
                    {
                        procCodes += ", ";
                    }
                    procCodes += ProcedureCodes.GetStringProcCode(((Procedure)listEntries[i].Tag).CodeNum);
                    addedCodes++;
                }
                else if (listEntries[i].GetType() == typeof(PaySplit) && ((PaySplit)listEntries[i].Tag).ProcNum != 0)
                {
                    if (procCodes != "")
                    {
                        procCodes += ", ";
                    }
                    //Look for the procedure in AccountEntries (it should be there) - We don't want to go to the DB
                    AccountEntry entry = _results.ListAccountCharges.Find(x => x.GetType() == typeof(Procedure) && x.PriKey == ((PaySplit)listEntries[i].Tag).ProcNum);
                    if (entry != null)                   //Can be null if paysplit is on a procedure that's outside the family.
                    {
                        procCodes += ProcedureCodes.GetStringProcCode(((Procedure)entry.Tag).CodeNum);
                        addedCodes++;
                    }
                }
                else if (listEntries[i].GetType() == typeof(Adjustment) && ((Adjustment)listEntries[i].Tag).ProcNum != 0)
                {
                    if (procCodes != "")
                    {
                        procCodes += ", ";
                    }
                    //Look for the procedure in AccountEntries (it should be there) - We don't want to go to the DB
                    AccountEntry entry = _results.ListAccountCharges.Find(x => x.GetType() == typeof(Procedure) && x.PriKey == ((Adjustment)listEntries[i].Tag).ProcNum);
                    if (entry != null)                   //Can be null if paysplit is on a procedure that's outside the family.
                    {
                        procCodes += ProcedureCodes.GetStringProcCode(((Procedure)entry.Tag).CodeNum);
                        addedCodes++;
                    }
                }
                if (addedCodes == 9)               //1 less than above, this column is shorter when filtering by prov + clinic
                {
                    procCodes += ", (...)";
                    break;
                }
            }
            row.Cells.Add(procCodes);
            //parent row should be sum of all child rows, and we skip entries that have an amount start of 0 for children so skip for parent as well.
            List <AccountEntry> listEntriesWithAmountStart = listEntries.FindAll(x => !x.AmountStart.IsEqual(0));

            row.Cells.Add(listEntriesWithAmountStart.Sum(x => x.AmountOriginal).ToString("f"));       //Amount Original
            row.Cells.Add(listEntriesWithAmountStart.Sum(x => x.AmountStart).ToString("f"));          //Amount Start
            row.Cells.Add(listEntriesWithAmountStart.Sum(x => x.AmountEnd).ToString("f"));            //Amount End
            row.Bold = true;
            listRows.Add(row);
            if (listExpandedRows.Contains(listRows.Count - 1))
            {
                row.DropDownInitiallyDown = true;              //If the expanded rows contains the one we just added, expand it
            }
            //Child rows
            foreach (AccountEntry entryCharge in listEntries)
            {
                if (Math.Round(entryCharge.AmountStart, 3) == 0)
                {
                    continue;
                }
                GridRow childRow = new GridRow();
                childRow.Tag = entryCharge;
                childRow.Cells.Add("     " + Providers.GetAbbr(entryCharge.ProvNum)); //Provider
                childRow.Cells.Add(pat.LName + ", " + pat.FName);                     //Patient
                if (PrefC.HasClinicsEnabled)
                {
                    childRow.Cells.Add(Clinics.GetAbbr(entryCharge.ClinicNum));
                }
                procCodes = "";
                if (entryCharge.GetType() == typeof(Procedure))
                {
                    procCodes = ((Procedure)entryCharge.Tag).ProcDate.ToShortDateString() + " " + ProcedureCodes.GetStringProcCode(((Procedure)entryCharge.Tag).CodeNum);
                }
                else if (entryCharge.GetType() == typeof(PayPlanCharge))
                {
                    procCodes = "PayPlanCharge";
                }
                else if (entryCharge.GetType() == typeof(PaySplit) && ((PaySplit)entryCharge.Tag).UnearnedType != 0)
                {
                    PaySplit split = (PaySplit)entryCharge.Tag;
                    if (split.ProvNum == 0)
                    {
                        procCodes = entryCharge.Date.ToShortDateString() + " Unallocated";
                    }
                    else
                    {
                        procCodes = entryCharge.Date.ToShortDateString() + " " + Defs.GetName(DefCat.PaySplitUnearnedType, split.UnearnedType);
                    }
                }
                else if (entryCharge.GetType() == typeof(PaySplit) && ((PaySplit)entryCharge.Tag).ProcNum != 0)
                {
                    AccountEntry entry = _results.ListAccountCharges.Find(x => x.GetType() == typeof(Procedure) && x.PriKey == ((PaySplit)entryCharge.Tag).ProcNum);
                    if (entry != null)                   //Entry can be null if there is a split for X patient and the attached procedure is for Y patient outside family.  Possible with old data.
                    {
                        procCodes = entryCharge.Date.ToShortDateString() + " PaySplit: " + ProcedureCodes.GetStringProcCode(((Procedure)entry.Tag).CodeNum);
                    }
                }
                else if (entryCharge.GetType() == typeof(Adjustment) && ((Adjustment)entryCharge.Tag).ProcNum != 0)
                {
                    AccountEntry entry = _results.ListAccountCharges.Find(x => x.GetType() == typeof(Procedure) && x.PriKey == ((Adjustment)entryCharge.Tag).ProcNum);
                    if (entry != null)                   //Entry can be null if there is a split for X patient and the attached procedure is for Y patient outside family.  Possible with old data.
                    {
                        procCodes = entryCharge.Date.ToShortDateString() + " Adjustment: " + ProcedureCodes.GetStringProcCode(((Procedure)entry.Tag).CodeNum);
                    }
                }
                else if (entryCharge.GetType() == typeof(PaySplit) && ((PaySplit)entryCharge.Tag).PayPlanNum != 0)             //Don't need this really
                {
                    procCodes = entryCharge.Date.ToShortDateString() + " PayPlan Split";
                }
                else if (entryCharge.GetType() == typeof(Adjustment))
                {
                    procCodes = entryCharge.Date.ToShortDateString() + " Adjustment";
                }
                else if (entryCharge.GetType() == typeof(ClaimProc))
                {
                    procCodes = entryCharge.Date.ToShortDateString() + " Claim Payment";
                }
                else
                {
                    procCodes = entryCharge.Date.ToShortDateString() + " " + entryCharge.GetType().Name;
                }
                childRow.Cells.Add(procCodes);                                //ProcCodes
                childRow.Cells.Add(entryCharge.AmountOriginal.ToString("f")); //Amount Original
                childRow.Cells.Add(entryCharge.AmountStart.ToString("f"));    //Amount Start
                childRow.Cells.Add(entryCharge.AmountEnd.ToString("f"));      //Amount End
                childRow.DropDownParent = row;
                listRows.Add(childRow);
            }
            return(listRows);
        }
        private void FillTabWebSchedRecall()
        {
            switch (PrefC.GetInt(PrefName.WebSchedAutomaticSendSetting))
            {
            case (int)WebSchedAutomaticSend.DoNotSend:
                radioDoNotSend.Checked = true;
                break;

            case (int)WebSchedAutomaticSend.SendToEmail:
                radioSendToEmail.Checked = true;
                break;

            case (int)WebSchedAutomaticSend.SendToEmailNoPreferred:
                radioSendToEmailNoPreferred.Checked = true;
                break;

            case (int)WebSchedAutomaticSend.SendToEmailOnlyPreferred:
                radioSendToEmailOnlyPreferred.Checked = true;
                break;
            }
            switch (PrefC.GetInt(PrefName.WebSchedAutomaticSendTextSetting))
            {
            case (int)WebSchedAutomaticSend.DoNotSend:
                radioDoNotSendText.Checked = true;
                break;

            case (int)WebSchedAutomaticSend.SendToText:
                radioSendText.Checked = true;
                break;
            }
            textWebSchedPerBatch.Text  = PrefC.GetString(PrefName.WebSchedTextsPerBatch);
            textWebSchedDateStart.Text = DateTime.Today.ToShortDateString();
            comboWebSchedClinic.Items.Clear();
            comboWebSchedClinic.Items.Add(Lan.g(this, "Unassigned"));
            _listWebSchedClinics = Clinics.GetDeepCopy();
            for (int i = 0; i < _listWebSchedClinics.Count; i++)
            {
                comboWebSchedClinic.Items.Add(_listWebSchedClinics[i].Abbr);
            }
            comboWebSchedClinic.SelectedIndex = 0;
            _listWebSchedProviders            = Providers.GetDeepCopy(true);
            comboWebSchedProviders.Items.Clear();
            comboWebSchedProviders.Items.Add(Lan.g(this, "All"));
            for (int i = 0; i < _listWebSchedProviders.Count; i++)
            {
                comboWebSchedProviders.Items.Add(_listWebSchedProviders[i].GetLongDesc());
            }
            comboWebSchedProviders.SelectedIndex = 0;
            if (PrefC.GetBool(PrefName.EasyNoClinics))
            {
                labelWebSchedClinic.Visible   = false;
                comboWebSchedClinic.Visible   = false;
                butWebSchedPickClinic.Visible = false;
            }
            FillListBoxWebSchedBlockoutTypes(PrefC.GetString(PrefName.WebSchedRecallIgnoreBlockoutTypes).Split(new char[] { ',' }), listboxWebSchedRecallIgnoreBlockoutTypes);
            FillGridWebSchedRecallTypes();
            FillGridWebSchedOperatories();
            FillGridWebSchedTimeSlotsThreaded();
            listBoxWebSchedProviderPref.SelectedIndex = PrefC.GetInt(PrefName.WebSchedProviderRule);
            checkRecallAllowProvSelection.Checked     = PrefC.GetBool(PrefName.WebSchedRecallAllowProvSelection);
            long       defaultStatus = PrefC.GetLong(PrefName.WebSchedRecallConfirmStatus);
            List <Def> listDefs      = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true);

            for (int i = 0; i < listDefs.Count; i++)
            {
                int idx = comboWSRConfirmStatus.Items.Add(listDefs[i].ItemName);
                if (listDefs[i].DefNum == defaultStatus)
                {
                    comboWSRConfirmStatus.SelectedIndex = idx;
                }
            }
            comboWSRConfirmStatus.IndexSelectOrSetText(listDefs.ToList().FindIndex(x => x.DefNum == defaultStatus),
                                                       () => { return(defaultStatus == 0 ? "" : Defs.GetName(DefCat.ApptConfirmed, defaultStatus) + " (" + Lan.g(this, "hidden") + ")"); });
        }
Example #22
0
        private void FillGrid()
        {
            List <Procedure> entireList = Procedures.Refresh(AptCur.PatNum);

            ProcList = new List <Procedure>();
            bool       isPlanned  = AptCur.AptStatus == ApptStatus.Planned;
            ApptStatus apptStatus = AptCur.AptStatus;

            for (int i = 0; i < entireList.Count; i++)
            {
                //We want all unattached completed procs with same date as appt.
                //but only if one of these types
                if (apptStatus == ApptStatus.Scheduled || apptStatus == ApptStatus.Complete || apptStatus == ApptStatus.Broken)
                {
                    if (entireList[i].AptNum == 0 &&
                        entireList[i].ProcStatus == ProcStat.C &&
                        entireList[i].ProcDate.Date == AptCur.AptDateTime.Date)
                    {
                        ProcList.Add(entireList[i]);
                    }
                }
                //otherwise, we only want TP procs that are not attached to this appointment.
                //As for TP procs attached to other appointments, we will show this to the user and warn them about it,
                //but we won't filter them out.
                if (entireList[i].ProcStatus != ProcStat.TP)
                {
                    continue;
                }
                if (isPlanned)
                {
                    if (entireList[i].PlannedAptNum == AptCur.AptNum)
                    {
                        continue;
                    }
                }
                else
                {
                    if (entireList[i].AptNum == AptCur.AptNum)
                    {
                        continue;
                    }
                }
                ProcList.Add(entireList[i]);
            }
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn(Lan.g("TableProcSelect", "OtherAppt"), 70, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Code"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Priority"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Tooth"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Description"), 250);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProcSelect", "Fee"), 60, HorizontalAlignment.Right);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ProcList.Count; i++)
            {
                row = new ODGridRow();
                if (ProcList[i].ProcStatus == ProcStat.C)              //so unattached
                {
                    row.Cells.Add("");
                }
                else if (isPlanned && ProcList[i].PlannedAptNum != 0)
                {
                    row.Cells.Add("X");
                }
                else if (!isPlanned && ProcList[i].AptNum != 0)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(ProcedureCodes.GetStringProcCode(ProcList[i].CodeNum));
                row.Cells.Add(Defs.GetName(DefCat.TxPriorities, ProcList[i].Priority));
                row.Cells.Add(Tooth.ToInternat(ProcList[i].ToothNum));
                row.Cells.Add(ProcedureCodes.GetLaymanTerm(ProcList[i].CodeNum));
                row.Cells.Add(ProcList[i].ProcFee.ToString("F"));
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Example #23
0
        private void FillGrids(bool doRefreshList = false)
        {
            if (doRefreshList)
            {
                _listAllDunnings = Dunnings.Refresh(_listClinics.Select(x => x.ClinicNum).ToList());
            }
            List <Dunning> listSubDunnings = _listAllDunnings.FindAll(x => ValidateDunningFilters(x));

            if (!PrefC.GetBool(PrefName.ShowFeatureSuperfamilies))
            {
                listSubDunnings.RemoveAll(x => x.IsSuperFamily);
            }
            gridDunning.BeginUpdate();
            gridDunning.ListGridColumns.Clear();
            gridDunning.ListGridColumns.Add(new GridColumn("Billing Type", 80));
            gridDunning.ListGridColumns.Add(new GridColumn("Aging", 70));
            gridDunning.ListGridColumns.Add(new GridColumn("Ins", 40));
            gridDunning.ListGridColumns.Add(new GridColumn("Message", 150));
            gridDunning.ListGridColumns.Add(new GridColumn("Bold Message", 150));
            gridDunning.ListGridColumns.Add(new GridColumn("Email", 35, HorizontalAlignment.Center));
            if (PrefC.GetBool(PrefName.ShowFeatureSuperfamilies))
            {
                gridDunning.ListGridColumns.Add(new GridColumn("SF", 30, HorizontalAlignment.Center));
            }
            if (PrefC.HasClinicsEnabled)
            {
                gridDunning.ListGridColumns.Add(new GridColumn("Clinic", 50));
            }
            gridDunning.ListGridRows.Clear();
            GridRow row;

            foreach (Dunning dunnCur in listSubDunnings)
            {
                row = new GridRow();
                if (dunnCur.BillingType == 0)
                {
                    row.Cells.Add(Lan.g(this, "all"));
                }
                else
                {
                    row.Cells.Add(Defs.GetName(DefCat.BillingTypes, dunnCur.BillingType));
                }
                if (dunnCur.AgeAccount == 0)
                {
                    row.Cells.Add(Lan.g(this, "any"));
                }
                else
                {
                    row.Cells.Add(Lan.g(this, "Over ") + dunnCur.AgeAccount.ToString());
                }
                if (dunnCur.InsIsPending == YN.Yes)
                {
                    row.Cells.Add(Lan.g(this, "Y"));
                }
                else if (dunnCur.InsIsPending == YN.No)
                {
                    row.Cells.Add(Lan.g(this, "N"));
                }
                else                  //YN.Unknown
                {
                    row.Cells.Add(Lan.g(this, "any"));
                }
                row.Cells.Add(dunnCur.DunMessage);
                row.Cells.Add(new GridCell(dunnCur.MessageBold)
                {
                    Bold = YN.Yes, ColorText = Color.DarkRed
                });
                row.Cells.Add((!string.IsNullOrEmpty(dunnCur.EmailBody) || !string.IsNullOrEmpty(dunnCur.EmailSubject))?"X":"");
                if (PrefC.GetBool(PrefName.ShowFeatureSuperfamilies))
                {
                    row.Cells.Add(dunnCur.IsSuperFamily?"X":"");
                }
                if (PrefC.HasClinicsEnabled)
                {
                    row.Cells.Add(_listClinics.Find(x => x.ClinicNum == dunnCur.ClinicNum)?.Abbr ?? "");
                }
                row.Tag = dunnCur;
                gridDunning.ListGridRows.Add(row);
            }
            gridDunning.EndUpdate();
        }
Example #24
0
        private void FillConditions()
        {
            gridConditions.BeginUpdate();
            gridConditions.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g(this, "Type"), 120);

            gridConditions.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Operator"), 80, HorizontalAlignment.Center);
            gridConditions.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Value"), 150);
            gridConditions.ListGridColumns.Add(col);
            gridConditions.ListGridRows.Clear();
            GridRow           row;
            RequiredFieldName currentType;
            string            allCondValues = "";

            for (int i = 0; i < _reqFieldCur.ListRequiredFieldConditions.Count; i++)
            {
                row         = new GridRow();
                currentType = _reqFieldCur.ListRequiredFieldConditions[i].ConditionType;
                if (currentType == RequiredFieldName.Birthdate)
                {
                    row.Cells.Add(Lan.g("enumRequiredFieldName", "Age"));
                }
                else
                {
                    row.Cells.Add(Lan.g("enumRequiredFieldName", currentType.ToString()));
                }
                if (_reqFieldCur.ListRequiredFieldConditions[i].Operator == ConditionOperator.NotEquals)
                {
                    row.Cells.Add(Lan.g(this, "Is not"));
                }
                else
                {
                    row.Cells.Add(Lan.g(this, "Is"));                   //If the operator is <,>,<=, or >=, this will be reflected in the 'Value' column
                }
                //Construct the string for the 'Value' column
                if (currentType == RequiredFieldName.Birthdate || currentType == RequiredFieldName.AdmitDate || currentType == RequiredFieldName.DateTimeDeceased)
                {
                    //Continuous values
                    //'Value' column will end up looking like:  Greater than 18 and
                    //																					less than 26
                    switch (_reqFieldCur.ListRequiredFieldConditions[i].Operator)
                    {
                    case ConditionOperator.GreaterThan:
                        allCondValues += Lan.g(this, "greater than") + " ";
                        break;

                    case ConditionOperator.LessThan:
                        allCondValues += Lan.g(this, "less than") + " ";
                        break;

                    case ConditionOperator.GreaterThanOrEqual:
                        allCondValues += Lan.g(this, "greater than or equal to") + " ";
                        break;

                    case ConditionOperator.LessThanOrEqual:
                        allCondValues += Lan.g(this, "less than or equal to") + " ";
                        break;
                    }
                    if (allCondValues.Length > 0)
                    {
                        allCondValues = allCondValues[0].ToString().ToUpper() + allCondValues.Substring(1);                    //Turn the first letter to uppercase
                    }
                }
                string condVal = _reqFieldCur.ListRequiredFieldConditions[i].ConditionValue;
                switch (currentType)
                {
                //These RequiredFieldName types store a FK to another value
                case RequiredFieldName.Clinic:
                    if (condVal == "0")
                    {
                        condVal = Lan.g(this, "Unassigned");
                    }
                    else
                    {
                        condVal = Clinics.GetDesc(PIn.Long(condVal));
                    }
                    break;

                case RequiredFieldName.BillingType:
                    condVal = Defs.GetName(DefCat.BillingTypes, PIn.Long(condVal));
                    break;

                case RequiredFieldName.PrimaryProvider:
                    condVal = Providers.GetLongDesc(PIn.Long(condVal));
                    break;
                }
                allCondValues += condVal;
                if (i < _reqFieldCur.ListRequiredFieldConditions.Count - 1 &&
                    _reqFieldCur.ListRequiredFieldConditions[i + 1].ConditionType == currentType)                    //The next condition is of the same type
                {
                    if ((currentType == RequiredFieldName.Birthdate || currentType == RequiredFieldName.AdmitDate || currentType == RequiredFieldName.DateTimeDeceased) &&
                        _reqFieldCur.ListRequiredFieldConditions[i].ConditionRelationship == LogicalOperator.And)
                    {
                        allCondValues += " " + Lan.g(this, "and") + "\r\n";
                    }
                    else
                    {
                        allCondValues += " " + Lan.g(this, "or") + "\r\n";
                    }
                    //Don't add the row, continue building the 'Value' string
                }
                else                  //The last condition of this type, now add the row
                {
                    row.Cells.Add(allCondValues);
                    row.Tag = currentType;
                    gridConditions.ListGridRows.Add(row);
                    allCondValues = "";                  //for rebuilding the next Value string
                }
            }
            gridConditions.EndUpdate();
        }
Example #25
0
        private void FormAdjust_Load(object sender, System.EventArgs e)
        {
            if (AvaTax.IsEnabled())
            {
                //We do not want to allow the user to make edits or delete SalesTax and SalesTaxReturn Adjustments.  Popup if no permission so user knows why disabled.
                if (AvaTax.IsEnabled() &&
                    (_adjustmentCur.AdjType == AvaTax.SalesTaxAdjType || _adjustmentCur.AdjType == AvaTax.SalesTaxReturnAdjType) &&
                    !Security.IsAuthorized(Permissions.SalesTaxAdjEdit))
                {
                    DisableForm(textNote, butCancel);
                    textNote.ReadOnly = true;                  //This will allow the user to copy the note if desired.
                }
            }
            if (IsNew)
            {
                if (!Security.IsAuthorized(Permissions.AdjustmentCreate, true))                //Date not checked here.  Message will show later.
                {
                    if (!Security.IsAuthorized(Permissions.AdjustmentEditZero, true))          //Let user create an adjustment of zero if they have this perm.
                    {
                        MessageBox.Show(Lans.g("Security", "Not authorized for") + "\r\n" + GroupPermissions.GetDesc(Permissions.AdjustmentCreate));
                        DialogResult = DialogResult.Cancel;
                        return;
                    }
                    //Make sure amount is 0 after OK click.
                    _checkZeroAmount = true;
                }
            }
            else
            {
                if (!Security.IsAuthorized(Permissions.AdjustmentEdit, _adjustmentCur.AdjDate))
                {
                    butOK.Enabled     = false;
                    butDelete.Enabled = false;
                    //User can't edit but has edit zero amount perm.  Allow delete only if date is today.
                    if (Security.IsAuthorized(Permissions.AdjustmentEditZero, true) &&
                        _adjustmentCur.AdjAmt == 0 &&
                        _adjustmentCur.DateEntry.Date == MiscData.GetNowDateTime().Date)
                    {
                        butDelete.Enabled = true;
                    }
                }
                bool isAttachedToPayPlan = PayPlanLinks.GetForFKeyAndLinkType(_adjustmentCur.AdjNum, PayPlanLinkType.Adjustment).Count > 0;
                _listSplitsForAdjustment = PaySplits.GetForAdjustments(new List <long>()
                {
                    _adjustmentCur.AdjNum
                });
                if (_listSplitsForAdjustment.Count > 0 || isAttachedToPayPlan)
                {
                    butAttachProc.Enabled     = false;
                    butDetachProc.Enabled     = false;
                    labelProcDisabled.Visible = true;
                }
                //Do not let the user change the adjustment type if the current adjustment is a "discount plan" adjustment type.
                if (Defs.GetValue(DefCat.AdjTypes, _adjustmentCur.AdjType) == "dp")
                {
                    labelAdditions.Text       = Lan.g(this, "Discount Plan") + ": " + Defs.GetName(DefCat.AdjTypes, _adjustmentCur.AdjType);
                    labelSubtractions.Visible = false;
                    listTypePos.Visible       = false;
                    listTypeNeg.Visible       = false;
                }
            }
            textDateEntry.Text = _adjustmentCur.DateEntry.ToShortDateString();
            textAdjDate.Text   = _adjustmentCur.AdjDate.ToShortDateString();
            textProcDate.Text  = _adjustmentCur.ProcDate.ToShortDateString();
            if (Defs.GetValue(DefCat.AdjTypes, _adjustmentCur.AdjType) == "+")         //pos
            {
                textAmount.Text = _adjustmentCur.AdjAmt.ToString("F");
            }
            else if (Defs.GetValue(DefCat.AdjTypes, _adjustmentCur.AdjType) == "-")    //neg
            {
                textAmount.Text = (-_adjustmentCur.AdjAmt).ToString("F");              //shows without the neg sign
            }
            else if (Defs.GetValue(DefCat.AdjTypes, _adjustmentCur.AdjType) == "dp")   //Discount Plan (neg)
            {
                textAmount.Text = (-_adjustmentCur.AdjAmt).ToString("F");              //shows without the neg sign
            }
            comboClinic.SelectedClinicNum = _adjustmentCur.ClinicNum;
            comboProv.SetSelectedProvNum(_adjustmentCur.ProvNum);
            FillComboProv();
            if (_adjustmentCur.ProcNum != 0 && PrefC.GetInt(PrefName.RigorousAdjustments) == (int)RigorousAdjustments.EnforceFully)
            {
                comboProv.Enabled   = false;
                butPickProv.Enabled = false;
                comboClinic.Enabled = false;
                if (Security.IsAuthorized(Permissions.Setup, true))
                {
                    labelEditAnyway.Visible = true;
                    butEditAnyway.Visible   = true;
                }
            }
            //prevents FillProcedure from being called too many times.  Event handlers hooked back up after the lists are filled.
            listTypeNeg.SelectedIndexChanged -= listTypeNeg_SelectedIndexChanged;
            listTypePos.SelectedIndexChanged -= listTypePos_SelectedIndexChanged;
            List <Def> adjCat = Defs.GetDefsForCategory(DefCat.AdjTypes, true);

            //Positive adjustment types
            _listAdjPosCats = adjCat.FindAll(x => x.ItemValue == "+");
            _listAdjPosCats.ForEach(x => listTypePos.Items.Add(x.ItemName));
            listTypePos.SelectedIndex = _listAdjPosCats.FindIndex(x => x.DefNum == _adjustmentCur.AdjType);        //can be -1
            //Negative adjustment types
            _listAdjNegCats = adjCat.FindAll(x => x.ItemValue == "-");
            _listAdjNegCats.ForEach(x => listTypeNeg.Items.Add(x.ItemName));
            listTypeNeg.SelectedIndex         = _listAdjNegCats.FindIndex(x => x.DefNum == _adjustmentCur.AdjType);//can be -1
            listTypeNeg.SelectedIndexChanged += listTypeNeg_SelectedIndexChanged;
            listTypePos.SelectedIndexChanged += listTypePos_SelectedIndexChanged;
            FillProcedure();
            textNote.Text = _adjustmentCur.AdjNote;
        }
Example #26
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "Category"), 130);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Catalog #"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Supplier"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Description"), 200);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Price"), 60, HorizontalAlignment.Right);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "StockQty"), 60, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "OnHandQty"), 80, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "IsHidden"), 40, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < _listSupplies.Count; i++)
            {
                Supply supply = _listSupplies[i];
                if (!checkShowHidden.Checked && supply.IsHidden)
                {
                    continue;                    //If we're filtering out hidden supplies and this one is hidden, skip it.
                }
                if (SelectedSupplierNum != 0 && supply.SupplierNum != SelectedSupplierNum)
                {
                    continue;                    //If we specified a suppliernum outside this form and this supply doesn't have that suppliernum, skip it.
                }
                else if (comboSupplier.SelectedIndex != 0 && _listSuppliers[comboSupplier.SelectedIndex - 1].SupplierNum != supply.SupplierNum)
                {
                    continue;                    //If a supplier is selected in the combo box and this supply doesn't have it, skip it.
                }
                if (checkShowShoppingList.Checked && supply.LevelOnHand >= supply.LevelDesired)
                {
                    continue;                    //If we are only showing those that require restocking and this one has the number desired, skip it.
                }
                if (!string.IsNullOrEmpty(textFind.Text) &&
                    !supply.Descript.ToUpper().Contains(textFind.Text.ToUpper()) &&
                    !supply.CatalogNumber.ToString().ToUpper().Contains(textFind.Text.ToUpper()) &&
                    !Defs.GetName(DefCat.SupplyCats, supply.Category).ToUpper().Contains(textFind.Text.ToUpper()) &&
                    !supply.LevelDesired.ToString().Contains(textFind.Text) &&
                    !supply.Price.ToString().ToUpper().Contains(textFind.Text.ToUpper()) &&
                    !supply.SupplierNum.ToString().Contains(textFind.Text))
                {                //If nothing about the supply matches the text entered in the field, skip it.
                    continue;
                }
                row = new ODGridRow();
                if (gridMain.Rows.Count == 0 || (gridMain.Rows.Count > 0 && supply.Category != ((Supply)gridMain.Rows[gridMain.Rows.Count - 1].Tag).Category))
                {
                    row.Cells.Add(Defs.GetName(DefCat.SupplyCats, supply.Category));                   //Add the new category header in this row if it doesn't match the previous row's category.
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(supply.CatalogNumber);
                row.Cells.Add(Suppliers.GetName(_listSuppliers, supply.SupplierNum));
                row.Cells.Add(supply.Descript);
                if (supply.Price == 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(supply.Price.ToString("n"));
                }
                if (supply.LevelDesired == 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(supply.LevelDesired.ToString());
                }
                row.Cells.Add(supply.LevelOnHand.ToString());
                if (supply.IsHidden)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Tag = supply;
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            for (int i = 0; i < gridMain.Rows.Count; i++)
            {
                if (_listSelectedSupplies.Contains(((Supply)gridMain.Rows[i].Tag)))
                {
                    gridMain.SetSelected(i, true);
                }
            }
        }
Example #27
0
        private void FillGrid()
        {
            ODProgress.ShowAction(            //Show progress window while filling the grid.
                () => {
                string order = "";
                switch (comboOrder.SelectedIndex)
                {
                case 0:
                    order = "status";
                    break;

                case 1:
                    order = "alph";
                    break;

                case 2:
                    order = "date";
                    break;
                }
                long provNum = 0;
                if (comboProv.SelectedIndex != 0)
                {
                    provNum = _listProviders[comboProv.SelectedIndex - 1].ProvNum;
                }
                long siteNum = 0;
                if (!PrefC.GetBool(PrefName.EasyHidePublicHealth) && comboSite.SelectedIndex != 0)
                {
                    siteNum = _listSites[comboSite.SelectedIndex - 1].SiteNum;
                }
                bool showBrokenAppts;
                showBrokenAppts = checkBrokenAppts.Checked;
                long clinicNum  = PrefC.HasClinicsEnabled ? comboClinic.SelectedClinicNum : -1;
                _listUnschedApt = Appointments.RefreshUnsched(order, provNum, siteNum, showBrokenAppts, clinicNum,
                                                              codeRangeFilter.StartRange, codeRangeFilter.EndRange, dateRangePicker.GetDateTimeFrom(), dateRangePicker.GetDateTimeTo());
                UnscheduleListEvent.Fire(ODEventType.UnscheduledList, Lans.g(this, "Filling the Unscheduled List grid..."));
                int scrollVal = grid.ScrollValue;
                grid.BeginUpdate();
                grid.ListGridColumns.Clear();
                GridColumn col = new GridColumn(Lan.g("TableUnsched", "Patient"), 140);
                grid.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g("TableUnsched", "Date"), 65);
                grid.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g("TableUnsched", "AptStatus"), 90);
                grid.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g("TableUnsched", "UnschedStatus"), 110);
                grid.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g("TableUnsched", "Prov"), 50);
                grid.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g("TableUnsched", "Procedures"), 150);
                grid.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g("TableUnsched", "Notes"), 200);
                grid.ListGridColumns.Add(col);
                grid.ListGridRows.Clear();
                GridRow row;
                Dictionary <long, string> dictPatNames = Patients.GetPatientNames(_listUnschedApt.Select(x => x.PatNum).ToList());
                foreach (Appointment apt in _listUnschedApt)
                {
                    row            = new GridRow();
                    string patName = Lan.g(this, "UNKNOWN");
                    dictPatNames.TryGetValue(apt.PatNum, out patName);
                    row.Cells.Add(patName);
                    if (apt.AptDateTime.Year < 1880)
                    {
                        row.Cells.Add("");
                    }
                    else
                    {
                        row.Cells.Add(apt.AptDateTime.ToShortDateString());
                    }
                    if (apt.AptStatus == ApptStatus.Broken)
                    {
                        row.Cells.Add(Lan.g(this, "Broken"));
                    }
                    else
                    {
                        row.Cells.Add(Lan.g(this, "Unscheduled"));
                    }
                    row.Cells.Add(Defs.GetName(DefCat.RecallUnschedStatus, apt.UnschedStatus));
                    row.Cells.Add(Providers.GetAbbr(apt.ProvNum));
                    row.Cells.Add(apt.ProcDescript);
                    row.Cells.Add(apt.Note);
                    grid.ListGridRows.Add(row);
                }
                grid.EndUpdate();
                grid.ScrollValue = scrollVal;
            },
                startingMessage: Lans.g(this, "Retrieving data for the Unscheduled List grid..."),
                eventType: typeof(UnscheduleListEvent),
                odEventType: ODEventType.UnscheduledList
                );
        }
Example #28
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableClinics", "Abbr"), 120));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableClinics", "Description"), 200));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableClinics", "Specialty"), 150));
            gridMain.Columns.Add(new ODGridColumn(Lan.g("TableClinics", "Pat Count"), 80, HorizontalAlignment.Center));
            if (!IsSelectionMode)
            {
                gridMain.Columns.Add(new ODGridColumn(Lan.g("TableClinics", "Hidden"), 0, HorizontalAlignment.Center));
            }
            gridMain.Rows.Clear();
            ODGridRow row;
            int       patCount = 0;

            if (IncludeHQInList)
            {
                row     = new ODGridRow();
                row.Tag = new Clinic {              //creating new clinic with Headquarters as description. The clinic will not get inserted into the db.
                    ClinicNum   = 0,
                    Description = "Headquarters",
                    Abbr        = "HQ"
                };                //With a ClinicNum of 0, this will act as Headquarters.
                row.Cells.Add("");
                row.Cells.Add(Lan.g("TableClinics", "Headquarters"));
                row.Cells.Add("");
                if (_dictClinicalCounts.ContainsKey(0))
                {
                    patCount = _dictClinicalCounts[0];
                }
                row.Cells.Add(POut.Int(patCount));
                if (!IsSelectionMode)
                {
                    row.Cells.Add("");
                }
                gridMain.Rows.Add(row);
            }
            for (int i = 0; i < ListClinics.Count; i++)
            {
                if (!checkShowHidden.Checked && ListClinics[i].IsHidden)
                {
                    continue;
                }
                string        specialty     = "";
                DefLinkClinic defLinkClinic = _listDefLinkClinicSpecialties.FirstOrDefault(x => x.Clinic.ClinicNum == ListClinics[i].ClinicNum);
                if (defLinkClinic != null)
                {
                    specialty = string.Join(",", defLinkClinic.ListDefLink.Select(x => Defs.GetName(DefCat.ClinicSpecialty, x.DefNum)));
                }
                row     = new ODGridRow();
                row.Tag = ListClinics[i];
                row.Cells.Add(ListClinics[i].Abbr);
                row.Cells.Add(ListClinics[i].Description);
                row.Cells.Add(specialty);
                patCount = 0;
                if (ListClinics[i].IsNew)                 //a new clinic was just added
                {
                    patCount = 0;
                }
                else if (_dictClinicalCounts.ContainsKey(ListClinics[i].ClinicNum))
                {
                    patCount = _dictClinicalCounts[ListClinics[i].ClinicNum];
                }
                row.Cells.Add(POut.Int(patCount));
                if (!IsSelectionMode)
                {
                    row.Cells.Add(ListClinics[i].IsHidden ? "X" : "");
                }
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
        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);
        }
Example #30
0
        private void FillGrid()
        {
            DateTime dateFrom  = PIn.Date(textDateFrom.Text);
            DateTime dateTo    = PIn.Date(textDateTo.Text);
            long     clinicNum = 0;

            if (comboClinic.SelectedIndex > 0)
            {
                clinicNum = _listClinics[comboClinic.SelectedIndex - 1].ClinicNum;
            }
            long selectedGroupNum = 0;

            if (comboPayGroup.SelectedIndex != 0)
            {
                selectedGroupNum = _listCPGroups[comboPayGroup.SelectedIndex - 1].DefNum;
            }
            DataTable tableClaimPayments = ClaimPayments.GetForDateRange(dateFrom, dateTo, clinicNum, selectedGroupNum);

            ListClaimPay = ClaimPaymentCrud.TableToList(tableClaimPayments);
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g(this, "Date"), 65);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Type"), 70);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Amount"), 75, HorizontalAlignment.Right);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Partial"), 40, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Carrier"), 180);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "PayGroup"), 80);
            gridMain.ListGridColumns.Add(col);
            if (PrefC.HasClinicsEnabled)
            {
                col = new GridColumn(Lan.g(this, "Clinic"), 80);
                gridMain.ListGridColumns.Add(col);
            }
            col = new GridColumn(Lan.g(this, "Note"), 180);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Scanned"), 40, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < ListClaimPay.Count; i++)
            {
                row = new GridRow();
                if (ListClaimPay[i].CheckDate.Year < 1800)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(ListClaimPay[i].CheckDate.ToShortDateString());
                }
                row.Cells.Add(Defs.GetName(DefCat.InsurancePaymentType, ListClaimPay[i].PayType));
                row.Cells.Add(ListClaimPay[i].CheckAmt.ToString("c"));
                row.Cells.Add(ListClaimPay[i].IsPartial?"X":"");
                row.Cells.Add(ListClaimPay[i].CarrierName);
                row.Cells.Add(Defs.GetName(DefCat.ClaimPaymentGroups, ListClaimPay[i].PayGroup));
                if (PrefC.HasClinicsEnabled)
                {
                    row.Cells.Add(Clinics.GetAbbr(ListClaimPay[i].ClinicNum));
                }
                row.Cells.Add(ListClaimPay[i].Note);
                row.Cells.Add((tableClaimPayments.Rows[i]["hasEobAttach"].ToString() == "1")?"X":"");
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            gridMain.ScrollToEnd();
        }