예제 #1
0
        private void FillGrid()
        {
            AppointmentRules.RefreshCache();
            _listAppointmentRules = AppointmentRules.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Description", 200);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Start Code", 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("End Code", 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Enabled", 50, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            UI.GridRow row;
            for (int i = 0; i < _listAppointmentRules.Count; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(_listAppointmentRules[i].RuleDesc);
                row.Cells.Add(_listAppointmentRules[i].CodeStart);
                row.Cells.Add(_listAppointmentRules[i].CodeEnd);
                if (_listAppointmentRules[i].IsEnabled)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
예제 #2
0
        private void FillGrid()
        {
            LanList     = Lans.GetListForCat(ClassType);
            ListForType = LanguageForeigns.GetListForType(ClassType);
            LanguageForeigns.RefreshCache();
            gridLan.BeginUpdate();
            gridLan.ListGridColumns.Clear();
            GridColumn column = new GridColumn("English", 220);

            gridLan.ListGridColumns.Add(column);
            column = new GridColumn(CultureInfo.CurrentCulture.DisplayName, 220);
            gridLan.ListGridColumns.Add(column);
            column = new GridColumn("Other " + CultureInfo.CurrentCulture.Parent.DisplayName + " Translation", 220);
            gridLan.ListGridColumns.Add(column);
            column = new GridColumn(CultureInfo.CurrentCulture.DisplayName + " Comments", 220);
            gridLan.ListGridColumns.Add(column);
            //gridLan.Columns[1].Heading=;
            //gridLan.Columns[2].Heading="Other "+CultureInfo.CurrentCulture.Parent.DisplayName+" Translation";
            //gridLan.Columns[3].Heading=CultureInfo.CurrentCulture.DisplayName+" Comments";
            gridLan.ListGridRows.Clear();
            UI.GridRow      row;
            LanguageForeign lanForeign;
            LanguageForeign lanForeignOther;

            for (int i = 0; i < LanList.Length; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(LanList[i].English);
                lanForeign      = LanguageForeigns.GetForCulture(ListForType, LanList[i].English, CultureInfo.CurrentCulture.Name);
                lanForeignOther = LanguageForeigns.GetOther(ListForType, LanList[i].English, CultureInfo.CurrentCulture.Name);
                if (lanForeign == null)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(lanForeign.Translation);
                }
                if (lanForeignOther == null)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(lanForeignOther.Translation);
                }
                if (lanForeign == null)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(lanForeign.Comments);
                }
                gridLan.ListGridRows.Add(row);
            }
            gridLan.EndUpdate();
        }
예제 #3
0
        private void FillGrid()
        {
            if (!PrefC.HasClinicsEnabled)
            {
                if (IsSelectionMode)
                {
                    DList = Deposits.GetUnattached();
                }
                else
                {
                    DList = Deposits.Refresh();
                }
            }
            else
            {
                //GetForClinics uses an empty list to indicate "all", which is a loophole if user doesn't select an item.  So:
                if (comboClinics.ListSelectedClinicNums.Count == 0)
                {
                    DList = Deposits.GetForClinics(new List <long>()
                    {
                        Clinics.ClinicNum
                    }, IsSelectionMode);                                                                                   //restrict to current clinic
                }
                else
                {
                    DList = Deposits.GetForClinics(comboClinics.ListSelectedClinicNums, IsSelectionMode);
                }
            }
            grid.BeginUpdate();
            grid.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableDepositSlips", "Date"), 80);

            grid.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableDepositSlips", "Amount"), 90, HorizontalAlignment.Right);
            grid.ListGridColumns.Add(col);
            if (PrefC.HasClinicsEnabled)
            {
                col = new GridColumn(Lan.g("TableDepositSlips", "Clinic"), 150);
                grid.ListGridColumns.Add(col);
            }
            grid.ListGridRows.Clear();
            OpenDental.UI.GridRow row;
            for (int i = 0; i < DList.Length; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(DList[i].DateDeposit.ToShortDateString());
                row.Cells.Add(DList[i].Amount.ToString("F"));
                if (PrefC.HasClinicsEnabled)
                {
                    row.Cells.Add(" " + DList[i].ClinicAbbr);                  //padding left with space to add separation between amount and clinic abbr
                }
                grid.ListGridRows.Add(row);
            }
            grid.EndUpdate();
            grid.ScrollToEnd();
        }
예제 #4
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();
        }
예제 #5
0
 private void butNotEPCS_Click(object sender, EventArgs e)
 {
     if (gridProviders.SelectedIndices.Length == 0)
     {
         MsgBox.Show(this, "At least one provider must be selected.");
         return;
     }
     gridProviders.BeginUpdate();
     for (int i = 0; i < gridProviders.SelectedIndices.Length; i++)
     {
         int        index = gridProviders.SelectedIndices[i];
         UI.GridRow row   = gridProviders.ListGridRows[index];
         row.Cells[3].Text = "";
         ProviderErx provErx = (ProviderErx)row.Tag;
         provErx.IsEpcs = false;
     }
     gridProviders.EndUpdate();
 }
예제 #6
0
 private void FillGridEras()
 {
     gridEras.BeginUpdate();
     gridEras.ListGridColumns.Clear();
     gridEras.ListGridColumns.Add(new UI.GridColumn(Lan.g(this, "Carrier"), 200));
     gridEras.ListGridColumns.Add(new UI.GridColumn(Lan.g(this, "Date Rec'd"), 70, HorizontalAlignment.Center));
     gridEras.ListGridColumns.Add(new UI.GridColumn(Lan.g(this, "Note"), 0));
     gridEras.ListGridRows.Clear();
     for (int i = 0; i < _listEtrans.Count; i++)
     {
         UI.GridRow row = new UI.GridRow();
         row.Cells.Add(_listEtrans[i].CarrierNameRaw);
         row.Cells.Add(_listEtrans[i].DateTimeTrans.ToShortDateString());
         row.Cells.Add(_listEtrans[i].Note);
         gridEras.ListGridRows.Add(row);
     }
     gridEras.EndUpdate();
 }
예제 #7
0
 private void FillObservations()
 {
     gridObservations.BeginUpdate();
     gridObservations.ListGridColumns.Clear();
     gridObservations.ListGridColumns.Add(new UI.GridColumn("Question", 150));
     gridObservations.ListGridColumns.Add(new UI.GridColumn("Value", 0));
     gridObservations.EndUpdate();
     gridObservations.BeginUpdate();
     gridObservations.ListGridRows.Clear();
     for (int i = 0; i < _listVaccineObservations.Count; i++)
     {
         VaccineObs vaccineObs = _listVaccineObservations[i];
         UI.GridRow row        = new UI.GridRow();
         row.Tag = vaccineObs;
         row.Cells.Add(new UI.GridCell(vaccineObs.IdentifyingCode.ToString()));
         row.Cells.Add(new UI.GridCell(vaccineObs.ValReported));
         gridObservations.ListGridRows.Add(row);
     }
     if (_listVaccineObservationGroups == null)
     {
         _listVaccineObservationGroups = new List <VaccineObs>();
         for (int i = 0; i < _listVaccineObservations.Count; i++)
         {
             VaccineObs vaccineObs = _listVaccineObservations[i];
             if (vaccineObs.VaccineObsNumGroup == 0 || vaccineObs.VaccineObsNumGroup == vaccineObs.VaccineObsNum)
             {
                 _listVaccineObservationGroups.Add(vaccineObs);
             }
             else
             {
                 for (int j = 0; j < _listVaccineObservations.Count; j++)
                 {
                     if (j != i && _listVaccineObservations[j].VaccineObsNum == _listVaccineObservations[i].VaccineObsNumGroup)
                     {
                         _listVaccineObservationGroups.Add(_listVaccineObservations[j]);
                         break;
                     }
                 }
             }
         }
     }
     gridObservations.EndUpdate();
 }
예제 #8
0
        private void FillGridTabNames()
        {
            gridTabNames.BeginUpdate();
            gridTabNames.ListGridRows.Clear();
            gridTabNames.ListGridColumns.Clear();
            int isHiddenWidth = 100;
            int tabNameWidth  = gridTabNames.Width - 10 - isHiddenWidth;     //10 for scrollbar.

            gridTabNames.ListGridColumns.Add(new UI.GridColumn("Tab Name", tabNameWidth, HorizontalAlignment.Left));
            gridTabNames.ListGridColumns.Add(new UI.GridColumn("Is Hidden", isHiddenWidth, HorizontalAlignment.Center));
            foreach (OrthoChartTab orthoChartTab in _listNewOrthoChartTabs)
            {
                UI.GridRow row = new UI.GridRow();
                row.Tag = orthoChartTab;
                row.Cells.Add(orthoChartTab.TabName);
                row.Cells.Add(orthoChartTab.IsHidden?"X":"");
                gridTabNames.ListGridRows.Add(row);
            }
            gridTabNames.EndUpdate();
        }
예제 #9
0
        ///<summary>Does not refresh the cached list.  Make sure any updates to _listPayPeriods are done before calling this method.</summary>
        private void FillGrid()
        {
            PayPeriods.RefreshCache();
            _listPayPeriods = PayPeriods.GetDeepCopy().OrderBy(x => x.DateStart).ToList();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Start Date", 80);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("End Date", 80);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Paycheck Date", 100);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            UI.GridRow row;
            foreach (PayPeriod payPeriodCur in _listPayPeriods)
            {
                if (checkHideOlder.Checked && payPeriodCur.DateStart < DateTimeOD.Today.AddMonths(-6))
                {
                    continue;
                }
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(payPeriodCur.DateStart.ToShortDateString());
                row.Cells.Add(payPeriodCur.DateStop.ToShortDateString());
                if (payPeriodCur.DatePaycheck.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(payPeriodCur.DatePaycheck.ToShortDateString());
                }
                row.Tag = payPeriodCur;
                if (payPeriodCur.DateStart <= DateTimeOD.Today && payPeriodCur.DateStop >= DateTimeOD.Today)
                {
                    row.ColorBackG = Color.LightCyan;
                }
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
예제 #10
0
 private void butNotIdpd_Click(object sender, EventArgs e)
 {
     if (gridProviders.SelectedIndices.Length == 0)
     {
         MsgBox.Show(this, "At least one provider must be selected.");
         return;
     }
     if (!MsgBox.Show(this, true, "Only use this button if the selected providers were set to IDP'd accidentally.  Continue?"))
     {
         return;
     }
     gridProviders.BeginUpdate();
     for (int i = 0; i < gridProviders.SelectedIndices.Length; i++)
     {
         int        index = gridProviders.SelectedIndices[i];
         UI.GridRow row   = gridProviders.ListGridRows[index];
         row.Cells[2].Text = "";
         ProviderErx provErx = (ProviderErx)row.Tag;
         provErx.IsIdentifyProofed = false;
     }
     gridProviders.EndUpdate();
 }
예제 #11
0
        private void FillGrid()
        {
            RList = Reconciles.GetList(AccountNum);
            grid.BeginUpdate();
            grid.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TableReconciles", "Date"), 80);

            grid.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableReconciles", "Ending Bal"), 100, HorizontalAlignment.Right);
            grid.ListGridColumns.Add(col);
            grid.ListGridRows.Clear();
            OpenDental.UI.GridRow row;
            for (int i = 0; i < RList.Length; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(RList[i].DateReconcile.ToShortDateString());
                row.Cells.Add(RList[i].EndingBal.ToString("F"));
                grid.ListGridRows.Add(row);
            }
            grid.EndUpdate();
            grid.ScrollToEnd();
        }
예제 #12
0
 ///<summary>ListRows and ListClaimsPaid must be 1:1 and in the same order.</summary>
 private void SetClaimDetailRows(List <GridRow> listRows, List <Hx835_Claim> listClaimsPaid, bool isRefreshNeeded = false)
 {
     if (isRefreshNeeded)
     {
         RefreshFromDb();
     }
     for (int i = 0; i < listRows.Count; i++)
     {
         UI.GridRow  row       = listRows[i];
         Hx835_Claim claimPaid = listClaimsPaid[i];
         row.Tag = claimPaid;
         row.Cells.Clear();
         string claimStatus = "";
         if (claimPaid.IsProcessed(_listClaimProcs, _listAttaches))
         {
             claimStatus = "X";
         }
         else if (claimPaid.IsAttachedToClaim && claimPaid.ClaimNum == 0)
         {
             claimStatus = "N/A";                  //User detached claim manually.
         }
         row.Cells.Add(claimStatus);
         row.Cells.Add(new UI.GridCell(claimPaid.PatientName.ToString()));                //Patient
         string strDateService = claimPaid.DateServiceStart.ToShortDateString();
         if (claimPaid.DateServiceEnd > claimPaid.DateServiceStart)
         {
             strDateService += " to " + claimPaid.DateServiceEnd.ToShortDateString();
         }
         row.Cells.Add(new UI.GridCell(strDateService));                             //DateService
         row.Cells.Add(new UI.GridCell(claimPaid.ClaimTrackingNumber));              //Claim Identfier
         row.Cells.Add(new UI.GridCell(claimPaid.PayerControlNumber));               //PayorControlNum
         row.Cells.Add(new UI.GridCell(claimPaid.StatusCodeDescript));               //Status
         row.Cells.Add(new UI.GridCell(claimPaid.ClaimFee.ToString("f2")));          //ClaimFee
         row.Cells.Add(new UI.GridCell(claimPaid.InsPaid.ToString("f2")));           //InsPaid
         row.Cells.Add(new UI.GridCell(claimPaid.PatientPortionAmt.ToString("f2"))); //PatPort
         row.Cells.Add(new UI.GridCell(claimPaid.PatientDeductAmt.ToString("f2")));  //Deduct
         row.Cells.Add(new UI.GridCell(claimPaid.WriteoffAmt.ToString("f2")));       //Writeoff
     }
 }
예제 #13
0
 private void butDisable_Click(object sender, EventArgs e)
 {
     if (gridProviders.SelectedIndices.Length == 0)
     {
         MsgBox.Show(this, "At least one provider must be selected.");
         return;
     }
     if (!MsgBox.Show(this, true, "Only use this button if the selected providers were Enabled accidentally or if the provider has canceled eRx.  "
                      + "Continue?"))
     {
         return;
     }
     gridProviders.BeginUpdate();
     for (int i = 0; i < gridProviders.SelectedIndices.Length; i++)
     {
         int        index = gridProviders.SelectedIndices[i];
         UI.GridRow row   = gridProviders.ListGridRows[index];
         row.Cells[1].Text = "";
         ProviderErx provErx = (ProviderErx)row.Tag;
         provErx.IsEnabled = ErxStatus.Disabled;
     }
     gridProviders.EndUpdate();
 }
        ///<summary>Gets all claims for the patient selected.  Fills gridClaims and tags each row with its corrisponding claim object.</summary>
        private void FillGridClaims()
        {
            int  sortByColIdx = gridClaims.SortedByColumnIdx;           //Keep previous sorting
            bool isSortAsc    = gridClaims.SortedIsAscending;

            if (sortByColIdx == -1)
            {
                sortByColIdx = 0;
                isSortAsc    = false;
            }
            gridClaims.BeginUpdate();
            gridClaims.ListGridRows.Clear();
            gridClaims.ListGridColumns.Clear();
            gridClaims.ListGridColumns.Add(new UI.GridColumn("Date Service", 100, HorizontalAlignment.Center)
            {
                SortingStrategy = UI.GridSortingStrategy.DateParse
            });
            gridClaims.ListGridColumns.Add(new UI.GridColumn("Carrier", 240, HorizontalAlignment.Center)
            {
                SortingStrategy = UI.GridSortingStrategy.StringCompare
            });
            gridClaims.ListGridColumns.Add(new UI.GridColumn("Status", 120, HorizontalAlignment.Center)
            {
                SortingStrategy = UI.GridSortingStrategy.StringCompare
            });
            if (PrefC.HasClinicsEnabled)             //Using clinics
            {
                gridClaims.ListGridColumns.Add(new UI.GridColumn("Clinic", 190, HorizontalAlignment.Left)
                {
                    SortingStrategy = UI.GridSortingStrategy.StringCompare
                });
            }
            gridClaims.ListGridColumns.Add(new UI.GridColumn("ClaimFee", 70, HorizontalAlignment.Right)
            {
                SortingStrategy = UI.GridSortingStrategy.AmountParse
            });
            List <Claim> listClaims = Claims.Refresh(_patNum);

            for (int i = 0; i < listClaims.Count; i++)
            {
                UI.GridRow row = new UI.GridRow();
                row.Tag = listClaims[i];
                row.Cells.Add(listClaims[i].DateService.ToShortDateString());                           //DOS
                row.Cells.Add(Carriers.GetName(InsPlans.RefreshOne(listClaims[i].PlanNum).CarrierNum)); //Carrier
                row.Cells.Add(Claims.GetClaimStatusString(listClaims[i].ClaimStatus));                  //Status
                if (PrefC.HasClinicsEnabled)                                                            //Using clinics
                {
                    Clinic clinic = Clinics.GetClinic(listClaims[i].ClinicNum);
                    if (clinic == null)
                    {
                        row.Cells.Add("");                        //Clinic
                    }
                    else
                    {
                        row.Cells.Add(clinic.Description);                        //Clinic
                    }
                }
                row.Cells.Add(listClaims[i].ClaimFee.ToString("f"));                //Claimfee
                gridClaims.ListGridRows.Add(row);
            }
            gridClaims.EndUpdate();
            gridClaims.SortForced(sortByColIdx, isSortAsc);
        }
예제 #15
0
        private void FillGrid()
        {
            List <long> listSelectedOpNums = gridMain.SelectedTags <Operatory>().Select(x => x.OperatoryNum).ToList();
            int         scrollValueCur     = gridMain.ScrollValue;

            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            int opNameWidth = 180;
            int clinicWidth = 85;

            if (!PrefC.HasClinicsEnabled)
            {
                //Clinics are hidden so add the width of the clinic column to the Op Name column because the clinic column will not show.
                opNameWidth += clinicWidth;
            }
            GridColumn col = new GridColumn(Lan.g("TableOperatories", "Op Name"), opNameWidth);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableOperatories", "Abbrev"), 70);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableOperatories", "IsHidden"), 64, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            if (PrefC.HasClinicsEnabled)
            {
                col = new GridColumn(Lan.g("TableOperatories", "Clinic"), clinicWidth);
                gridMain.ListGridColumns.Add(col);
            }
            col = new GridColumn(Lan.g("TableOperatories", "Provider"), 70);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableOperatories", "Hygienist"), 70);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableOperatories", "IsHygiene"), 64, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableOperatories", "IsWebSched"), 74, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableOperatories", "IsNewPat"), 0, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            UI.GridRow row;
            for (int i = 0; i < _listOps.Count; i++)
            {
                if (PrefC.HasClinicsEnabled &&
                    !comboClinic.IsAllSelected &&
                    _listOps[i].ClinicNum != comboClinic.SelectedClinicNum)
                {
                    continue;
                }
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(_listOps[i].OpName);
                row.Cells.Add(_listOps[i].Abbrev);
                if (_listOps[i].IsHidden)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                if (PrefC.HasClinicsEnabled)
                {
                    row.Cells.Add(Clinics.GetAbbr(_listOps[i].ClinicNum));
                }
                row.Cells.Add(Providers.GetAbbr(_listOps[i].ProvDentist));
                row.Cells.Add(Providers.GetAbbr(_listOps[i].ProvHygienist));
                if (_listOps[i].IsHygiene)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(_listOps[i].IsWebSched?"X":"");
                row.Cells.Add((_listOps[i].ListWSNPAOperatoryDefNums != null && _listOps[i].ListWSNPAOperatoryDefNums.Count > 0) ? "X" : "");
                row.Tag = _listOps[i];
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            for (int i = 0; i < gridMain.ListGridRows.Count; i++)
            {
                Operatory op = (Operatory)gridMain.ListGridRows[i].Tag;
                if (op.OperatoryNum.In(listSelectedOpNums))
                {
                    gridMain.SetSelected(i, true);
                }
            }
            gridMain.ScrollValue = scrollValueCur;
        }
예제 #16
0
        private void Load834_Unsafe()
        {
            Cursor = Cursors.WaitCursor;
            ShowStatus("Loading...");
            Application.DoEvents();
            const int previewLimitCount = 40;
            int       selectedIndex     = -1;

            _x834selected = null;
            for (int i = 0; i < gridInsPlanFiles.ListGridRows.Count; i++)
            {
                UI.GridRow row = gridInsPlanFiles.ListGridRows[i];
                if (i < previewLimitCount)
                {
                    gridInsPlanFiles.BeginUpdate();
                }
                string filePath = (string)row.Tag;
                ShowStatus(Lan.g(this, "Parsing file") + " " + Path.GetFileName(filePath));
                string    messageText = File.ReadAllText(filePath);
                X12object xobj        = X12object.ToX12object(messageText);
                if (xobj == null)
                {
                    row.Cells[_colErrorIndex].Text = "Is not in X12 format.";
                    continue;
                }
                try {
                    if (!X834.Is834(xobj))
                    {
                        row.Cells[_colErrorIndex].Text = "Is in X12 format, but is not an 834 document.";
                        continue;
                    }
                    xobj.FilePath = filePath;
                    row.Cells[_colDateIndex].Text = xobj.DateInterchange.ToString();
                    int memberCount = xobj.GetSegmentCountById("INS");
                    int planCount   = xobj.GetSegmentCountById("HD");
                    row.Cells[_colPatCountIndex].Text  = memberCount.ToString();
                    row.Cells[_colPlanCountIndex].Text = planCount.ToString();
                    row.Cells[_colErrorIndex].Text     = "";
                    if (_x834selected == null || _x834selected.DateInterchange > xobj.DateInterchange)
                    {
                        selectedIndex = i;
                        _x834selected = xobj;
                    }
                }
                catch (ApplicationException aex) {
                    row.Cells[_colErrorIndex].Text = aex.Message;
                }
                catch (Exception ex) {
                    row.Cells[_colErrorIndex].Text = ex.ToString();
                }
                if (i < previewLimitCount)
                {
                    gridInsPlanFiles.EndUpdate();                    //Also invalidates grid.  Update required in case there was large error text.
                    Application.DoEvents();
                }
            }
            //These 834 files are large and take a lot of memory when parsed into objects.
            //Run garbage collection to prevent OD from taking up too much memory at one time.
            GC.Collect();
            gridInsPlanFiles.BeginUpdate();
            if (selectedIndex >= 0)
            {
                gridInsPlanFiles.ListGridRows[selectedIndex].ColorBackG = Color.LightYellow;
            }
            gridInsPlanFiles.EndUpdate();            //Also invalidates grid.  Update required in case there was large error text.
            ShowStatus("");
            Cursor = Cursors.Default;
            Application.DoEvents();
        }
예제 #17
0
        private void FillEmps()
        {
            gridEmp.BeginUpdate();
            gridEmp.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn(Lan.g("TableEmpClock", "Ext"), 25);
            gridEmp.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableEmpClock", "Employee"), 60);
            gridEmp.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableEmpClock", "Status"), 80);
            gridEmp.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableEmpClock", "Phone"), 50);
            gridEmp.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableEmpClock", "InOut"), 35);
            gridEmp.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableEmpClock", "Customer"), 90);
            gridEmp.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TableEmpClock", "Time"), 70);
            gridEmp.ListGridColumns.Add(col);
            gridEmp.ListGridRows.Clear();
            UI.GridRow row;
            PhoneList = Phones.GetPhoneList();
            DateTime dateTimeStart;
            TimeSpan span;
            DateTime timeOfDay;            //because TimeSpan does not have good formatting.

            for (int i = 0; i < PhoneList.Count; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(PhoneList[i].Extension.ToString());
                row.Cells.Add(PhoneList[i].EmployeeName);
                if (PhoneList[i].ClockStatus == ClockStatusEnum.None)
                {
                    row.Cells.Add("");
                }
                else if (!PrefC.GetBool(PrefName.ClockEventAllowBreak) && PhoneList[i].ClockStatus == ClockStatusEnum.Lunch)
                {
                    row.Cells.Add(ClockStatusEnum.Break.GetDescription());                    //Breaks turned off, Lunch is now "Break", but maintains Lunch functionality.
                }
                else
                {
                    row.Cells.Add(PhoneList[i].ClockStatus.ToString());
                }
                row.Cells.Add(PhoneList[i].Description);
                row.Cells.Add(PhoneList[i].InOrOut);
                row.Cells.Add(PhoneList[i].CustomerNumber);
                dateTimeStart = PhoneList[i].DateTimeStart;
                if (dateTimeStart.Date == DateTime.Today)
                {
                    span      = DateTime.Now - dateTimeStart + timeDelta;
                    timeOfDay = DateTime.Today + span;
                    row.Cells.Add(timeOfDay.ToString("H:mm:ss"));
                }
                else
                {
                    row.Cells.Add("");
                }
                row.ColorBackG = PhoneList[i].ColorBar;
                row.ColorText  = PhoneList[i].ColorText;
                gridEmp.ListGridRows.Add(row);
            }
            gridEmp.EndUpdate();
            gridEmp.SetSelected(false);
        }
예제 #18
0
        ///<summary>The healthCoverage variable can be null.</summary>
        private void FillGridRow(UI.GridRow row, Hx834_Member member, Hx834_HealthCoverage healthCoverage)
        {
            row.Cells.Clear();
            if (healthCoverage == null)
            {
                row.Tag = member;
            }
            else
            {
                row.Tag = healthCoverage;
                member  = healthCoverage.Member;
            }
            row.Cells.Add(member.Pat.GetNameLF());            //Name
            if (member.Pat.Birthdate.Year > 1880)
            {
                row.Cells.Add(member.Pat.Birthdate.ToShortDateString());                //Birthdate
            }
            else
            {
                row.Cells.Add("");                //Birthdate
            }
            row.Cells.Add(member.Pat.SSN);        //SSN
            List <Patient> listPatientMatches = Patients.GetPatientsByNameAndBirthday(member.Pat, _listPatients);

            if (member.Pat.PatNum == 0 && listPatientMatches.Count == 1)
            {
                member.Pat.PatNum = listPatientMatches[0].PatNum;
            }
            if (member.Pat.PatNum == 0 && listPatientMatches.Count == 0)
            {
                row.Cells.Add("");                //PatNum
            }
            else if (member.Pat.PatNum == 0 && listPatientMatches.Count > 1)
            {
                row.Cells.Add("Multiple");                   //PatNum
            }
            else                                             //Either the patient was matched perfectly or the user chose the correct patient already.
            {
                row.Cells.Add(member.Pat.PatNum.ToString()); //PatNum
            }
            if (healthCoverage != null && healthCoverage.DateEffective.Year > 1880)
            {
                row.Cells.Add(healthCoverage.DateEffective.ToShortDateString());                //Date Begin
            }
            else
            {
                row.Cells.Add("");                //Date Begin
            }
            if (healthCoverage != null && healthCoverage.DateTerm.Year > 1880)
            {
                row.Cells.Add(healthCoverage.DateTerm.ToShortDateString());                //Date Term
            }
            else
            {
                row.Cells.Add("");                      //Date Term
            }
            row.Cells.Add(member.PlanRelat.ToString()); //Relation
            row.Cells.Add(member.SubscriberId);         //SubscriberID
            row.Cells.Add(member.GroupNum);             //GroupNum
            row.Cells.Add(member.Tran.Payer.Name);      //Payer
        }
예제 #19
0
        private void Load834_Unsafe()
        {
            Cursor = Cursors.WaitCursor;
            ShowStatus("Loading patient information");
            const int previewLimitCount = 40;

            gridInsPlans.BeginUpdate();
            gridInsPlans.ListGridRows.Clear();
            gridInsPlans.EndUpdate();
            Application.DoEvents();
            if (_listPatients == null)
            {
                _listPatients = Patients.GetAllPatients();              //Testing this on an average sized database took about 1 second to run on a dev machine.
                _listPatients.Sort();
            }
            int rowCount = 0;

            for (int i = 0; i < _x834.ListTransactions.Count; i++)
            {
                Hx834_Tran tran = _x834.ListTransactions[i];
                for (int k = 0; k < tran.ListMembers.Count; k++)
                {
                    rowCount++;
                }
            }
            for (int i = 0; i < _x834.ListTransactions.Count; i++)
            {
                Hx834_Tran tran = _x834.ListTransactions[i];
                for (int j = 0; j < tran.ListMembers.Count; j++)
                {
                    Hx834_Member member = tran.ListMembers[j];
                    ShowStatus("Loading " + (gridInsPlans.ListGridRows.Count + 1).ToString().PadLeft(6) + "/" + rowCount.ToString().PadLeft(6)
                               + "  Patient " + member.Pat.GetNameLF());
                    if (gridInsPlans.ListGridRows.Count < previewLimitCount)
                    {
                        gridInsPlans.BeginUpdate();
                    }
                    if (member.ListHealthCoverage.Count == 0)
                    {
                        UI.GridRow row = new UI.GridRow();
                        gridInsPlans.ListGridRows.Add(row);
                        FillGridRow(row, member, null);
                    }
                    else                      //There is at least one insurance plan.
                    {
                        for (int a = 0; a < member.ListHealthCoverage.Count; a++)
                        {
                            Hx834_HealthCoverage healthCoverage = member.ListHealthCoverage[a];
                            UI.GridRow           row            = new UI.GridRow();
                            gridInsPlans.ListGridRows.Add(row);
                            FillGridRow(row, null, healthCoverage);
                        }
                    }
                    if (gridInsPlans.ListGridRows.Count < previewLimitCount)
                    {
                        gridInsPlans.EndUpdate();                        //Also invalidates grid.
                        Application.DoEvents();
                    }
                }
            }
            gridInsPlans.BeginUpdate();
            gridInsPlans.SortForced(_sortedByColumnIdx, _isSortAscending);
            gridInsPlans.EndUpdate();            //Also invalidates grid.
            ShowStatus("");
            Cursor = Cursors.Default;
            Application.DoEvents();
        }
예제 #20
0
        private void FillGridMain()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            gridMain.ListGridColumns.Add(new UI.GridColumn("EnterBy", 50, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new UI.GridColumn("Claim", 0, HorizontalAlignment.Left));          //Dynamic width
            gridMain.ListGridColumns.Add(new UI.GridColumn("Date", 66, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new UI.GridColumn("Code", 40, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new UI.GridColumn("CodeBill", 56, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new UI.GridColumn("Billed", 56, HorizontalAlignment.Right));
            gridMain.ListGridColumns.Add(new UI.GridColumn("PatResp", 48, HorizontalAlignment.Right));
            gridMain.ListGridColumns.Add(new UI.GridColumn("Allowed", 56, HorizontalAlignment.Right));
            gridMain.ListGridColumns.Add(new UI.GridColumn("InsPay", 56, HorizontalAlignment.Right));
            gridMain.ListGridRows.Clear();
            List <Hx835_Claim> listClaims;

            if (_x835 != null)
            {
                listClaims = _x835.ListClaimsPaid;
            }
            else
            {
                listClaims = new List <Hx835_Claim>()
                {
                    _claimPaid
                };
            }
            for (int i = 0; i < listClaims.Count; i++)
            {
                Hx835_Claim claimPaid = listClaims[i];
                UI.GridRow  rowClaim  = new UI.GridRow();
                //If there is no procedure detail, then the user will need to enter by total, because they will not know the procedure amounts paid.
                if (claimPaid.ListProcs.Count == 0)
                {
                    rowClaim.Cells.Add(new UI.GridCell("Total"));                    //EnterBy
                }
                //If there is procedure detail, and there are also claim level adjustments, then the user will need to enter the procedure amounts by procedure and the claim adjustment by total.
                else if (claimPaid.ClaimAdjustmentTotal != 0)
                {
                    rowClaim.Cells.Add(new UI.GridCell("Proc &\r\nTotal"));                    //EnterBy
                }
                //If there is procedure detail, and there are no claim level adjustments, the user will need to enter the payments by procedure only.
                else
                {
                    rowClaim.Cells.Add(new UI.GridCell("Proc"));                    //EnterBy
                }
                string strClaim = "Patient: " + claimPaid.PatientName;
                if (claimPaid.SubscriberName != claimPaid.PatientName)
                {
                    strClaim += "\r\nSubscriber: " + claimPaid.SubscriberName;
                }
                if (claimPaid.ClaimTrackingNumber != "")
                {
                    strClaim += "\r\nClaim Identifier: " + claimPaid.ClaimTrackingNumber;
                }
                if (claimPaid.PayerControlNumber != "")
                {
                    strClaim += "\r\nPayer Control Number: " + claimPaid.PayerControlNumber;
                }
                if (claimPaid.ListProcs.Count > 0 && claimPaid.ClaimAdjustmentTotal != 0)
                {
                    //If there is no procedure detail, then the user will need to enter the claim payment by total.  In this case, the user only cares about the InsPaid for the entire claim.  Showing the adjustments would cause user confusion.
                    //If there is procedure detail, then we need to show the claim adjustment total, because the user will need to enter this amount by total in addition to any procedure amounts entered.
                    strClaim += "\r\nClaim Adjustments: " + claimPaid.ClaimAdjustmentTotal.ToString("f2");
                }
                rowClaim.Cells.Add(new UI.GridCell(strClaim));                //Claim
                string strDateClaim = claimPaid.DateServiceStart.ToShortDateString();
                if (claimPaid.DateServiceEnd.Year > 1880)
                {
                    strDateClaim += " to \r\n" + claimPaid.DateServiceEnd.ToShortDateString();
                }
                rowClaim.Cells.Add(new UI.GridCell(strDateClaim));                            //Date
                rowClaim.Cells.Add(new UI.GridCell(""));                                      //Code
                rowClaim.Cells.Add(new UI.GridCell(""));                                      //CodeBilled
                rowClaim.Cells.Add(new UI.GridCell(claimPaid.ClaimFee.ToString("f2")));       //Billed
                rowClaim.Cells.Add(new UI.GridCell(claimPaid.PatientRespAmt.ToString("f2"))); //PatResp
                rowClaim.Cells.Add(new UI.GridCell(""));                                      //Allowed
                rowClaim.Cells.Add(new UI.GridCell(claimPaid.InsPaid.ToString("f2")));        //InsPay
                gridMain.ListGridRows.Add(rowClaim);
                for (int j = 0; j < claimPaid.ListProcs.Count; j++)
                {
                    Hx835_Proc proc    = claimPaid.ListProcs[j];
                    UI.GridRow rowProc = new UI.GridRow();
                    rowProc.Cells.Add(new UI.GridCell(""));                    //EnterBy
                    rowProc.Cells.Add(new UI.GridCell(""));                    //Claim
                    string strDateProc = proc.DateServiceStart.ToShortDateString();
                    if (proc.DateServiceEnd.Year > 1880)
                    {
                        strDateProc += " to \r\n" + proc.DateServiceEnd.ToShortDateString();
                    }
                    rowProc.Cells.Add(new UI.GridCell(strDateProc));                      //Date
                    rowProc.Cells.Add(new UI.GridCell(proc.ProcCodeAdjudicated));         //Code
                    rowProc.Cells.Add(new UI.GridCell(proc.ProcCodeBilled));              //CodeBilled
                    rowProc.Cells.Add(new UI.GridCell(proc.ProcFee.ToString("f2")));      //Billed
                    rowProc.Cells.Add(new UI.GridCell(proc.PatRespTotal.ToString("f2"))); //PatResp
                    rowProc.Cells.Add(new UI.GridCell(proc.AllowedAmt.ToString("f2")));   //Allowed
                    rowProc.Cells.Add(new UI.GridCell(proc.InsPaid.ToString("f2")));      //InsPay
                    gridMain.ListGridRows.Add(rowProc);
                }
            }
            gridMain.EndUpdate();
        }
예제 #21
0
        private void FillGridObservations()
        {
            gridObservations.BeginUpdate();
            gridObservations.ListGridColumns.Clear();
            gridObservations.ListGridColumns.Add(new UI.GridColumn("Observation", 200));   //0
            gridObservations.ListGridColumns.Add(new UI.GridColumn("Value Type", 200));    //1
            gridObservations.ListGridColumns.Add(new UI.GridColumn("Value", 0));           //2
            gridObservations.ListGridRows.Clear();
            List <EhrAptObs> listEhrAptObses = EhrAptObses.Refresh(_appt.AptNum);

            for (int i = 0; i < listEhrAptObses.Count; i++)
            {
                EhrAptObs  obs = listEhrAptObses[i];
                UI.GridRow row = new UI.GridRow();
                row.Tag = obs;
                row.Cells.Add(obs.IdentifyingCode.ToString());                //0 Observation
                if (obs.ValType == EhrAptObsType.Coded)
                {
                    row.Cells.Add(obs.ValType.ToString() + " - " + obs.ValCodeSystem);                //1 Value Type
                    if (obs.ValCodeSystem == "LOINC")
                    {
                        Loinc loincValue = Loincs.GetByCode(obs.ValReported);
                        row.Cells.Add(loincValue.NameShort);                        //2 Value
                    }
                    else if (obs.ValCodeSystem == "SNOMEDCT")
                    {
                        Snomed snomedValue = Snomeds.GetByCode(obs.ValReported);
                        row.Cells.Add(snomedValue.Description);                        //2 Value
                    }
                    else if (obs.ValCodeSystem == "ICD9")
                    {
                        ICD9 icd9Value = ICD9s.GetByCode(obs.ValReported);
                        row.Cells.Add(icd9Value.Description);                        //2 Value
                    }
                    else if (obs.ValCodeSystem == "ICD10")
                    {
                        Icd10 icd10Value = Icd10s.GetByCode(obs.ValReported);
                        row.Cells.Add(icd10Value.Description);                        //2 Value
                    }
                }
                else if (obs.ValType == EhrAptObsType.Address)
                {
                    string sendingFacilityAddress1 = PrefC.GetString(PrefName.PracticeAddress);
                    string sendingFacilityAddress2 = PrefC.GetString(PrefName.PracticeAddress2);
                    string sendingFacilityCity     = PrefC.GetString(PrefName.PracticeCity);
                    string sendingFacilityState    = PrefC.GetString(PrefName.PracticeST);
                    string sendingFacilityZip      = PrefC.GetString(PrefName.PracticeZip);
                    if (PrefC.HasClinicsEnabled && _appt.ClinicNum != 0)                   //Using clinics and a clinic is assigned.
                    {
                        Clinic clinic = Clinics.GetClinic(_appt.ClinicNum);
                        sendingFacilityAddress1 = clinic.Address;
                        sendingFacilityAddress2 = clinic.Address2;
                        sendingFacilityCity     = clinic.City;
                        sendingFacilityState    = clinic.State;
                        sendingFacilityZip      = clinic.Zip;
                    }
                    row.Cells.Add(obs.ValType.ToString());                                                                                                                      //1 Value Type
                    row.Cells.Add(sendingFacilityAddress1 + " " + sendingFacilityAddress2 + " " + sendingFacilityCity + " " + sendingFacilityState + " " + sendingFacilityZip); //2 Value
                }
                else
                {
                    row.Cells.Add(obs.ValType.ToString());             //1 Value Type
                    row.Cells.Add(obs.ValReported);                    //2 Value
                }
                gridObservations.ListGridRows.Add(row);
            }
            gridObservations.EndUpdate();
        }
예제 #22
0
        ///<summary>When sub is set, fills customer group box with various information.
        ///When null, clears all fields.</summary>
        private void SetCustomerInfo(BugSubmission sub, bool isCustomerGridRefresh = true)
        {
            try {
                labelCustomerNum.Text   = _patCur?.PatNum.ToString() ?? "";
                labelRegKey.Text        = sub.RegKey;
                labelCustomerState.Text = _patCur?.State ?? "";
                labelCustomerPhone.Text = _patCur?.WkPhone ?? "";
                labelSubNum.Text        = POut.Long(sub.BugSubmissionNum);
                labelLastCall.Text      = Commlogs.GetDateTimeOfLastEntryForPat(_patCur?.PatNum ?? 0).ToString();
            }
            catch (Exception ex) {
                ex.DoNothing();
            }
            butGoToAccount.Enabled = true;
            butBugTask.Enabled     = true;
            butCompare.Enabled     = true;
            if (!isCustomerGridRefresh || _groupSelection == -1 || _listSubs == null || !gridCustomerSubs.Visible)         //Just in case checks.
            {
                return;
            }
            switch (_groupSelection)
            {
            case 0:
                #region None
                gridCustomerSubs.Title = "Customer Submissions";
                gridCustomerSubs.BeginUpdate();
                gridCustomerSubs.ListGridColumns.Clear();
                gridCustomerSubs.ListGridColumns.Add(new GridColumn("Version", 100, HorizontalAlignment.Center));
                gridCustomerSubs.ListGridColumns.Add(new GridColumn("Count", 50, HorizontalAlignment.Center));
                gridCustomerSubs.ListGridRows.Clear();
                Dictionary <string, List <BugSubmission> > dictCustomerSubVersions = _listSubs
                                                                                     .Where(x => x.RegKey == sub.RegKey)
                                                                                     .GroupBy(x => x.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0"))
                                                                                     .ToDictionary(x => x.Key, x => x.DistinctBy(y => y.ExceptionStackTrace).ToList());
                foreach (KeyValuePair <string, List <BugSubmission> > pair in dictCustomerSubVersions)
                {
                    gridCustomerSubs.ListGridRows.Add(new GridRow(pair.Key, pair.Value.Count.ToString()));
                }
                gridCustomerSubs.EndUpdate();
                #endregion
                break;

            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
                #region RegKey/Ver/Stack, Stacktrace, 95%, StackSig
                gridCustomerSubs.Title = "Grouped Subs (" + _listSubs.DistinctBy(x => x.RegKey).Count() + " Reg)";
                if (_groupSelection.In(4, 5))                        //StackSig,StackSimple
                {
                    gridCustomerSubs.Title += " (" + _listSubs.DistinctBy(x => x.ExceptionStackTrace).Count() + " Stacks)";
                }
                gridCustomerSubs.BeginUpdate();
                gridCustomerSubs.ListGridColumns.Clear();
                gridCustomerSubs.ListGridColumns.Add(new GridColumn("Vers.", 55, HorizontalAlignment.Center));
                gridCustomerSubs.ListGridColumns.Add(new GridColumn("RegKey", 0, HorizontalAlignment.Center));
                gridCustomerSubs.ListGridRows.Clear();
                _listSubs.ForEach(x => {
                    Patient rowPat;
                    string patDescript = x.RegKey;
                    if (_dictPatients.TryGetValue(x.RegKey, out rowPat))
                    {
                        patDescript = rowPat.GetNameLF();
                    }
                    GridRow row = new GridRow(x.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0"), patDescript);
                    row.Tag     = x;
                    gridCustomerSubs.ListGridRows.Add(row);
                });
                gridCustomerSubs.EndUpdate();
                #endregion
                break;
            }
        }
예제 #23
0
 private void FillOfficeInfoGrid(BugSubmission sub)
 {
     gridOfficeInfo.BeginUpdate();
     gridOfficeInfo.ListGridRows.Clear();
     if (sub == null)
     {
         gridOfficeInfo.EndUpdate();
         return;
     }
     if (gridOfficeInfo.ListGridColumns.Count == 0)
     {
         gridOfficeInfo.ListGridColumns.Add(new GridColumn("Field", 130));
         gridOfficeInfo.ListGridColumns.Add(new GridColumn("Value", 125));
     }
     if (sub.IsMobileSubmission)
     {
         gridOfficeInfo.ListGridRows.Add(new GridRow("Mobile Fields", "")
         {
             ColorBackG = _colorGridHeaderBack, Bold = true, Tag = true
         });
         gridOfficeInfo.ListGridRows.Add(new GridRow("AppTarget", sub.Info.AppTarget));
         gridOfficeInfo.ListGridRows.Add(new GridRow("EConnectorVersion", sub.Info.EConnectorVersion));
         gridOfficeInfo.ListGridRows.Add(new GridRow("AppVersion", sub.Info.AppVersion));
         gridOfficeInfo.ListGridRows.Add(new GridRow("DevicePlatform", sub.Info.DevicePlatform));
         gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceModel", sub.Info.DeviceModel));
         gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceVersion", sub.Info.DeviceVersion));
         gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceManufacturer", sub.Info.DeviceManufacturer));
         gridOfficeInfo.ListGridRows.Add(new GridRow("MWUserIdentifier", sub.Info.MWUserIdentifier.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("TimeSignalsLastReceived", sub.Info.TimeSignalsLastReceived.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("DeviceId", sub.Info.DeviceId));
     }
     else
     {
         gridOfficeInfo.ListGridRows.Add(new GridRow("Preferences", "")
         {
             ColorBackG = _colorGridHeaderBack, Bold = true, Tag = true
         });
         List <PrefName> listPrefNames = sub.Info.DictPrefValues.Keys.ToList();
         foreach (PrefName prefName in listPrefNames)
         {
             GridRow row = new GridRow();
             row.Cells.Add(prefName.ToString());
             row.Cells.Add(sub.Info.DictPrefValues[prefName]);
             gridOfficeInfo.ListGridRows.Add(row);
         }
         gridOfficeInfo.ListGridRows.Add(new GridRow("Other", "")
         {
             ColorBackG = _colorGridHeaderBack, Bold = true, Tag = true
         });
         gridOfficeInfo.ListGridRows.Add(new GridRow("CountClinics", sub.Info.CountClinics.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("EnabledPlugins", string.Join(",", sub.Info.EnabledPlugins?.Select(x => x).ToList() ?? new List <string>())));
         gridOfficeInfo.ListGridRows.Add(new GridRow("ClinicNumCur", sub.Info.ClinicNumCur.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("UserNumCur", sub.Info.UserNumCur.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("PatientNumCur", sub.Info.PatientNumCur.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("ModuleNameCur", sub.Info.ModuleNameCur?.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("IsOfficeOnReplication", sub.Info.IsOfficeOnReplication.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("IsOfficeUsingMiddleTier", sub.Info.IsOfficeUsingMiddleTier.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("WindowsVersion", sub.Info.WindowsVersion?.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("CompName", sub.Info.CompName?.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("PreviousUpdateVersion", sub.Info.PreviousUpdateVersion));
         gridOfficeInfo.ListGridRows.Add(new GridRow("PreviousUpdateTime", sub.Info.PreviousUpdateTime.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("ThreadName", sub.Info.ThreadName?.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("DatabaseName", sub.Info.DatabaseName?.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("ODBdllVersion", sub.Info.OpenDentBusinessVersion?.ToString()));
         gridOfficeInfo.ListGridRows.Add(new GridRow("ODBdllMTVersion", sub.Info.OpenDentBusinessMiddleTierVersion?.ToString() ?? "INVALID"));
     }
     #region Shared between mobile and proper
     gridOfficeInfo.ListGridRows.Add(new GridRow("ClinicNumCur", sub.Info.ClinicNumCur.ToString()));
     #endregion
     gridOfficeInfo.EndUpdate();
 }
        private void FillClaimDetails(int rowIndex)
        {
            Claim claimSelected  = (Claim)gridClaims.ListGridRows[rowIndex].Tag;
            bool  isSupplemental = (claimSelected.ClaimStatus == "R");

            _listClaimProcsForClaim = ClaimProcs.RefreshForClaim(claimSelected.ClaimNum)
                                      .Where(x => x.ProcNum != 0 && x.Status.In(ClaimProcStatus.Received, ClaimProcStatus.NotReceived, ClaimProcStatus.Preauth))
                                      .ToList();
            gridClaimDetails.BeginUpdate();
            if (gridClaimDetails.ListGridColumns.Count == 0)
            {
                #region grid columns
                gridClaimDetails.ListGridColumns.Add(new UI.GridColumn("ProcCode", 100));
                gridClaimDetails.ListGridColumns.Add(new UI.GridColumn("ProcFee", 100));
                gridClaimDetails.ListGridColumns.Add(new UI.GridColumn("ProcStatus", 0));
                gridClaimDetails.ListGridColumns.Add(new UI.GridColumn("IsMatch", 0));
                gridClaimDetails.ListGridColumns.Add(new UI.GridColumn("EraCode", 100));
                gridClaimDetails.ListGridColumns.Add(new UI.GridColumn("EraFee", 100));
                #endregion
            }
            gridClaimDetails.ListGridRows.Clear();
            List <Hx835_Proc> listUnMatchedEraProcs = new List <Hx835_Proc>();
            List <Tuple <Hx835_Proc, ClaimProc> > listMatchedEraProcs = new List <Tuple <Hx835_Proc, ClaimProc> >();
            foreach (Hx835_Proc proc in _x835Claim.ListProcs)
            {
                ClaimProc claimProc = _listClaimProcsForClaim.FirstOrDefault(x =>
                                                                             //Mimics proc matching in claimPaid.GetPaymentsForClaimProcs(...)
                                                                             x.ProcNum != 0 && ((x.ProcNum == proc.ProcNum) ||//Consider using Hx835_Proc.TryGetMatchedClaimProc(...)
                                                                                                (x.CodeSent == proc.ProcCodeBilled &&
                                                                                                 (decimal)x.FeeBilled == proc.ProcFee &&
                                                                                                 (isSupplemental && x.Status == ClaimProcStatus.Received || !isSupplemental && x.Status == ClaimProcStatus.NotReceived) &&
                                                                                                 x.TagOD == null))
                                                                             );
                if (claimProc == null)               //Not found
                {
                    listUnMatchedEraProcs.Add(proc);
                }
                else
                {
                    claimProc.TagOD = true;                  //Flag set to indicate that claimProc has been handled
                    listMatchedEraProcs.Add(new Tuple <Hx835_Proc, ClaimProc>(proc, claimProc));
                }
            }
            #region ERA procs that could not be matched
            foreach (Hx835_Proc proc in listUnMatchedEraProcs)
            {
                UI.GridRow row = new UI.GridRow();
                row.Cells.Add("");
                row.Cells.Add("");
                row.Cells.Add("");
                row.Cells.Add("N");
                row.Cells.Add(proc.ProcCodeBilled);
                row.Cells.Add(POut.Decimal(proc.ProcFee));
                row.ColorText = Color.Red;
                row.Bold      = true;
                gridClaimDetails.ListGridRows.Add(row);
            }
            #endregion
            #region ERA procs that we can match.
            foreach (Tuple <Hx835_Proc, ClaimProc> match in listMatchedEraProcs)
            {
                Hx835_Proc proc      = match.Item1;
                ClaimProc  claimProc = match.Item2;
                UI.GridRow row       = new UI.GridRow();
                row.Cells.Add(claimProc.CodeSent);
                row.Cells.Add(POut.Double(claimProc.FeeBilled));
                #region Status column
                switch (claimProc.Status)
                {
                case ClaimProcStatus.Received:
                    row.Cells.Add("Recd");
                    break;

                case ClaimProcStatus.NotReceived:
                    row.Cells.Add("");
                    break;
                }
                #endregion
                row.Cells.Add("Y");
                row.Cells.Add(proc.ProcCodeBilled);
                row.Cells.Add(POut.Decimal(proc.ProcFee));
                row.ColorText = Color.Green;
                row.Bold      = true;
                gridClaimDetails.ListGridRows.Add(row);
            }
            #endregion
            #region Claim claimProcs that could not be matched.
            foreach (ClaimProc claimProc in _listClaimProcsForClaim)
            {
                if (claimProc.TagOD != null)
                {
                    continue;
                }
                UI.GridRow row = new UI.GridRow();
                row.Cells.Add(claimProc.CodeSent);
                row.Cells.Add(POut.Double(claimProc.FeeBilled));
                switch (claimProc.Status)
                {
                    #region Status column
                case ClaimProcStatus.Received:
                    row.Cells.Add("Recd");
                    break;

                case ClaimProcStatus.NotReceived:
                    row.Cells.Add("");
                    break;
                }
                #endregion
                row.Cells.Add("N");
                row.Cells.Add("");
                row.Cells.Add("");
                gridClaimDetails.ListGridRows.Add(row);
            }
            #endregion
            gridClaimDetails.EndUpdate();
        }