예제 #1
0
 private void FillProviders()
 {
     gridProviders.BeginUpdate();
     gridProviders.Rows.Clear();
     gridProviders.Columns.Clear();
     gridProviders.Columns.Add(new UI.ODGridColumn("Type", 74, HorizontalAlignment.Left));        //Column width determined in LayoutProviders().
     gridProviders.Columns.Add(new UI.ODGridColumn("IsEnabled", 74, HorizontalAlignment.Center)); //Column width determined in LayoutProviders().
     gridProviders.Columns.Add(new UI.ODGridColumn("IsIDPd", 74, HorizontalAlignment.Center));    //Column width determined in LayoutProviders().
     gridProviders.Columns.Add(new UI.ODGridColumn("IsEPCS", 74, HorizontalAlignment.Center));
     gridProviders.Columns.Add(new UI.ODGridColumn("NPI", 0, HorizontalAlignment.Left));          //Column width determined in LayoutProviders().
     //Gets from db.  Better to call db than to use cache at HQ, since cache might be large.
     //Only get Legacy eRx items.  Other types will be in the BroadcasterMonitor.
     _listProvErxs = ProviderErxs.Refresh(_patCur.PatNum).FindAll(x => x.ErxType == ErxOption.Legacy);
     for (int i = 0; i < _listProvErxs.Count; i++)
     {
         UI.ODGridRow row = new UI.ODGridRow();
         row.Tag = _listProvErxs[i];
         row.Cells.Add(new UI.ODGridCell(_listProvErxs[i].ErxType.ToString()));
         string status = "";
         if (_listProvErxs[i].IsEnabled == ErxStatus.Enabled)
         {
             status = "X";
         }
         else if (_listProvErxs[i].IsEnabled != ErxStatus.Disabled)
         {
             status = "P";
         }
         row.Cells.Add(new UI.ODGridCell(status));
         row.Cells.Add(new UI.ODGridCell(_listProvErxs[i].IsIdentifyProofed?"X":""));
         row.Cells.Add(new UI.ODGridCell(_listProvErxs[i].IsEpcs?"X":""));
         row.Cells.Add(new UI.ODGridCell(_listProvErxs[i].NationalProviderID));
         gridProviders.Rows.Add(row);
     }
     gridProviders.EndUpdate();
 }
 public FormDoseSpotAssignUserId(long provErxNum)
 {
     InitializeComponent();
     //get providerErx from provErxNum that was passed in
     _providerErxCur = ProviderErxs.GetFirstOrDefault(x => x.ProviderErxNum == provErxNum);
     Lan.F(this);
 }
예제 #3
0
        private void butOK_Click(object sender, EventArgs e)
        {
            List <ProviderErx> listOldProvErxs = ProviderErxs.Refresh(_patCur.PatNum).FindAll(x => x.ErxType == ErxOption.Legacy);

            ProviderErxs.Sync(_listProvErxs, listOldProvErxs);           //No cache refresh because this is an HQ only form.
            DialogResult = DialogResult.OK;
        }
예제 #4
0
        private void FormRepeatChargeEdit_Load(object sender, EventArgs e)
        {
            SetPatient();
            if (IsNew)
            {
                FormProcCodes FormP = new FormProcCodes();
                FormP.IsSelectionMode = true;
                FormP.ShowDialog();
                if (FormP.DialogResult != DialogResult.OK)
                {
                    DialogResult = DialogResult.Cancel;
                    return;
                }
                ProcedureCode procCode = ProcedureCodes.GetProcCode(FormP.SelectedCodeNum);
                if (procCode.TreatArea != TreatmentArea.Mouth &&
                    procCode.TreatArea != TreatmentArea.None)
                {
                    MsgBox.Show(this, "Procedure codes that require tooth numbers are not allowed.");
                    DialogResult = DialogResult.Cancel;
                    return;
                }
                RepeatCur.ProcCode     = ProcedureCodes.GetStringProcCode(FormP.SelectedCodeNum);
                RepeatCur.IsEnabled    = true;
                RepeatCur.CreatesClaim = false;
            }
            textCode.Text      = RepeatCur.ProcCode;
            textDesc.Text      = ProcedureCodes.GetProcCode(RepeatCur.ProcCode).Descript;
            textChargeAmt.Text = RepeatCur.ChargeAmt.ToString("F");
            if (RepeatCur.DateStart.Year > 1880)
            {
                textDateStart.Text = RepeatCur.DateStart.ToShortDateString();
            }
            if (RepeatCur.DateStop.Year > 1880)
            {
                textDateStop.Text = RepeatCur.DateStop.ToShortDateString();
            }
            textNote.Text = RepeatCur.Note;
            _isErx        = false;
            if (PrefC.GetBool(PrefName.DistributorKey) && Regex.IsMatch(RepeatCur.ProcCode, "^Z[0-9]{3,}$"))            //Is eRx if HQ and a using an eRx Z code.
            {
                _isErx = true;
                labelPatNum.Visible       = true;
                textPatNum.Visible        = true;
                butMoveTo.Visible         = true;
                labelNpi.Visible          = true;
                textNpi.Visible           = true;
                labelProviderName.Visible = true;
                textProvName.Visible      = true;
                labelErxAccountId.Visible = true;
                textErxAccountId.Visible  = true;
                if (IsNew && RepeatCur.ProcCode == "Z100")               //DoseSpot Procedure Code
                {
                    List <string> listDoseSpotAccountIds = ClinicErxs.GetAccountIdsForPatNum(RepeatCur.PatNum)
                                                           .Union(ProviderErxs.GetAccountIdsForPatNum(RepeatCur.PatNum))
                                                           .Union(
                        RepeatCharges.GetForErx()
                        .FindAll(x => x.PatNum == RepeatCur.PatNum && x.ProcCode == "Z100")
                        .Select(x => x.ErxAccountId)
                        .ToList()
                        )
                                                           .Distinct()
                                                           .ToList()
                                                           .FindAll(x => DoseSpot.IsDoseSpotAccountId(x));
                    if (listDoseSpotAccountIds.Count == 0)
                    {
                        listDoseSpotAccountIds.Add(DoseSpot.GenerateAccountId(RepeatCur.PatNum));
                    }
                    if (listDoseSpotAccountIds.Count == 1)
                    {
                        textErxAccountId.Text = listDoseSpotAccountIds[0];
                    }
                    else if (listDoseSpotAccountIds.Count > 1)
                    {
                        InputBox inputAccountIds = new InputBox(Lans.g(this, "Multiple Account IDs found.  Select one to assign to this repeat charge."), listDoseSpotAccountIds, 0);
                        inputAccountIds.ShowDialog();
                        if (inputAccountIds.DialogResult == DialogResult.OK)
                        {
                            textErxAccountId.Text = listDoseSpotAccountIds[inputAccountIds.SelectedIndex];
                        }
                    }
                }
                else                  //Existing eRx repeating charge.
                {
                    textNpi.Text              = RepeatCur.Npi;
                    textErxAccountId.Text     = RepeatCur.ErxAccountId;
                    textProvName.Text         = RepeatCur.ProviderName;
                    textNpi.ReadOnly          = true;
                    textErxAccountId.ReadOnly = true;
                    textProvName.ReadOnly     = true;
                }
            }
            checkCopyNoteToProc.Checked = RepeatCur.CopyNoteToProc;
            checkCreatesClaim.Checked   = RepeatCur.CreatesClaim;
            checkIsEnabled.Checked      = RepeatCur.IsEnabled;
            if (PrefC.GetBool(PrefName.DistributorKey))             //OD HQ disable the IsEnabled and CreatesClaim checkboxes
            {
                checkCreatesClaim.Enabled = false;
                checkIsEnabled.Enabled    = false;
            }
            if (PrefC.IsODHQ && EServiceCodeLink.IsProcCodeAnEService(RepeatCur.ProcCode))
            {
                if (IsNew)
                {
                    MsgBox.Show(this, "You cannot manually create any eService repeating charges.\r\n"
                                + "Use the Signup Portal instead.\r\n\r\n"
                                + "The Charge Amount can be manually edited after the Signup Portal has created the desired eService repeating charge.");
                    DialogResult = DialogResult.Abort;
                    return;
                }
                //The only things that users should be able to do for eServices are:
                //1. Change the repeating charge amount.
                //2. Manipulate the Start Date.
                //3. Manipulate the Note.
                //4. Manipulate Billing Day because not all customers will have a non-eService repeating charge in order to manipulate.
                //This is because legacy users (versions prior to 17.1) need the ability to manually set their monthly charge amount, etc.
                SetFormReadOnly(this, butOK, butCancel
                                , textChargeAmt, labelChargeAmount
                                , textDateStart, labelDateStart
                                , textNote, labelNote
                                , textBillingDay, labelBillingCycleDay);
            }
            Patient pat = Patients.GetPat(RepeatCur.PatNum);          //pat should never be null. If it is, this will fail.

            //If this is a new repeat charge and no other active repeat charges exist, set the billing cycle day to today
            if (IsNew && !RepeatCharges.ActiveRepeatChargeExists(RepeatCur.PatNum))
            {
                textBillingDay.Text = DateTimeOD.Today.Day.ToString();
            }
            else
            {
                textBillingDay.Text = pat.BillingCycleDay.ToString();
            }
            if (PrefC.GetBool(PrefName.BillingUseBillingCycleDay))
            {
                labelBillingCycleDay.Visible = true;
                textBillingDay.Visible       = true;
            }
            checkUsePrepay.Checked = RepeatCur.UsePrepay;
        }