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

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

            foreach (DataRow tableRow in _tableSuperFamAcct.Rows)
            {
                row = new GridRow();
                row.Cells.Add(PIn.DateT(tableRow["Date"].ToString()).ToShortDateString());
                row.Cells.Add(tableRow["PatName"].ToString());
                row.Cells.Add(Providers.GetAbbr(PIn.Long(tableRow["Prov"].ToString())));
                if (!string.IsNullOrWhiteSpace(tableRow["AdjType"].ToString()))                             //It's an adjustment
                {
                    row.Cells.Add(Lan.g(this, "Adjust"));                                                   //Adjustment
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(Defs.GetName(DefCat.AdjTypes, PIn.Long(tableRow["AdjType"].ToString()))); //Adjustment type
                }
                else if (!string.IsNullOrWhiteSpace(tableRow["ChargeType"].ToString()))                     //It's a payplan charge
                {
                    if (PrefC.GetInt(PrefName.PayPlansVersion) != (int)PayPlanVersions.AgeCreditsAndDebits)
                    {
                        continue;                        //They can only attach debits to invoices and they can only do so if they're on version 2.
                    }
                    row.Cells.Add(Lan.g(this, "Pay Plan"));
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(PIn.Enum <PayPlanChargeType>(PIn.Int(tableRow["ChargeType"].ToString())).GetDescription()); //Pay Plan charge type
                }
                else                                                                                                          //It's a procedure
                {
                    ProcedureCode procCode = ProcedureCodes.GetProcCode(PIn.Long(tableRow["Code"].ToString()), listProcCodes);
                    row.Cells.Add(procCode.ProcCode);
                    row.Cells.Add(Tooth.ToInternat(tableRow["Tooth"].ToString()));
                    row.Cells.Add(procCode.Descript);
                }
                row.Cells.Add(PIn.Double(tableRow["Amount"].ToString()).ToString("F"));
                row.Tag = tableRow;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemple #2
0
        private void FillForm()
        {
            try {
                checkUseService.Checked          = PIn.Bool(_useService.PropertyValue);
                checkShowCommlogsInChart.Checked = PIn.Bool(_showCommlogsInChartAndAccount.PropertyValue);
                checkEnabled.Checked             = _progCur.Enabled;
                checkHideButtons.Checked         = PIn.Bool(_disableAdvertising.PropertyValue);
                textApptSetComplete.Text         = _apptSetCompleteMins.PropertyValue;
                textApptTimeArrived.Text         = _apptTimeArrivedMins.PropertyValue;
                textApptTimeDismissed.Text       = _apptTimeDismissedMins.PropertyValue;
                textCompNameOrIP.Text            = _compName.PropertyValue;
                textAPIToken.Text = _apiToken.PropertyValue;
                if (_dictLocationIDs.ContainsKey(_clinicNumCur))
                {
                    textLocationID.Text = _dictLocationIDs[_clinicNumCur].PropertyValue;
                }
                else
                {
                    textLocationID.Text = _dictLocationIDs[0].PropertyValue;                  //Default to showing the HQ value when filling info for a clinic with no program property.
                }
                _existingPatTriggerEnum = PIn.Enum <ReviewInvitationTrigger>(_existingPatTriggerType.PropertyValue);
                _newPatTriggerEnum      = PIn.Enum <ReviewInvitationTrigger>(_newPatTriggerType.PropertyValue);
                switch (_existingPatTriggerEnum)
                {
                case ReviewInvitationTrigger.AppointmentCompleted:
                    radioSetCompleteExistingPat.Checked = true;
                    break;

                case ReviewInvitationTrigger.AppointmentTimeArrived:
                    radioTimeArrivedExistingPat.Checked = true;
                    break;

                case ReviewInvitationTrigger.AppointmentTimeDismissed:
                    radioTimeDismissedExistingPat.Checked = true;
                    break;
                }
                switch (_newPatTriggerEnum)
                {
                case ReviewInvitationTrigger.AppointmentCompleted:
                    radioSetCompleteNewPat.Checked = true;
                    break;

                case ReviewInvitationTrigger.AppointmentTimeArrived:
                    radioTimeArrivedNewPat.Checked = true;
                    break;

                case ReviewInvitationTrigger.AppointmentTimeDismissed:
                    radioTimeDismissedNewPat.Checked = true;
                    break;
                }
            }
            catch (Exception) {
                MsgBox.Show(this, "You are missing a program property from the database.  Please call support to resolve this issue.");
                DialogResult = DialogResult.Cancel;
                return;
            }
        }
 /// <summary>Sets UI for preferences that we know for sure will exist.</summary>
 private void FillStandardPrefs()
 {
     #region Account Tab
     checkAgingMonthly.Checked = PrefC.GetBool(PrefName.AgingCalculatedMonthlyInsteadOfDaily);
     foreach (PayClinicSetting prompt in Enum.GetValues(typeof(PayClinicSetting)))
     {
         comboPaymentClinicSetting.Items.Add(Lan.g(this, prompt.GetDescription()));
     }
     comboPaymentClinicSetting.SelectedIndex = PrefC.GetInt(PrefName.PaymentClinicSetting);
     checkPaymentsPromptForPayType.Checked   = PrefC.GetBool(PrefName.PaymentsPromptForPayType);
     for (int i = 0; i < Enum.GetNames(typeof(AutoSplitPreference)).Length; i++)
     {
         comboAutoSplitPref.Items.Add(Lans.g(this, Enum.GetNames(typeof(AutoSplitPreference))[i]));
     }
     comboAutoSplitPref.SelectedIndex    = PrefC.GetInt(PrefName.AutoSplitLogic);
     checkBillShowTransSinceZero.Checked = PrefC.GetBool(PrefName.BillingShowTransSinceBalZero);
     textClaimIdentifier.Text            = PrefC.GetString(PrefName.ClaimIdPrefix);
     checkReceiveReportsService.Checked  = PrefC.GetBool(PrefName.ClaimReportReceivedByService);
     _claimReportReceiveInterval         = PrefC.GetInt(PrefName.ClaimReportReceiveInterval);
     if (_claimReportReceiveInterval == 0)
     {
         radioTime.Checked = true;
         DateTime fullDateTime = PrefC.GetDateT(PrefName.ClaimReportReceiveTime);
         textReportCheckTime.Text = fullDateTime.ToShortTimeString();
     }
     else
     {
         textReportCheckInterval.Text = POut.Int(_claimReportReceiveInterval);
         radioInterval.Checked        = true;
     }
     List <RigorousAccounting> listEnums = Enum.GetValues(typeof(RigorousAccounting)).OfType <RigorousAccounting>().ToList();
     for (int i = 0; i < listEnums.Count; i++)
     {
         comboRigorousAccounting.Items.Add(listEnums[i].GetDescription());
     }
     comboRigorousAccounting.SelectedIndex = PrefC.GetInt(PrefName.RigorousAccounting);
     List <RigorousAdjustments> listAdjEnums = Enum.GetValues(typeof(RigorousAdjustments)).OfType <RigorousAdjustments>().ToList();
     for (int i = 0; i < listAdjEnums.Count; i++)
     {
         comboRigorousAdjustments.Items.Add(listAdjEnums[i].GetDescription());
     }
     comboRigorousAdjustments.SelectedIndex = PrefC.GetInt(PrefName.RigorousAdjustments);
     checkHidePaysplits.Checked             = PrefC.GetBool(PrefName.PaymentWindowDefaultHideSplits);
     foreach (PayPlanVersions version in Enum.GetValues(typeof(PayPlanVersions)))
     {
         comboPayPlansVersion.Items.Add(Lan.g("enumPayPlanVersions", version.GetDescription()));
     }
     comboPayPlansVersion.SelectedIndex = PrefC.GetInt(PrefName.PayPlansVersion) - 1;
     textBillingElectBatchMax.Text      = PrefC.GetInt(PrefName.BillingElectBatchMax).ToString();
     checkBillingShowProgress.Checked   = PrefC.GetBool(PrefName.BillingShowSendProgress);
     #endregion Account Tab
     #region Advanced Tab
     checkPasswordsMustBeStrong.Checked         = PrefC.GetBool(PrefName.PasswordsMustBeStrong);
     checkPasswordsStrongIncludeSpecial.Checked = PrefC.GetBool(PrefName.PasswordsStrongIncludeSpecial);
     checkPasswordForceWeakToStrong.Checked     = PrefC.GetBool(PrefName.PasswordsWeakChangeToStrong);
     checkLockIncludesAdmin.Checked             = PrefC.GetBool(PrefName.SecurityLockIncludesAdmin);
     textLogOffAfterMinutes.Text      = PrefC.GetInt(PrefName.SecurityLogOffAfterMinutes).ToString();
     checkUserNameManualEntry.Checked = PrefC.GetBool(PrefName.UserNameManualEntry);
     textDateLock.Text = PrefC.GetDate(PrefName.SecurityLockDate).ToShortDateString();
     textDaysLock.Text = PrefC.GetInt(PrefName.SecurityLockDays).ToString();
     long signalInactive = PrefC.GetLong(PrefName.SignalInactiveMinutes);
     textInactiveSignal.Text = (signalInactive == 0 ? "" : signalInactive.ToString());
     long sigInterval = PrefC.GetLong(PrefName.ProcessSigsIntervalInSecs);
     textSigInterval.Text = (sigInterval == 0 ? "" : sigInterval.ToString());
     string patSearchMinChars = PrefC.GetString(PrefName.PatientSelectSearchMinChars);
     textPatSelectMinChars.Text = Math.Min(10, Math.Max(1, PIn.Int(patSearchMinChars, false))).ToString();       //enforce minimum 1 maximum 10
     string patSearchPauseMs = PrefC.GetString(PrefName.PatientSelectSearchPauseMs);
     textPatSelectPauseMs.Text = Math.Min(10000, Math.Max(1, PIn.Int(patSearchPauseMs, false))).ToString();      //enforce minimum 1 maximum 10000
     checkPatientSelectFilterRestrictedClinics.Checked = PrefC.GetBool(PrefName.PatientSelectFilterRestrictedClinics);
     YN searchEmptyParams = PIn.Enum <YN>(PrefC.GetInt(PrefName.PatientSelectSearchWithEmptyParams));
     if (searchEmptyParams != YN.Unknown)
     {
         checkPatSearchEmptyParams.CheckState = CheckState.Unchecked;
         checkPatSearchEmptyParams.Checked    = searchEmptyParams == YN.Yes;
     }
     _usePhonenumTable = PrefC.GetEnum <YN>(PrefName.PatientPhoneUsePhonenumberTable);
     if (_usePhonenumTable != YN.Unknown)
     {
         checkUsePhoneNumTable.CheckState = CheckState.Unchecked;
         checkUsePhoneNumTable.Checked    = _usePhonenumTable == YN.Yes;
     }
     #endregion Advanced Tab
     #region Appts Tab
     checkApptsRequireProcs.Checked  = PrefC.GetBool(PrefName.ApptsRequireProc);
     checkUseOpHygProv.Checked       = PrefC.GetBool(PrefName.ApptSecondaryProviderConsiderOpOnly);
     checkEnterpriseApptList.Checked = PrefC.GetBool(PrefName.EnterpriseApptList);
     checkEnableNoneView.Checked     = PrefC.GetBool(PrefName.EnterpriseNoneApptViewDefaultDisabled);
     #endregion Appts Tab
     #region Family Tab
     checkSuperFam.Checked            = PrefC.GetBool(PrefName.ShowFeatureSuperfamilies);
     checkPatClone.Checked            = PrefC.GetBool(PrefName.ShowFeaturePatientClone);
     checkShowFeeSchedGroups.Checked  = PrefC.GetBool(PrefName.ShowFeeSchedGroups);
     checkSuperFamCloneCreate.Checked = PrefC.GetBool(PrefName.CloneCreateSuperFamily);
     //users should only see the snapshot trigger and service runtime if they have it set to something other than ClaimCreate.
     //if a user wants to be able to change claimsnapshot settings, the following MySQL statement should be run:
     //UPDATE preference SET ValueString = 'Service'	 WHERE PrefName = 'ClaimSnapshotTriggerType'
     if (PIn.Enum <ClaimSnapshotTrigger>(PrefC.GetString(PrefName.ClaimSnapshotTriggerType), true) == ClaimSnapshotTrigger.ClaimCreate)
     {
         groupClaimSnapshot.Visible = false;
     }
     foreach (ClaimSnapshotTrigger trigger in Enum.GetValues(typeof(ClaimSnapshotTrigger)))
     {
         comboClaimSnapshotTrigger.Items.Add(trigger.GetDescription());
     }
     comboClaimSnapshotTrigger.SelectedIndex = (int)PIn.Enum <ClaimSnapshotTrigger>(PrefC.GetString(PrefName.ClaimSnapshotTriggerType), true);
     textClaimSnapshotRunTime.Text           = PrefC.GetDateT(PrefName.ClaimSnapshotRunTime).ToShortTimeString();
     #endregion Family Tab
     #region Reports Tab
     checkUseReportServer.Checked = (PrefC.GetString(PrefName.ReportingServerCompName) != "" || PrefC.GetString(PrefName.ReportingServerURI) != "");
     textServerName.Text          = PrefC.GetString(PrefName.ReportingServerCompName);
     comboDatabase.Text           = PrefC.GetString(PrefName.ReportingServerDbName);
     textMysqlUser.Text           = PrefC.GetString(PrefName.ReportingServerMySqlUser);
     string decryptedPass;
     CDT.Class1.Decrypt(PrefC.GetString(PrefName.ReportingServerMySqlPassHash), out decryptedPass);
     textMysqlPass.Text     = decryptedPass;
     textMiddleTierURI.Text = PrefC.GetString(PrefName.ReportingServerURI);
     FillComboDatabases();
     SetReportServerUIEnabled();
     #endregion Reports Tab
 }
Exemple #4
0
 private void FormErxSetup_Load(object sender, EventArgs e)
 {
     try {
         _progCur = Programs.GetCur(ProgramName.eRx);
         if (_progCur == null)
         {
             throw new Exception("The eRx bridge is missing from the database.");
         }
         _listProgramProperties = ProgramProperties.GetForProgram(_progCur.ProgramNum);
         checkEnabled.Checked   = _progCur.Enabled;
         _eRxOption             = PIn.Enum <ErxOption>(ErxOptionPP.PropertyValue);
         if (_eRxOption == ErxOption.Legacy)
         {
             radioNewCrop.Checked = true;
         }
         else if (_eRxOption == ErxOption.DoseSpot)
         {
             radioDoseSpot.Checked = true;
             //HideLegacy();
         }
         else if (_eRxOption == ErxOption.DoseSpotWithLegacy)
         {
             radioDoseSpotLegacy.Checked = true;
             //HideLegacy();
         }
         textNewCropAccountID.Text = PrefC.GetString(PrefName.NewCropAccountId);
         List <ProgramProperty> listClinicIDs  = _listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicID);
         List <ProgramProperty> listClinicKeys = _listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicKey);
         //Always make sure clinicnum 0 (HQ) exists, regardless of if clinics are enabled
         if (!listClinicIDs.Exists(x => x.ClinicNum == 0))
         {
             ProgramProperty ppClinicID = new ProgramProperty();
             ppClinicID.ProgramNum    = _progCur.ProgramNum;
             ppClinicID.ClinicNum     = 0;
             ppClinicID.PropertyDesc  = Erx.PropertyDescs.ClinicID;
             ppClinicID.PropertyValue = "";
             _listProgramProperties.Add(ppClinicID);
         }
         if (!listClinicKeys.Exists(x => x.ClinicNum == 0))
         {
             ProgramProperty ppClinicKey = new ProgramProperty();
             ppClinicKey.ProgramNum    = _progCur.ProgramNum;
             ppClinicKey.ClinicNum     = 0;
             ppClinicKey.PropertyDesc  = Erx.PropertyDescs.ClinicKey;
             ppClinicKey.PropertyValue = "";
             _listProgramProperties.Add(ppClinicKey);
         }
         if (PrefC.HasClinicsEnabled)
         {
             foreach (Clinic clinicCur in Clinics.GetAllForUserod(Security.CurUser))
             {
                 if (!listClinicIDs.Exists(x => x.ClinicNum == clinicCur.ClinicNum))                       //Only add a program property if it doesn't already exist.
                 {
                     ProgramProperty ppClinicID = new ProgramProperty();
                     ppClinicID.ProgramNum    = _progCur.ProgramNum;
                     ppClinicID.ClinicNum     = clinicCur.ClinicNum;
                     ppClinicID.PropertyDesc  = Erx.PropertyDescs.ClinicID;
                     ppClinicID.PropertyValue = "";
                     _listProgramProperties.Add(ppClinicID);
                 }
                 if (!listClinicKeys.Exists(x => x.ClinicNum == clinicCur.ClinicNum))                       //Only add a program property if it doesn't already exist.
                 {
                     ProgramProperty ppClinicKey = new ProgramProperty();
                     ppClinicKey.ProgramNum    = _progCur.ProgramNum;
                     ppClinicKey.ClinicNum     = clinicCur.ClinicNum;
                     ppClinicKey.PropertyDesc  = Erx.PropertyDescs.ClinicKey;
                     ppClinicKey.PropertyValue = "";
                     _listProgramProperties.Add(ppClinicKey);
                 }
             }
         }
         else
         {
             checkShowHiddenClinics.Visible = false;
         }
         FillGridDoseSpot();
         SetRadioButtonChecked(_eRxOption);
     }
     catch (Exception ex) {
         MessageBox.Show(Lan.g(this, "Error loading the eRx program: ") + ex.Message);
         DialogResult = DialogResult.Cancel;
         return;
     }
 }
Exemple #5
0
        private void FillTextSelectedFieldDetails(string fieldDescript, string selectedText)
        {
            switch (fieldDescript)
            {
            case "CLIENT NUMBER":
                textSelectedFieldDetails.Text = "ID assigned to the office/clinic by TSI";
                return;

            case "TRANSMITTAL NUMBER":
                textSelectedFieldDetails.Text = "Not used";
                return;

            case "DEBTOR REFERENCE":
            case "TRANSMITTAL/REFERENCE NUMBER":
                textSelectedFieldDetails.Text = "Open Dental PatNum for the guarantor of the family";
                return;

            case "DEBTOR PHONE":
                textSelectedFieldDetails.Text = "Home phone for the guarantor of the family";
                return;

            case "SECONDARY PHONE":
                textSelectedFieldDetails.Text = "Wireless phone for the guarantor of the family";
                return;

            case "PATIENTTYPE":
                if (selectedText == "0")
                {
                    textSelectedFieldDetails.Text = "Self/Default";
                }
                else if (selectedText == "1")
                {
                    textSelectedFieldDetails.Text = "Spouse/Significant other";
                }
                else if (selectedText == "2")
                {
                    textSelectedFieldDetails.Text = "Parent/Guardian";
                }
                else if (selectedText == "3")
                {
                    textSelectedFieldDetails.Text = "Child";
                }
                else if (selectedText == "4")
                {
                    textSelectedFieldDetails.Text = "Other (Grandparent/Grandchild/Sitter/Sibling/Friend/Other)";
                }
                return;

            case "PATIENTPHONE1":
                textSelectedFieldDetails.Text = "Home phone for the patient being placed for account management by TSI";
                return;

            case "PATIENTPHONE2":
                textSelectedFieldDetails.Text = "Wireless phone for the patient being placed for account management by TSI";
                return;

            case "DEMANDTYPE":
                if (selectedText == "1")
                {
                    textSelectedFieldDetails.Text = "Accelerator/Profit Recovery";
                }
                else if (selectedText == "2")
                {
                    textSelectedFieldDetails.Text = "Collection";
                }
                return;

            case "SERVICECODE":
                if (string.IsNullOrWhiteSpace(selectedText))
                {
                    return;                            //nothing in the field so no text selected for translation
                }
                textSelectedFieldDetails.Text = PIn.Enum <TsiServiceCode>(PIn.Int(selectedText, false) - 1).GetDescription();
                return;

            case "TRANSACTION TYPE":
                if (string.IsNullOrWhiteSpace(selectedText))
                {
                    return;                            //nothing in the field so no text selected for translation
                }
                TsiTransType typeCur = PIn.Enum <TsiTransType>(selectedText, true);
                textSelectedFieldDetails.Text = typeCur.GetDescription();
                if (typeCur == TsiTransType.None)
                {
                    textSelectedFieldDetails.Text += " (transaction NOT sent to TSI, e.g. a payment received from TSI)";
                }
                return;

            case "DEBTOR DATE OF BIRTH":
            case "PATIENTDOB":
            case "DATE OF DEBT":
            case "DATE OF LAST PAY":
            case "TRANSACTION DATE":
                DateTime dateCur;
                if (string.IsNullOrWhiteSpace(selectedText) ||
                    !DateTime.TryParseExact(selectedText, "MMddyyyy", new CultureInfo("en-US"), DateTimeStyles.AllowWhiteSpaces, out dateCur))
                {
                    return;
                }
                textSelectedFieldDetails.Text = dateCur.ToShortDateString();
                return;
            }
        }