Example #1
0
        ///<summary>Fills the passed in grid with the definitions in the passed in list.</summary>
        public static void FillGridDefs(ODGrid gridDefs, DefCatOptions selectedDefCatOpt, List <Def> listDefsCur)
        {
            Def selectedDef = null;

            if (gridDefs.GetSelectedIndex() > -1)
            {
                selectedDef = (Def)gridDefs.ListGridRows[gridDefs.GetSelectedIndex()].Tag;
            }
            int scroll = gridDefs.ScrollValue;

            gridDefs.BeginUpdate();
            gridDefs.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn(Lan.g("TableDefs", "Name"), 190);
            gridDefs.ListGridColumns.Add(col);
            col = new GridColumn(selectedDefCatOpt.ValueText, 190);
            gridDefs.ListGridColumns.Add(col);
            col = new GridColumn(selectedDefCatOpt.EnableColor ? Lan.g("TableDefs", "Color") : "", 40);
            gridDefs.ListGridColumns.Add(col);
            col = new GridColumn(selectedDefCatOpt.CanHide ? Lan.g("TableDefs", "Hide") : "", 30, HorizontalAlignment.Center);
            gridDefs.ListGridColumns.Add(col);
            gridDefs.ListGridRows.Clear();
            GridRow row;

            foreach (Def defCur in listDefsCur)
            {
                if (!PrefC.IsODHQ && defCur.ItemValue == CommItemTypeAuto.ODHQ.ToString())
                {
                    continue;
                }
                if (Defs.IsDefDeprecated(defCur))
                {
                    defCur.IsHidden = true;
                }
                row = new GridRow();
                if (selectedDefCatOpt.CanEditName)
                {
                    row.Cells.Add(defCur.ItemName);
                }
                else                                                          //Users cannot edit the item name so let them translate them.
                {
                    row.Cells.Add(Lan.g("FormDefinitions", defCur.ItemName)); //Doesn't use 'this' so that renaming the form doesn't change the translation
                }
                if (selectedDefCatOpt.DefCat == DefCat.ImageCats)
                {
                    row.Cells.Add(GetItemDescForImages(defCur.ItemValue));
                }
                else if (selectedDefCatOpt.DefCat == DefCat.AutoNoteCats)
                {
                    Dictionary <string, string> dictAutoNoteDefs = new Dictionary <string, string>();
                    dictAutoNoteDefs = listDefsCur.ToDictionary(x => x.DefNum.ToString(), x => x.ItemName);
                    string nameCur;
                    row.Cells.Add(dictAutoNoteDefs.TryGetValue(defCur.ItemValue, out nameCur) ? nameCur : defCur.ItemValue);
                }
                else if (selectedDefCatOpt.DefCat == DefCat.WebSchedNewPatApptTypes)
                {
                    AppointmentType appointmentType = AppointmentTypes.GetWebSchedNewPatApptTypeByDef(defCur.DefNum);
                    row.Cells.Add(appointmentType == null ? "" : appointmentType.AppointmentTypeName);
                }
                else if (selectedDefCatOpt.DoShowItemOrderInValue)
                {
                    row.Cells.Add(defCur.ItemOrder.ToString());
                }
                else
                {
                    row.Cells.Add(defCur.ItemValue);
                }
                row.Cells.Add("");
                if (selectedDefCatOpt.EnableColor)
                {
                    row.Cells[row.Cells.Count - 1].ColorBackG = defCur.ItemColor;
                }
                if (defCur.IsHidden)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Tag = defCur;
                gridDefs.ListGridRows.Add(row);
            }
            gridDefs.EndUpdate();
            if (selectedDef != null)
            {
                for (int i = 0; i < gridDefs.ListGridRows.Count; i++)
                {
                    if (((Def)gridDefs.ListGridRows[i].Tag).DefNum == selectedDef.DefNum)
                    {
                        gridDefs.SetSelected(i, true);
                        break;
                    }
                }
            }
            gridDefs.ScrollValue = scroll;
        }
        ///<summary>Fills charge grid, and then split grid.</summary>
        private void FillGridCharges()
        {
            //Fill right-hand grid with all the charges, filtered based on checkbox and filters.
            List <int> listExpandedRows = new List <int>();

            for (int i = 0; i < gridCharges.ListGridRows.Count; i++)
            {
                if (gridCharges.ListGridRows[i].State.DropDownState == ODGridDropDownState.Down)
                {
                    listExpandedRows.Add(i);                    //Keep track of expanded rows
                }
            }
            gridCharges.BeginUpdate();
            gridCharges.ListGridColumns.Clear();
            gridCharges.ListGridColumns.Add(new GridColumn(Lan.g(this, "Prov"), 100));
            gridCharges.ListGridColumns.Add(new GridColumn(Lan.g(this, "Patient"), 100));
            if (PrefC.HasClinicsEnabled)
            {
                gridCharges.ListGridColumns.Add(new GridColumn(Lan.g(this, "Clinic"), 60));
            }
            gridCharges.ListGridColumns.Add(new GridColumn(Lan.g(this, "Codes"), -200));          //negative so it will dynamically grow when no clinic column is present
            gridCharges.ListGridColumns.Add(new GridColumn(Lan.g(this, "Amt Orig"), 61, HorizontalAlignment.Right, GridSortingStrategy.AmountParse));
            gridCharges.ListGridColumns.Add(new GridColumn(Lan.g(this, "Amt Start"), 61, HorizontalAlignment.Right, GridSortingStrategy.AmountParse));
            gridCharges.ListGridColumns.Add(new GridColumn(Lan.g(this, "Amt End"), 61, HorizontalAlignment.Right, GridSortingStrategy.AmountParse));
            gridCharges.ListGridRows.Clear();
            decimal chargeTotal = 0;
            //Item1=ProvNum,Item2=ClinicNum,Item3=PatNum
            List <Tuple <long, long, long> > listAddedProvNums = new List <Tuple <long, long, long> >(); //this needs to be prov/clinic/patnum
            List <Tuple <long, long, long> > listAddedParents  = new List <Tuple <long, long, long> >(); //prov/clinic/pat

            foreach (AccountEntry entryCharge in _results.ListAccountCharges)
            {
                if (Math.Round(entryCharge.AmountStart, 3) == 0)
                {
                    continue;
                }
                if (listAddedProvNums.Any(x => x.Item1 == entryCharge.ProvNum && x.Item2 == entryCharge.ClinicNum && x.Item3 == entryCharge.PatNum))
                {
                    continue;
                }
                listAddedProvNums.Add(Tuple.Create(entryCharge.ProvNum, entryCharge.ClinicNum, entryCharge.PatNum));
                List <AccountEntry> listEntriesForProvAndClinicAndPatient = _results.ListAccountCharges
                                                                            .FindAll(x => x.ProvNum == entryCharge.ProvNum && x.ClinicNum == entryCharge.ClinicNum && x.PatNum == entryCharge.PatNum);
                List <GridRow> listRows = CreateChargeRows(listEntriesForProvAndClinicAndPatient, listExpandedRows);
                foreach (GridRow row in listRows)
                {
                    AccountEntry accountEntry = (AccountEntry)row.Tag;
                    if (accountEntry.Tag == null)                   //Parent row
                    {
                        chargeTotal += PIn.Decimal(row.Cells[row.Cells.Count - 1].Text);
                        listAddedParents.Add(Tuple.Create(accountEntry.ProvNum, accountEntry.ClinicNum, accountEntry.PatNum));
                    }
                    else if (!listAddedParents.Exists(x => x.Item1 == accountEntry.ProvNum && x.Item2 == accountEntry.ClinicNum && x.Item3 == accountEntry.PatNum))               //In case a parent AND child are selected, don't add child amounts if parent was added already
                    {
                        chargeTotal += accountEntry.AmountEnd;
                    }
                    gridCharges.ListGridRows.Add(row);
                }
            }
            gridCharges.EndUpdate();
            textChargeTotal.Text = chargeTotal.ToString("f");
        }
Example #3
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            if (_showingInfoButton)                       //Security.IsAuthorized(Permissions.EhrInfoButton,true)) {
            {
                col           = new ODGridColumn("", 18); //infoButton
                col.ImageList = imageListInfoButton;
                gridMain.Columns.Add(col);
            }
            col = new ODGridColumn(Lan.g(this, "SNOMED CT"), 125);        //column width of 125 holds the longest Snomed CT code as of 8/7/15 which is 900000000000002006
            gridMain.Columns.Add(col);
            //col=new ODGridColumn("Deprecated",75,HorizontalAlignment.Center);
            //gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Description"), 500);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Used By CQM's"), 185);        //width 185 so all of our CQM measure nums as of 8/7/15 will fit 68,69,74,75,127,138,147,155,165
            gridMain.Columns.Add(col);
            //col=new ODGridColumn("Date Of Standard",100);
            //gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            if (textCode.Text.Contains(","))
            {
                SnomedList = Snomeds.GetByCodes(textCode.Text);
            }
            else
            {
                SnomedList = Snomeds.GetByCodeOrDescription(textCode.Text);
            }
            if (SnomedList.Count >= 10000)           //Max number of results returned.
            {
                MsgBox.Show(this, "Too many results. Only the first 10,000 results will be shown.");
            }
            List <ODGridRow> listAll = new List <ODGridRow>();

            for (int i = 0; i < SnomedList.Count; i++)
            {
                row = new ODGridRow();
                if (_showingInfoButton)                 //Security.IsAuthorized(Permissions.EhrInfoButton,true)) {
                {
                    row.Cells.Add("0");                 //index of infobutton
                }
                row.Cells.Add(SnomedList[i].SnomedCode);
                //row.Cells.Add("");//IsActive==NotDeprecated
                row.Cells.Add(SnomedList[i].Description);
                row.Cells.Add(EhrCodes.GetMeasureIdsForCode(SnomedList[i].SnomedCode, "SNOMEDCT"));
                row.Tag = SnomedList[i];
                //row.Cells.Add("");
                listAll.Add(row);
            }
            listAll.Sort(SortMeasuresMet);
            for (int i = 0; i < listAll.Count; i++)
            {
                gridMain.Rows.Add(listAll[i]);
            }
            gridMain.EndUpdate();
        }
Example #4
0
        ///<summary>raised for each page to be printed.  One page per appointment.</summary>
        private void pd_PrintPage(object sender, PrintPageEventArgs ev)
        {
            if (ApptNum != 0)           //just for one appointment
            {
                date = Appointments.DateSelected;
            }
            Graphics   g = ev.Graphics;
            float      y = 50;
            float      x = 0;
            string     str;
            float      sizeW;       //used when measuring text for placement
            Font       fontTitle   = new Font(FontFamily.GenericSansSerif, 11, FontStyle.Bold);
            Font       fontHeading = new Font(FontFamily.GenericSansSerif, 9, FontStyle.Bold);
            Font       font        = new Font(FontFamily.GenericSansSerif, 8);
            SolidBrush brush       = new SolidBrush(Color.Black);

            //Title----------------------------------------------------------------------------------------------------------
            str   = Lan.g(this, "Routing Slip");
            sizeW = g.MeasureString(str, fontTitle).Width;
            x     = 425 - sizeW / 2;
            g.DrawString(str, fontTitle, brush, x, y);
            y += 35;
            x  = 75;
            //Today's appointment, including procedures-----------------------------------------------------------------------
            Family  fam = Patients.GetFamily(Appts[pagesPrinted].PatNum);
            Patient pat = fam.GetPatient(Appts[pagesPrinted].PatNum);

            str = pat.GetNameFL();
            g.DrawString(str, fontHeading, brush, x, y);
            y  += 18;
            str = Appts[pagesPrinted].AptDateTime.ToShortTimeString() + "  " + Appts[pagesPrinted].AptDateTime.ToShortDateString();
            g.DrawString(str, fontHeading, brush, x, y);
            y  += 18;
            str = (Appts[pagesPrinted].Pattern.Length * 5).ToString() + " " + Lan.g(this, "minutes");
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Providers.GetAbbr(Appts[pagesPrinted].ProvNum);
            g.DrawString(str, font, brush, x, y);
            y += 15;
            if (Appts[pagesPrinted].ProvHyg != 0)
            {
                str = Providers.GetAbbr(Appts[pagesPrinted].ProvHyg);
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            str = Lan.g(this, "Procedures:");
            g.DrawString(str, font, brush, x, y);
            y += 15;
            Procedure[] procsAll = Procedures.Refresh(pat.PatNum);
            Procedure[] procsApt = Procedures.GetProcsOneApt(Appts[pagesPrinted].AptNum, procsAll);
            for (int i = 0; i < procsApt.Length; i++)
            {
                str = "   " + Procedures.GetDescription(procsApt[i]);
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            str = Lan.g(this, "Note:") + " " + Appts[pagesPrinted].Note;
            g.DrawString(str, font, brush, x, y);
            y += 25;
            //Patient/Family Info---------------------------------------------------------------------------------------------
            g.DrawLine(Pens.Black, 75, y, 775, y);
            str = Lan.g(this, "Patient Info");
            g.DrawString(str, fontHeading, brush, x, y);
            y  += 18;
            str = Lan.g(this, "PatNum:") + " " + pat.PatNum.ToString();
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Age:") + " ";
            if (pat.Age > 0)
            {
                str += pat.Age.ToString();
            }
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Date of First Visit:") + " ";
            if (pat.DateFirstVisit.Year < 1880)
            {
                str += "?";
            }
            else if (pat.DateFirstVisit == Appts[pagesPrinted].AptDateTime.Date)
            {
                str += Lan.g(this, "New Patient");
            }
            else
            {
                str += pat.DateFirstVisit.ToShortDateString();
            }
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Billing Type:") + " " + DefB.GetName(DefCat.BillingTypes, pat.BillingType);
            g.DrawString(str, font, brush, x, y);
            y += 15;
            Recall[] recallList = Recalls.GetList(new int[] { pat.PatNum });
            str = Lan.g(this, "Recall Due Date:") + " ";
            if (recallList.Length > 0)
            {
                str += recallList[0].DateDue.ToShortDateString();
            }
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Medical notes:") + " " + pat.MedUrgNote;
            g.DrawString(str, font, brush, x, y);
            y += 25;
            //Other Family Members
            str = Lan.g(this, "Other Family Members");
            g.DrawString(str, fontHeading, brush, x, y);
            y += 18;
            for (int i = 0; i < fam.List.Length; i++)
            {
                if (fam.List[i].PatNum == pat.PatNum)
                {
                    continue;
                }
                str = fam.List[i].GetNameFL();
                if (fam.List[i].Age > 0)
                {
                    str += ",   " + fam.List[i].Age.ToString();
                }
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            y += 10;
            //Insurance Info--------------------------------------------------------------------------------------------------
            g.DrawLine(Pens.Black, 75, y, 775, y);
            str = Lan.g(this, "Insurance");
            g.DrawString(str, fontHeading, brush, x, y);
            y += 18;
            PatPlan[]   patPlanList   = PatPlans.Refresh(pat.PatNum);
            InsPlan[]   plans         = InsPlans.Refresh(fam);
            ClaimProc[] claimProcList = ClaimProcs.Refresh(pat.PatNum);
            Benefit[]   benefits      = Benefits.Refresh(patPlanList);
            InsPlan     plan;
            Carrier     carrier;
            string      subscriber;
            double      max;
            double      deduct;

            if (patPlanList.Length == 0)
            {
                str = Lan.g(this, "none");
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            for (int i = 0; i < patPlanList.Length; i++)
            {
                plan    = InsPlans.GetPlan(patPlanList[i].PlanNum, plans);
                carrier = Carriers.GetCarrier(plan.CarrierNum);
                str     = carrier.CarrierName;
                g.DrawString(str, fontHeading, brush, x, y);
                y         += 18;
                subscriber = fam.GetNameInFamFL(plan.Subscriber);
                if (subscriber == "")               //subscriber from another family
                {
                    subscriber = Patients.GetLim(plan.Subscriber).GetNameLF();
                }
                str = Lan.g(this, "Subscriber:") + " " + subscriber;
                g.DrawString(str, font, brush, x, y);
                y  += 15;
                str = Lan.g(this, "Annual Max:") + " ";
                max = Benefits.GetAnnualMax(benefits, plan.PlanNum, patPlanList[i].PatPlanNum);
                if (max != -1)
                {
                    str += max.ToString("n0") + " ";
                }
                str   += "   ";
                str   += Lan.g(this, "Deductible:") + " ";
                deduct = Benefits.GetDeductible(benefits, plan.PlanNum, patPlanList[i].PatPlanNum);
                if (deduct != -1)
                {
                    str += deduct.ToString("n0");
                }
                g.DrawString(str, font, brush, x, y);
                y  += 15;
                str = "";
                for (int j = 0; j < benefits.Length; j++)
                {
                    if (benefits[j].PlanNum != plan.PlanNum)
                    {
                        continue;
                    }
                    if (benefits[j].BenefitType != InsBenefitType.Percentage)
                    {
                        continue;
                    }
                    if (str != "")
                    {
                        str += ",  ";
                    }
                    str += CovCats.GetDesc(benefits[j].CovCatNum) + " " + benefits[j].Percent.ToString() + "%";
                }
                if (str != "")
                {
                    g.DrawString(str, font, brush, x, y);
                    y += 15;
                }
                str = Lan.g(this, "Ins Used:") + " "
                      + InsPlans.GetInsUsed(claimProcList, date, plan.PlanNum, patPlanList[i].PatPlanNum, -1, plans, benefits).ToString("n");
                g.DrawString(str, font, brush, x, y);
                y  += 15;
                str = Lan.g(this, "Ins Pending:") + " "
                      + InsPlans.GetPending(claimProcList, date, plan.PlanNum, patPlanList[i].PatPlanNum, -1, plans, benefits).ToString("n");
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            y += 10;
            //Account Info---------------------------------------------------------------------------------------------------
            g.DrawLine(Pens.Black, 75, y, 775, y);
            str = Lan.g(this, "Account Info");
            g.DrawString(str, fontHeading, brush, x, y);
            y  += 18;
            str = Lan.g(this, "Guarantor:") + " " + fam.List[0].GetNameFL();
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Balance:") + (fam.List[0].BalTotal - fam.List[0].InsEst).ToString("c");
            if (fam.List[0].InsEst > .01)
            {
                str += "  (" + fam.List[0].BalTotal.ToString("c") + " - "
                       + fam.List[0].InsEst.ToString("c") + " " + Lan.g(this, "InsEst") + ")";
            }
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Aging:")
                  + "  0-30:" + fam.List[0].Bal_0_30.ToString("c")
                  + "  31-60:" + fam.List[0].Bal_31_60.ToString("c")
                  + "  61-90:" + fam.List[0].Bal_61_90.ToString("c")
                  + "  90+:" + fam.List[0].BalOver90.ToString("c");
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Fam Urgent Fin Note:")
                  + fam.List[0].FamFinUrgNote;
            g.DrawString(str, font, brush, x, y);
            y += 15;
            y += 10;
            //Treatment Plan--------------------------------------------------------------------------------------------------
            g.DrawLine(Pens.Black, 75, y, 775, y);
            str = Lan.g(this, "Treatment Plan");
            g.DrawString(str, fontHeading, brush, x, y);
            y += 18;
            for (int i = 0; i < procsAll.Length; i++)
            {
                if (procsAll[i].ProcStatus != ProcStat.TP)
                {
                    continue;
                }
                str = Procedures.GetDescription(procsAll[i]);
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            pagesPrinted++;
            if (pagesPrinted == Appts.Length)
            {
                ev.HasMorePages = false;
                pagesPrinted    = 0;
            }
            else
            {
                ev.HasMorePages = true;
            }
        }
Example #5
0
 public FormIcd10s()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #6
0
 public FormCdsTriggers()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #7
0
 ///<summary>Must have already saved it to db so that we have a RxDefNum to work with.</summary>
 public FormRxDefEdit(RxDef rxDefCur)
 {
     InitializeComponent();            // Required for Windows Form Designer support
     Lan.F(this);
     RxDefCur = rxDefCur.Copy();
 }
Example #8
0
 public FormWikiListHistory()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #9
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textFee.errorProvider1.GetError(textFee) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry error first."));
                return;
            }
            DateTime datePrevious = FeeCur.SecDateTEdit;

            if (textFee.Text == "")
            {
                Fees.Delete(FeeCur);
            }
            else
            {
                FeeCur.Amount = PIn.Double(textFee.Text);
                //Fee object always created and inserted externally first
                Fees.Update(FeeCur);
            }
            SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this, "Procedure") + ": " + ProcedureCodes.GetStringProcCode(FeeCur.CodeNum)
                                      + ", " + Lan.g(this, "Fee: ") + "" + FeeCur.Amount.ToString("c") + ", " + Lan.g(this, "Fee Schedule") + ": " + FeeScheds.GetDescription(FeeCur.FeeSched)
                                      + ". " + Lan.g(this, "Manual edit in Edit Fee window."), FeeCur.CodeNum, DateTime.MinValue);
            SecurityLogs.MakeLogEntry(Permissions.LogFeeEdit, 0, Lan.g(this, "Fee Updated"), FeeCur.FeeNum, datePrevious);
            //FeeCur.UseDefaultCov=checkDefCov.Checked;
            //FeeCur.UseDefaultFee=checkDefFee.Checked;
            DialogResult = DialogResult.OK;
        }
Example #10
0
 ///<summary></summary>
 public FormRpPrintPreview()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #11
0
 ///<summary></summary>
 public FormGroupPermEdit(GroupPermission cur)
 {
     InitializeComponent();
     Lan.F(this);
     Cur = cur.Copy();
 }
 ///<summary></summary>
 public FormHL7DefMessageEdit()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #13
0
 ///<summary></summary>
 public FormRpInsCo()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #14
0
 public FormFieldDefLink(FieldLocations fieldLocation = FieldLocations.Account)
 {
     InitializeComponent();
     Lan.F(this);
     _fieldLocation = fieldLocation;
 }
Example #15
0
 ///<summary></summary>
 public FormQueryFavorites()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #16
0
        private void butOK_Click(object sender, EventArgs e)
        {
            if (_listGridEntries.FindAll(x => x.Adj != null).Count == 0)         //no adjustments have been added. Attempt to add adjustments with the current info.
            //get the list of selected procedures to add adjustments to (if there are any). Will make one for unattached if none exist.
            {
                List <MultiAdjEntry> listSelectedEntries = new List <MultiAdjEntry>();
                for (int i = 0; i < gridMain.SelectedIndices.Count(); i++)
                {
                    listSelectedEntries.Add((MultiAdjEntry)(gridMain.ListGridRows[gridMain.SelectedIndices[i]].Tag));
                }
                if (!IsValid(listSelectedEntries.Count))
                {
                    return;
                }
                AddAdjustments(listSelectedEntries);
                FillGrid();                //In case they get stopped at the msgBox below, they should see the new adjustments added.
            }
            //now we should be guaranteed to have adjustments
            bool hasNegAmt = false;

            foreach (MultiAdjEntry mae in _listGridEntries)
            {
                if (mae.Adj == null || mae.Proc == null)
                {
                    continue;                    //Procedures or unattached adjustments
                }
                decimal remAfter = (decimal)mae.AmtRemBefore + (decimal)mae.Adj.AdjAmt;
                if (remAfter.IsLessThanZero())
                {
                    hasNegAmt = true;
                    break;
                }
            }
            if (hasNegAmt && !MsgBox.Show(this, MsgBoxButtons.OKCancel, "Remaining amount on a procedure is negative.  Continue?", "Overpaid Procedure Warning"))
            {
                return;
            }
            if (!Security.IsAuthorized(Permissions.AdjustmentCreate, true))            //User does not have full edit permission.
            //Therefore the user only has the ability to edit $0 adjustments (see Load()).
            {
                foreach (MultiAdjEntry row in _listGridEntries)
                {
                    if (row.Adj == null)                   //skip over Procedure rows
                    {
                        continue;
                    }
                    if (!row.Adj.AdjAmt.IsZero())
                    {
                        MsgBox.Show(this, "Amount has to be 0.00 due to security permission.");
                        return;
                    }
                }
            }
            List <string> listAdjustmentAmounts = new List <string>();

            foreach (MultiAdjEntry row in _listGridEntries)
            {
                if (row.Adj == null)               //skip over Procedure rows
                {
                    continue;
                }
                Adjustments.Insert(row.Adj);
                TsiTransLogs.CheckAndInsertLogsIfAdjTypeExcluded(row.Adj);
                listAdjustmentAmounts.Add(row.Adj.AdjAmt.ToString("c"));
            }
            if (listAdjustmentAmounts.Count > 0)
            {
                string log = Lan.g(this, "Adjustment(s) created from Multiple Adjustments window:") + " ";
                SecurityLogs.MakeLogEntry(Permissions.AdjustmentCreate, _patCur.PatNum, log + string.Join(",", listAdjustmentAmounts));
            }
            DialogResult = DialogResult.OK;
        }
 ///<summary></summary>
 public FormCentralChooseDatabase(string webServiceUri)
 {
     InitializeComponent();
     textURI.Text = webServiceUri;
     Lan.F(this);
 }
 public FormApptFieldPickEdit(ApptField field)
 {
     InitializeComponent();
     Lan.F(this);
     Field = field;
 }
Example #19
0
 ///<summary></summary>
 public FormRpPHRawProc()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #20
0
 ///<summary>Returns true when all of the sheet fields with IsRequired set to true have a value set. Otherwise, a message box shows and false is returned.</summary>
 private bool VerifyRequiredFields()
 {
     FillFieldsFromControls();
     foreach (Control control in panelMain.Controls)
     {
         if (control.Tag == null)
         {
             continue;
         }
         if (control.GetType() == typeof(RichTextBox))
         {
             SheetField field = (SheetField)control.Tag;
             if (field.FieldType != SheetFieldType.InputField)
             {
                 continue;
             }
             RichTextBox inputBox = (RichTextBox)control;
             if (field.IsRequired && inputBox.Text.Trim() == "")
             {
                 MessageBox.Show(Lan.g(this, "You must enter a value for") + " " + field.FieldName + " " + Lan.g(this, "before continuing."));
                 return(false);
             }
         }
         else if (control.GetType() == typeof(OpenDental.UI.SignatureBoxWrapper))
         {
             SheetField field = (SheetField)control.Tag;
             if (field.FieldType != SheetFieldType.SigBox)
             {
                 continue;
             }
             OpenDental.UI.SignatureBoxWrapper sigBox = (OpenDental.UI.SignatureBoxWrapper)control;
             if (field.IsRequired && (!sigBox.IsValid || sigBox.SigIsBlank))
             {
                 MsgBox.Show(this, "Signature required");
                 return(false);
             }
         }
         else if (control.GetType() == typeof(SheetCheckBox))              //Radio button groups or misc checkboxes
         {
             SheetField field = (SheetField)control.Tag;
             if (field.IsRequired && field.FieldValue != "X")                  //required but this one not checked
             //first, checkboxes that are not radiobuttons.  For example, a checkbox at bottom of web form used in place of signature.
             {
                 if (field.RadioButtonValue == "" &&                   //doesn't belong to a built-in group
                     field.RadioButtonGroup == "")                              //doesn't belong to a custom group
                 {
                     //field.FieldName is always "misc"
                     //int widthActual=(SheetCur.IsLandscape?SheetCur.Height:SheetCur.Width);
                     //int heightActual=(SheetCur.IsLandscape?SheetCur.Width:SheetCur.Height);
                     //int topMidBottom=(heightActual/3)
                     MessageBox.Show(Lan.g(this, "You must check the required checkbox."));
                     return(false);
                 }
                 else                                                 //then radiobuttons (of both kinds)
                                                                      //All radio buttons within a group should either all be marked required or all be marked not required.
                                                                      //Not the most efficient check, but there won't usually be more than a few hundred items so the user will not ever notice. We can speed up later if needed.
                 {
                     bool valueSet        = false;                    //we will be checking to see if at least one in the group has a value
                     int  numGroupButtons = 0;                        //a count of the buttons in the group
                     foreach (Control control2 in panelMain.Controls) //loop through all controls in the sheet
                     {
                         if (control2.GetType() != typeof(SheetCheckBox))
                         {
                             continue;                                    //skip everything that's not a checkbox
                         }
                         SheetField field2 = (SheetField)control2.Tag;
                         //whether built-in or custom, this makes sure it's a match.
                         //the other comparison will also match because they are empty strings
                         if (field2.RadioButtonGroup.ToLower() == field.RadioButtonGroup.ToLower() &&                          //if they are in the same group ("" for built-in, some string for custom group)
                             field2.FieldName == field.FieldName)                                     //"misc" for custom group, some string for built in groups.
                         {
                             numGroupButtons++;
                             if (field2.FieldValue == "X")
                             {
                                 valueSet = true;
                                 break;
                             }
                         }
                     }
                     if (numGroupButtons > 0 && !valueSet)                          //there is not at least one radiobutton in the group that's checked.
                     {
                         if (field.RadioButtonGroup != "")                          //if they are in a custom group
                         {
                             MessageBox.Show(Lan.g(this, "You must select a value for radio button group") + " '" + field.RadioButtonGroup + "'. ");
                         }
                         else
                         {
                             MessageBox.Show(Lan.g(this, "You must select a value for radio button group") + " '" + field.FieldName + "'. ");
                         }
                         return(false);
                     }
                 }
             }
         }
     }
     return(true);
 }
Example #21
0
 public FormOrthoChartEdit()
 {
     InitializeComponent();
     Lan.F(this);
     OrthoCur = new OrthoChart();
 }
        private void FormReqStudentEdit_Load(object sender, System.EventArgs e)
        {
            //There should only be two types of users who are allowed to get this far:
            //Students editing their own req, and users with setup perm.  But we will double check.
            Provider provUser = Providers.GetProv(Security.CurUser.ProvNum);

            if (provUser != null && provUser.SchoolClassNum != 0)         //A student is logged in
            //the student only has permission to view/attach/detach their own requirements
            {
                if (provUser.ProvNum != ReqCur.ProvNum)
                {
                    //but this should never happen
                    MsgBox.Show(this, "Students may only edit their own requirements.");
                    butDelete.Enabled = false;
                    butOK.Enabled     = false;
                }
                else                 //the student matches
                {
                    butDelete.Enabled         = false;
                    textDateCompleted.Enabled = false;
                    butNow.Enabled            = false;
                    comboInstructor.Enabled   = false;
                    //a student is only allowed to change the patient and appointment.
                }
            }
            else                                                                        //A student is not logged in
            {
                if (!Security.IsAuthorized(Permissions.Setup, DateTime.MinValue, true)) //suppress message
                {
                    butDelete.Enabled = false;
                    butOK.Enabled     = false;
                }
            }
            textStudent.Text     = Providers.GetNameLF(ReqCur.ProvNum);
            textCourse.Text      = SchoolCourses.GetDescript(ReqCur.SchoolCourseNum);
            textDescription.Text = ReqCur.Descript;
            if (ReqCur.DateCompleted.Year > 1880)
            {
                textDateCompleted.Text = ReqCur.DateCompleted.ToShortDateString();
            }
            //if an apt is attached, then the same pat must be attached.
            Patient pat = Patients.GetPat(ReqCur.PatNum);

            if (pat != null)
            {
                textPatient.Text = pat.GetNameFL();
            }
            Appointment apt = Appointments.GetOneApt(ReqCur.AptNum);

            if (apt != null)
            {
                if (apt.AptStatus == ApptStatus.UnschedList)
                {
                    textAppointment.Text = Lan.g(this, "Unscheduled");
                }
                else
                {
                    textAppointment.Text = apt.AptDateTime.ToShortDateString() + " " + apt.AptDateTime.ToShortTimeString();
                }
                textAppointment.Text += ", " + apt.ProcDescript;
            }
            comboInstructor.Items.Add(Lan.g(this, "None"));
            comboInstructor.SelectedIndex = 0;
            for (int i = 0; i < Providers.List.Length; i++)
            {
                comboInstructor.Items.Add(Providers.GetNameLF(Providers.List[i].ProvNum));
                if (Providers.List[i].ProvNum == ReqCur.InstructorNum)
                {
                    comboInstructor.SelectedIndex = i + 1;
                }
            }
        }
Example #23
0
 public FormEhrSetup()
 {
     InitializeComponent();
     Lan.F(this);
 }
 ///<summary></summary>
 public FormReqStudentEdit()
 {
     InitializeComponent();            // Required for Windows Form Designer support
     Lan.F(this);
 }
        ///<summary>Fills the paysplit grid.</summary>
        private void FillGridSplits()
        {
            //Fill left grid with paysplits created
            gridSplits.BeginUpdate();
            gridSplits.ListGridColumns.Clear();
            gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Date"), 65, HorizontalAlignment.Center));
            gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Prov"), 40));
            if (PrefC.HasClinicsEnabled)             //Clinics
            {
                gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Clinic"), 40));
            }
            gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Patient"), 100));
            gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "ProcCode"), 60));
            gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Type"), 100));
            gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Amount"), 55, HorizontalAlignment.Right));
            gridSplits.ListGridRows.Clear();
            GridRow row;
            decimal splitTotal = 0;
            Dictionary <long, Procedure> dictProcs = Procedures.GetManyProc(_listSplitsCur.Where(x => x.ProcNum > 0).Select(x => x.ProcNum).Distinct().ToList(), false).ToDictionary(x => x.ProcNum);

            for (int i = 0; i < _listSplitsCur.Count; i++)
            {
                splitTotal += (decimal)_listSplitsCur[i].SplitAmt;
                row         = new GridRow();
                row.Tag     = _listSplitsCur[i];
                row.Cells.Add(_listSplitsCur[i].DatePay.ToShortDateString()); //Date
                row.Cells.Add(Providers.GetAbbr(_listSplitsCur[i].ProvNum));  //Prov
                if (PrefC.HasClinicsEnabled)                                  //Clinics
                {
                    if (_listSplitsCur[i].ClinicNum != 0)
                    {
                        row.Cells.Add(Clinics.GetClinic(_listSplitsCur[i].ClinicNum).Description);                        //Clinic
                    }
                    else
                    {
                        row.Cells.Add("");                        //Clinic
                    }
                }
                Patient patCur;
                if (!_dictPatients.TryGetValue(_listSplitsCur[i].PatNum, out patCur))
                {
                    patCur = Patients.GetPat(_listSplitsCur[i].PatNum);
                }
                row.Cells.Add(patCur.GetNameFL());                //Patient
                Procedure proc = new Procedure();
                if (_listSplitsCur[i].ProcNum > 0 && !dictProcs.TryGetValue(_listSplitsCur[i].ProcNum, out proc))
                {
                    proc = Procedures.GetOneProc(_listSplitsCur[i].ProcNum, false);
                }
                row.Cells.Add(ProcedureCodes.GetStringProcCode(proc?.CodeNum ?? 0));              //ProcCode
                string type = "";
                if (_listSplitsCur[i].PayPlanNum != 0)
                {
                    type += "PayPlanCharge";                  //Type
                    if (_listSplitsCur[i].IsInterestSplit && _listSplitsCur[i].ProcNum == 0 && _listSplitsCur[i].ProvNum != 0)
                    {
                        type += " (interest)";
                    }
                }
                if (_listSplitsCur[i].ProcNum != 0)               //Procedure
                {
                    string procDesc = Procedures.GetDescription(proc ?? new Procedure());
                    if (type != "")
                    {
                        type += "\r\n";
                    }
                    type += "Proc: " + procDesc;                //Type
                }
                if (_listSplitsCur[i].ProvNum == 0)             //Unattached split
                {
                    if (type != "")
                    {
                        type += "\r\n";
                    }
                    type += "Unallocated";                  //Type
                }
                if (_listSplitsCur[i].ProvNum != 0 && _listSplitsCur[i].UnearnedType != 0)
                {
                    if (type != "")
                    {
                        type += "\r\n";
                    }
                    type += Defs.GetDef(DefCat.PaySplitUnearnedType, _listSplitsCur[i].UnearnedType).ItemName;
                }
                row.Cells.Add(type);
                if (row.Cells[row.Cells.Count - 1].Text == "Unallocated")
                {
                    row.Cells[row.Cells.Count - 1].ColorText = Color.Red;
                }
                row.Cells.Add(_listSplitsCur[i].SplitAmt.ToString("f"));                //Amount
                gridSplits.ListGridRows.Add(row);
            }
            gridSplits.EndUpdate();
            textSplitTotal.Text = splitTotal.ToString("f");
            FillGridCharges();
        }
 public FormEhrPatientExport()
 {
     InitializeComponent();
     Lan.F(this);
 }
Example #27
0
        private int _showingInfobuttonShift;    //used when sorting grid rows. 1 if showing, 0 if hidden

        public FormSnomeds()
        {
            InitializeComponent();
            Lan.F(this);
        }
        private void butExport_Click(object sender, EventArgs e)
        {
            string strCcdValidationErrors = EhrCCD.ValidateSettings();

            if (strCcdValidationErrors != "")            //Do not even try to export if global settings are invalid.
            {
                MessageBox.Show(strCcdValidationErrors); //We do not want to use translations here, because the text is dynamic. The errors are generated in the business layer, and Lan.g() is not available there.
                return;
            }
            FolderBrowserDialog dlg    = new FolderBrowserDialog();
            DialogResult        result = dlg.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }
            DateTime dateNow    = DateTime.Now;
            string   folderPath = ODFileUtils.CombinePaths(dlg.SelectedPath, (dateNow.Year + "_" + dateNow.Month + "_" + dateNow.Day));

            if (Directory.Exists(folderPath))
            {
                int loopCount = 1;
                while (Directory.Exists(folderPath + "_" + loopCount))
                {
                    loopCount++;
                }
                folderPath = folderPath + "_" + loopCount;
            }
            try {
                Directory.CreateDirectory(folderPath);
            }
            catch {
                MessageBox.Show("Error, Could not create folder");
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            Patient patCur;
            string  fileName;
            int     numSkipped      = 0;   //Number of patients skipped. Set to -1 if only one patient was selected and had CcdValidationErrors.
            string  patientsSkipped = "";  //Names of the patients that were skipped, so we can tell the user which ones didn't export correctly.

            for (int i = 0; i < gridMain.SelectedIndices.Length; i++)
            {
                patCur = Patients.GetPat((long)gridMain.ListGridRows[gridMain.SelectedIndices[i]].Tag);              //Cannot use GetLim because more information is needed in the CCD message generation below.
                strCcdValidationErrors = EhrCCD.ValidatePatient(patCur);
                if (strCcdValidationErrors != "")
                {
                    if (gridMain.SelectedIndices.Length == 1)
                    {
                        numSkipped = -1;                       //Set to -1 so we know below to not show the "exported" message.
                        MessageBox.Show(Lan.g(this, "Patient not exported due to the following errors") + ":\r\n" + strCcdValidationErrors);
                        continue;
                    }
                    //If one patient is missing the required information for export, then simply skip the patient. We do not want to popup a message,
                    //because it would be hard to get through the export if many patients were missing required information.
                    numSkipped++;
                    patientsSkipped += "\r\n" + patCur.LName + ", " + patCur.FName;
                    continue;
                }
                fileName = "";
                string lName = patCur.LName;
                for (int j = 0; j < lName.Length; j++)             //Strip all non-letters from FName
                {
                    if (Char.IsLetter(lName, j))
                    {
                        fileName += lName.Substring(j, 1);
                    }
                }
                fileName += "_";
                string fName = patCur.FName;
                for (int k = 0; k < fName.Length; k++)             //Strip all non-letters from LName
                {
                    if (Char.IsLetter(fName, k))
                    {
                        fileName += fName.Substring(k, 1);
                    }
                }
                fileName += "_" + patCur.PatNum;              //LName_FName_PatNum
                string ccd = EhrCCD.GeneratePatientExport(patCur);
                try {
                    File.WriteAllText(ODFileUtils.CombinePaths(folderPath, fileName + ".xml"), ccd);
                }
                catch {
                    MessageBox.Show("Error, Could not create xml file");
                    this.Cursor = Cursors.Default;
                    return;
                }
            }
            if (numSkipped == -1)               //Will be -1 if only one patient was selected, and it did not export correctly.
            {
                this.Cursor = Cursors.Default;
                return;                //Don't display "Exported" to the user because the CCD was not exported.
            }
            try {
                File.WriteAllText(ODFileUtils.CombinePaths(folderPath, "CCD.xsl"), FormEHR.GetEhrResource("CCD"));
            }
            catch {
                MessageBox.Show("Error, Could not create stylesheet file");
            }
            string strMsg = Lan.g(this, "Exported");

            if (numSkipped > 0)
            {
                strMsg += ". " + Lan.g(this, "Patients skipped due to missing information") + ": " + numSkipped + patientsSkipped;
                MsgBoxCopyPaste msgCP = new MsgBoxCopyPaste(strMsg);
                msgCP.Show();
            }
            else
            {
                MessageBox.Show(strMsg);
            }
            this.Cursor = Cursors.Default;
        }
Example #29
0
		private void FillGrid(){
			long selectedProvNum=0;
			if(gridMain.SelectedIndices.Length==1){
				selectedProvNum=PIn.Long(table.Rows[gridMain.SelectedIndices[0]]["ProvNum"].ToString());
			}
			int scroll=gridMain.ScrollValue;
			Cache.Refresh(InvalidType.Providers);
			long schoolClass=0;
			if(groupDentalSchools.Visible && comboClass.SelectedIndex>0){
				schoolClass=SchoolClasses.List[comboClass.SelectedIndex-1].SchoolClassNum;
			}
			bool isAlph=false;
			if(groupDentalSchools.Visible && checkAlphabetical.Checked){
				isAlph=true;
			}
			table=Providers.Refresh(schoolClass,isAlph);
			//fix orders
			bool doFix=false;
			if(groupDentalSchools.Visible) {
				if(checkAlphabetical.Checked) {
					doFix=false;
				}
				else if(comboClass.SelectedIndex==0) {
					doFix=false;
				}
				else{
					doFix=true;
				}
			}
			else {
				doFix=true;
			}
			if(doFix) {
				bool neededFixing=false;
				Provider prov;
				for(int i=0;i<table.Rows.Count;i++) {
					if(table.Rows[i]["ItemOrder"].ToString()!=i.ToString()) {
						prov=Providers.GetProv(PIn.Long(table.Rows[i]["ProvNum"].ToString()));
						prov.ItemOrder=i;
						Providers.Update(prov);
					}
				}
				if(neededFixing) {
					DataValid.SetInvalid(InvalidType.Providers);
					table=Providers.Refresh(schoolClass,isAlph);
				}
			}
			gridMain.BeginUpdate();
			gridMain.Columns.Clear();
			ODGridColumn col=new ODGridColumn(Lan.g("TableProviders","Abbrev"),90);
			gridMain.Columns.Add(col);
			col=new ODGridColumn(Lan.g("TableProviders","Last Name"),90);
			gridMain.Columns.Add(col);
			col=new ODGridColumn(Lan.g("TableProviders","First Name"),90);
			gridMain.Columns.Add(col);
			col=new ODGridColumn(Lan.g("TableProviders","User Name"),90);
			gridMain.Columns.Add(col);
			col=new ODGridColumn(Lan.g("TableProviders","Hidden"),50,HorizontalAlignment.Center);
			gridMain.Columns.Add(col);
			if(!PrefC.GetBool(PrefName.EasyHideDentalSchools)) {
				col=new ODGridColumn(Lan.g("TableProviders","Class"),100);
				gridMain.Columns.Add(col);
			}
			col=new ODGridColumn(Lan.g("TableProviders","Patients"),50,HorizontalAlignment.Center);
			gridMain.Columns.Add(col);
			gridMain.Rows.Clear();
			ODGridRow row;
			for(int i=0;i<table.Rows.Count;i++){
				row=new ODGridRow();
				row.Cells.Add(table.Rows[i]["Abbr"].ToString());
				row.Cells.Add(table.Rows[i]["LName"].ToString());
				row.Cells.Add(table.Rows[i]["FName"].ToString());
				row.Cells.Add(table.Rows[i]["UserName"].ToString());
				if(table.Rows[i]["IsHidden"].ToString()=="1"){
					row.Cells.Add("X");
				}
				else{
					row.Cells.Add("");
				}
				if(!PrefC.GetBool(PrefName.EasyHideDentalSchools)) {
					if(table.Rows[i]["GradYear"].ToString()!=""){
						row.Cells.Add(table.Rows[i]["GradYear"].ToString()+"-"+table.Rows[i]["Descript"].ToString());
					}
					else{
						row.Cells.Add("");
					}
				}
				row.Cells.Add(table.Rows[i]["PatCount"].ToString());
				//row.Tag
				gridMain.Rows.Add(row);
			}
			gridMain.EndUpdate();
			for(int i=0;i<table.Rows.Count;i++){
				if(table.Rows[i]["ProvNum"].ToString()==selectedProvNum.ToString()){
					gridMain.SetSelected(i,true);
					break;
				}
			}
			gridMain.ScrollValue=scroll;
		}
Example #30
0
        public static List <DefCatOptions> GetOptionsForDefCats(Array defCatVals)
        {
            List <DefCatOptions> listDefCatOptions = new List <DefCatOptions>();

            foreach (DefCat defCatCur in defCatVals)
            {
                if (defCatCur.GetDescription() == "NotUsed")
                {
                    continue;
                }
                if (defCatCur.GetDescription().Contains("HqOnly") && !PrefC.IsODHQ)
                {
                    continue;
                }
                DefCatOptions defCOption = new DefCatOptions(defCatCur);
                switch (defCatCur)
                {
                case DefCat.AccountColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Changes the color of text for different types of entries in Account Module");
                    break;

                case DefCat.AccountQuickCharge:
                    defCOption.CanDelete   = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Procedure Codes");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Account Proc Quick Add items.  Each entry can be a series of procedure codes separated by commas (e.g. D0180,D1101,D8220).  Used in the account module to quickly charge patients for items.");
                    break;

                case DefCat.AdjTypes:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "+, -, or dp");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Plus increases the patient balance.  Minus decreases it.  Dp means discount plan.  Not allowed to change value after creating new type since changes affect all patient accounts.");
                    break;

                case DefCat.AppointmentColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Changes colors of background in Appointments Module, and colors for completed appointments.");
                    break;

                case DefCat.ApptConfirmed:
                    defCOption.EnableColor = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Abbrev");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Color shows on each appointment if Appointment View is set to show ConfirmedColor.");
                    break;

                case DefCat.ApptProcsQuickAdd:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "ADA Code(s)");
                    if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These are the procedures that you can quickly add to the treatment plan from within the appointment editing window.  Multiple procedures may be separated by commas with no spaces. These definitions may be freely edited without affecting any patient records.");
                    }
                    else
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These are the procedures that you can quickly add to the treatment plan from within the appointment editing window.  They must not require a tooth number. Multiple procedures may be separated by commas with no spaces. These definitions may be freely edited without affecting any patient records.");
                    }
                    break;

                case DefCat.AutoDeposit:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Account Number");
                    break;

                case DefCat.AutoNoteCats:
                    defCOption.CanDelete     = true;
                    defCOption.CanHide       = false;
                    defCOption.EnableValue   = true;
                    defCOption.IsValueDefNum = true;
                    defCOption.ValueText     = Lans.g("FormDefinitions", "Parent Category");
                    defCOption.HelpText      = Lans.g("FormDefinitions", "Leave the Parent Category blank for categories at the root level. Assign a Parent Category to move a category within another. The order set here will only affect the order within the assigned Parent Category in the Auto Note list. For example, a category may be moved above its parent in this list, but it will still be within its Parent Category in the Auto Note list.");
                    break;

                case DefCat.BillingTypes:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "E, C, or CE");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "E=Email bill, C=Collection, CE=Collection Excluded.  It is recommended to use as few billing types as possible.  They can be useful when running reports to separate delinquent accounts, but can cause 'forgotten accounts' if used without good office procedures. Changes affect all patients.");
                    break;

                case DefCat.BlockoutTypes:
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Blockout types are used in the appointments module.");
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Flags");
                    break;

                case DefCat.ChartGraphicColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These colors will be used to graphically display treatments.");
                    }
                    else
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These colors will be used on the graphical tooth chart to draw restorations.");
                    }
                    break;

                case DefCat.ClaimCustomTracking:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = false;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Days Suppressed");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Some offices may set up claim tracking statuses such as 'review', 'hold', 'riskmanage', etc.") + "\r\n"
                                             + Lans.g("FormDefinitions", "Set the value of 'Days Suppressed' to the number of days the claim will be suppressed from the Outstanding Claims Report "
                                                      + "when the status is changed to the selected status.");
                    break;

                case DefCat.ClaimErrorCode:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = false;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Description");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Used to track error codes when entering claim custom statuses.");
                    break;

                case DefCat.ClaimPaymentTracking:
                    defCOption.ValueText = Lans.g("FormDefinitions", "Value");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "EOB adjudication method codes to be used for insurance payments.  Last entry cannot be hidden.");
                    break;

                case DefCat.ClaimPaymentGroups:
                    defCOption.ValueText = Lans.g("FormDefinitions", "Value");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "Used to group claim payments in the daily payments report.");
                    break;

                case DefCat.ClinicSpecialty:
                    defCOption.CanHide   = true;
                    defCOption.CanDelete = false;
                    defCOption.HelpText  = Lans.g("FormDefinitions", "You can add as many specialties as you want.  Changes affect all current records.");
                    break;

                case DefCat.CommLogTypes:
                    defCOption.EnableValue   = true;
                    defCOption.EnableColor   = true;
                    defCOption.DoShowNoColor = true;
                    string commItemTypes = string.Join(", ", Commlogs.GetCommItemTypes().Select(x => x.GetDescription(useShortVersionIfAvailable: true)));
                    defCOption.ValueText = Lans.g("FormDefinitions", "Usage");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "Changes affect all current commlog entries.  Optionally set Usage to one of the following: "
                                                  + commItemTypes + ". Only one of each. This helps automate new entries.");
                    break;

                case DefCat.ContactCategories:
                    defCOption.HelpText = Lans.g("FormDefinitions", "You can add as many categories as you want.  Changes affect all current contact records.");
                    break;

                case DefCat.Diagnosis:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "1 or 2 letter abbreviation");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "The diagnosis list is shown when entering a procedure.  Ones that are less used should go lower on the list.  The abbreviation is shown in the progress notes.  BE VERY CAREFUL.  Changes affect all patients.");
                    break;

                case DefCat.FeeColors:
                    defCOption.CanEditName = false;
                    defCOption.CanHide     = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "These are the colors associated to fee types.");
                    break;

                case DefCat.ImageCats:
                    defCOption.ValueText = Lans.g("FormDefinitions", "Usage");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "These are the categories that will be available in the image and chart modules.  If you hide a category, images in that category will be hidden, so only hide a category if you are certain it has never been used.  Multiple categories can be set to show in the Chart module, but only one category should be set for patient pictures, statements, and tooth charts. Selecting multiple categories for treatment plans will save the treatment plan in each category. Affects all patient records.");
                    break;

                case DefCat.InsurancePaymentType:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = false;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "N=Not selected for deposit");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "These are claim payment types for insurance payments attached to claims.");
                    break;

                case DefCat.InsuranceVerificationStatus:
                    defCOption.ValueText = Lans.g("FormDefinitions", "Usage");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "These are statuses for the insurance verification list.");
                    break;

                case DefCat.JobPriorities:
                    defCOption.CanDelete   = false;
                    defCOption.CanHide     = true;
                    defCOption.EnableValue = true;
                    defCOption.EnableColor = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Comma-delimited keywords");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "These are job priorities that determine how jobs are sorted in the Job Manager System.  Required values are: OnHold, Low, Normal, MediumHigh, High, Urgent, BugDefault, JobDefault, DocumentationDefault.");
                    break;

                case DefCat.LetterMergeCats:
                    defCOption.HelpText = Lans.g("FormDefinitions", "Categories for Letter Merge.  You can safely make any changes you want.");
                    break;

                case DefCat.MiscColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = "";
                    break;

                case DefCat.PaymentTypes:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "N=Not selected for deposit");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Types of payments that patients might make. Any changes will affect all patients.");
                    break;

                case DefCat.PayPlanCategories:
                    defCOption.HelpText = Lans.g("FormDefinitions", "Assign payment plans to different categories");
                    break;

                case DefCat.PaySplitUnearnedType:
                    defCOption.ValueText   = "Do Not Show on Account";
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Usually only used by offices that use accrual basis accounting instead of cash basis accounting. Any changes will affect all patients.");
                    defCOption.EnableValue = true;
                    break;

                case DefCat.ProcButtonCats:
                    defCOption.HelpText = Lans.g("FormDefinitions", "These are similar to the procedure code categories, but are only used for organizing and grouping the procedure buttons in the Chart module.");
                    break;

                case DefCat.ProcCodeCats:
                    defCOption.HelpText = Lans.g("FormDefinitions", "These are the categories for organizing procedure codes. They do not have to follow ADA categories.  There is no relationship to insurance categories which are setup in the Ins Categories section.  Does not affect any patient records.");
                    break;

                case DefCat.ProgNoteColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Changes color of text for different types of entries in the Chart Module Progress Notes.");
                    break;

                case DefCat.Prognosis:
                    //Nothing special. Might add HelpText later.
                    break;

                case DefCat.ProviderSpecialties:
                    defCOption.HelpText = Lans.g("FormDefinitions", "Provider specialties cannot be deleted.  Changes to provider specialties could affect e-claims.");
                    break;

                case DefCat.RecallUnschedStatus:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Abbreviation");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Recall/Unsched Status.  Abbreviation must be 7 characters or less.  Changes affect all patients.");
                    break;

                case DefCat.Regions:
                    defCOption.CanHide  = false;
                    defCOption.HelpText = Lans.g("FormDefinitions", "The region identifying the clinic it is assigned to.");
                    break;

                case DefCat.SupplyCats:
                    defCOption.CanDelete = true;
                    defCOption.CanHide   = false;
                    defCOption.HelpText  = Lans.g("FormDefinitions", "The categories for inventory supplies.");
                    break;

                case DefCat.TaskPriorities:
                    defCOption.EnableColor = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "D = Default, R = Reminder");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Priorities available for selection within the task edit window.  Task lists are sorted using the order of these priorities.  They can have any description and color.  At least one priority should be Default (D).  If more than one priority is flagged as the default, the last default in the list will be used.  If no default is set, the last priority will be used.  Use (R) to indicate the initial reminder task priority to use when creating reminder tasks.  Changes affect all tasks where the definition is used.");
                    break;

                case DefCat.TxPriorities:
                    defCOption.EnableColor            = true;
                    defCOption.EnableValue            = true;
                    defCOption.DoShowItemOrderInValue = true;
                    defCOption.ValueText = Lan.g(_lanThis, "Internal Priority");
                    defCOption.HelpText  = Lan.g(_lanThis, "Displayed order should match order of priority of treatment.  They are used in Treatment Plan and Chart "
                                                 + "modules. They can be simple numbers or descriptive abbreviations 7 letters or less.  Changes affect all procedures where the "
                                                 + "definition is used.  'Internal Priority' does not show, but is used for list order and for automated selection of which procedures "
                                                 + "are next in a planned appointment.");
                    break;

                case DefCat.WebSchedNewPatApptTypes:
                    defCOption.CanDelete = true;
                    defCOption.CanHide   = false;
                    defCOption.ValueText = Lans.g("FormDefinitions", "Appointment Type");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "Appointment types to be displayed in the Web Sched New Pat Appt web application.  These are selectable for the new patients and will be saved to the appointment note.");
                    break;

                case DefCat.CarrierGroupNames:
                    defCOption.CanHide  = true;
                    defCOption.HelpText = Lans.g("FormDefinitions", "These are group names for Carriers.");
                    break;

                case DefCat.TimeCardAdjTypes:
                    defCOption.CanEditName = true;
                    defCOption.CanHide     = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "These are PTO Adjustments Types used for tracking on employee time cards and ADP export.");
                    break;
                }
                listDefCatOptions.Add(defCOption);
            }
            return(listDefCatOptions);
        }