private void OnLabels_Click()
        {
            if (gridMain.SelectedIndices.Length == 0)
            {
                MessageBox.Show(Lan.g(this, "Please select an item first."));
                return;
            }
            PrintDocument pd = new PrintDocument();          //only used to pass printerName

            if (!Printers.SetPrinter(pd, PrintSituation.LabelSingle))
            {
                return;
            }
            Carrier carrier;
            Claim   claim;
            InsPlan plan;

            for (int i = 0; i < gridMain.SelectedIndices.Length; i++)
            {
                claim   = Claims.GetClaim(listQueue[gridMain.SelectedIndices[i]].ClaimNum);
                plan    = InsPlans.GetPlan(claim.PlanNum, new InsPlan[] {});
                carrier = Carriers.GetCarrier(plan.CarrierNum);
                LabelSingle label = new LabelSingle();
                if (!label.PrintIns(carrier, pd.PrinterSettings.PrinterName))
                {
                    return;
                }
            }
        }
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Etrans etrans = list[e.Row];

            if (etrans.Etype == EtransType.Eligibility_CA)
            {
                FormEtransEdit formETE = new FormEtransEdit();
                formETE.EtransCur = etrans;
                formETE.ShowDialog();
            }
            else
            {
                string settingErrors271 = X271.ValidateSettings();
                if (settingErrors271 != "")
                {
                    MessageBox.Show(settingErrors271);
                    return;
                }
                bool              isDependent = (etrans.PatNum != 0 && _subPatNum != etrans.PatNum);//Old rows will be 0, but when 0 then request was for subscriber.
                Carrier           carrierCur  = Carriers.GetCarrier(_carrierNum);
                FormEtrans270Edit formE       = new FormEtrans270Edit(PatPlanNum, PlanNum, SubNum, isDependent, _subPatNum, carrierCur.IsCoinsuranceInverted);
                formE.EtransCur = etrans;
                formE.benList   = BenList;
                formE.ShowDialog();
            }
            FillGrid();
        }
示例#3
0
 public PayPlanExtended(PayPlan payPlan, Patient patCur, List <PayPlanCharge> listPayPlanCharges, List <ClaimProc> listClaimProcs, InsPlan insPlan)
 {
     //assign passed-in values
     PayPlan = payPlan;
     if (patCur == null)
     {
         PatientCur = new Patient();
     }
     else
     {
         PatientCur = patCur;
     }
     ListPayPlanCharges = listPayPlanCharges;
     ListClaimProcs     = listClaimProcs;
     if (insPlan == null)
     {
         InsPlanCur = new InsPlan();
     }
     else
     {
         InsPlanCur = insPlan;
     }
     //find carrierCur. GetCarrier uses the H List if possible.
     CarrierCur = Carriers.GetCarrier(InsPlanCur.CarrierNum);
     CalculateOverdues();
 }
示例#4
0
        ///<summary>Makes the "Before" and "After" columns human-readable for certain logs.</summary>
        private void TranslateBeforeAndAfter()
        {
            foreach (InsEditLog logCur in _listLogs)
            {
                long beforeKey = PIn.Long(logCur.OldValue, false);
                long afterKey  = PIn.Long(logCur.NewValue, false);
                switch (logCur.FieldName)
                {
                case "CarrierNum":
                    if (logCur.LogType == InsEditLogType.Carrier)
                    {
                        break;
                    }
                    string carrierNameBefore = Carriers.GetCarrier(beforeKey).CarrierName;
                    string carrierNameAfter  = Carriers.GetCarrier(afterKey).CarrierName;
                    if (logCur.LogType == InsEditLogType.InsPlan && carrierNameBefore == carrierNameAfter) //Edits to carrier.
                    {
                        break;                                                                             //Don't translate CarrierNum to CarrierName when both carriers have the same name, loses too much useful detail.
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : carrierNameBefore;
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : carrierNameAfter;
                    break;

                case "EmployerNum":
                    if (logCur.LogType == InsEditLogType.Employer)
                    {
                        break;
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Employers.GetName(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Employers.GetName(afterKey);
                    break;

                case "FeeSched":
                case "CopayFeeSched":
                case "AllowedFeeSched":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : FeeScheds.GetDescription(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : FeeScheds.GetDescription(afterKey);
                    break;

                case "BenefitType":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Enum.GetName(typeof(InsBenefitType), beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Enum.GetName(typeof(InsBenefitType), afterKey);
                    break;

                case "CovCatNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : CovCats.GetDesc(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : CovCats.GetDesc(afterKey);
                    break;

                case "CodeNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : ProcedureCodes.GetStringProcCode(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : ProcedureCodes.GetStringProcCode(afterKey);
                    break;

                default:
                    break;
                }
            }
        }
示例#5
0
        ///<summary></summary>
        private void FillGrid()
        {
            Cursor = Cursors.WaitCursor;
            //ListAll: Set externally before loading.
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Employer", 100);

            gridMain.Columns.Add(col);
            col = new ODGridColumn("Carrier", 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Phone", 82);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Address", 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("City", 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("ST", 25);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Zip", 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Group#", 70);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Group Name", 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Subs", 40);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Plan Note", 180);
            gridMain.Columns.Add(col);
            //TrojanID and PlanNote not shown
            gridMain.Rows.Clear();
            ODGridRow row;
            Carrier   carrier;

            for (int i = 0; i < ListAll.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(Employers.GetName(ListAll[i].EmployerNum));
                carrier = Carriers.GetCarrier(ListAll[i].CarrierNum);
                row.Cells.Add(carrier.CarrierName);
                row.Cells.Add(carrier.Phone);
                row.Cells.Add(carrier.Address);
                row.Cells.Add(carrier.City);
                row.Cells.Add(carrier.State);
                row.Cells.Add(carrier.Zip);
                row.Cells.Add(ListAll[i].GroupNum);
                row.Cells.Add(ListAll[i].GroupName);
                row.Cells.Add(ListAll[i].NumberSubscribers.ToString());
                row.Cells.Add(ListAll[i].PlanNote);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            gridMain.SetSelected(0, true);
            Cursor = Cursors.Default;
        }
示例#6
0
        ///<summary>Makes the "Before" and "After" columns human-readable for certain logs.</summary>
        private void TranslateBeforeAndAfter()
        {
            foreach (InsEditLog logCur in _listLogs)
            {
                long beforeKey = PIn.Long(logCur.OldValue, false);
                long afterKey  = PIn.Long(logCur.NewValue, false);
                switch (logCur.FieldName)
                {
                case "CarrierNum":
                    if (logCur.LogType == InsEditLogType.Carrier)
                    {
                        break;
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Carriers.GetCarrier(beforeKey).CarrierName;
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Carriers.GetCarrier(afterKey).CarrierName;
                    break;

                case "EmployerNum":
                    if (logCur.LogType == InsEditLogType.Employer)
                    {
                        break;
                    }
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Employers.GetName(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Employers.GetName(afterKey);
                    break;

                case "FeeSched":
                case "CopayFeeSched":
                case "AllowedFeeSched":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : FeeScheds.GetDescription(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : FeeScheds.GetDescription(afterKey);
                    break;

                case "BenefitType":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Enum.GetName(typeof(InsBenefitType), beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : Enum.GetName(typeof(InsBenefitType), afterKey);
                    break;

                case "CovCatNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : CovCats.GetDesc(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : CovCats.GetDesc(afterKey);
                    break;

                case "CodeNum":
                    logCur.OldValue = beforeKey == 0 ? logCur.OldValue : ProcedureCodes.GetStringProcCode(beforeKey);
                    logCur.NewValue = afterKey == 0 ? logCur.NewValue : ProcedureCodes.GetStringProcCode(afterKey);
                    break;

                default:
                    break;
                }
            }
        }
示例#7
0
 ///<summary>It's ok to use 0 for carrierNum if IsNew.</summary>
 public FormCarrierEdit(int carrierNum)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     Lan.F(this);
     if (IsNew)
     {
         CarrierCur = new Carrier();
     }
     else
     {
         CarrierCur = Carriers.GetCarrier(carrierNum);
     }
 }
示例#8
0
        ///<summary>Used in Ins lines in Account module.</summary>
        public static string GetCarrierName(int planNum, InsPlan[] PlanList)
        {
            InsPlan plan = GetPlan(planNum, PlanList);

            if (plan == null)
            {
                return("");
            }
            Carrier carrier = Carriers.GetCarrier(plan.CarrierNum);

            if (carrier.CarrierNum == 0)           //if corrupted
            {
                return("");
            }
            return(carrier.CarrierName);
        }
示例#9
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     //only visible if IsSelectMode
     if (gridMain.SelectedIndices.Length == 0)
     {
         MessageBox.Show(Lan.g(this, "Please select an item first."));
         return;
     }
     if (gridMain.SelectedIndices.Length > 1)
     {
         MessageBox.Show(Lan.g(this, "Please select only one item first."));
         return;
     }
     SelectedCarrier = Carriers.GetCarrier(PIn.Long(table.Rows[gridMain.SelectedIndices[0]]["CarrierNum"].ToString()));
     DialogResult    = DialogResult.OK;
 }
示例#10
0
        private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Rectangle bounds = e.MarginBounds;
            //new Rectangle(50,40,800,1035);//Some printers can handle up to 1042
            Graphics g = e.Graphics;
            string   text;
            Font     headingFont    = new Font("Arial", 12, FontStyle.Bold);
            Font     subHeadingFont = new Font("Arial", 10, FontStyle.Bold);
            int      yPos           = bounds.Top;
            int      center         = bounds.X + bounds.Width / 2;

            #region printHeading
            if (!headingPrinted)
            {
                text = Lan.g(this, "Electronic Benefits Response");
                g.DrawString(text, headingFont, Brushes.Black, center - g.MeasureString(text, headingFont).Width / 2, yPos);
                yPos += (int)g.MeasureString(text, headingFont).Height;
                InsSub  sub   = InsSubs.GetSub(this.SubNum, new List <InsSub>());
                InsPlan plan  = InsPlans.GetPlan(this.PlanNum, new List <InsPlan>());
                Patient subsc = Patients.GetPat(sub.Subscriber);
                text = Lan.g(this, "Subscriber: ") + subsc.GetNameFL();
                g.DrawString(text, subHeadingFont, Brushes.Black, center - g.MeasureString(text, subHeadingFont).Width / 2, yPos);
                yPos += (int)g.MeasureString(text, subHeadingFont).Height;
                Carrier carrier = Carriers.GetCarrier(plan.CarrierNum);
                if (carrier.CarrierNum != 0)               //not corrupted
                {
                    text = carrier.CarrierName;
                    g.DrawString(text, subHeadingFont, Brushes.Black, center - g.MeasureString(text, subHeadingFont).Width / 2, yPos);
                }
                yPos          += 20;
                headingPrinted = true;
                headingPrintH  = yPos;
            }
            #endregion
            yPos = gridMain.PrintPage(g, pagesPrinted, bounds, headingPrintH);
            pagesPrinted++;
            if (yPos == -1)
            {
                e.HasMorePages = true;
            }
            else
            {
                e.HasMorePages = false;
            }
            g.Dispose();
        }
示例#11
0
        ///<summary>Gets a description of the specified plan, including carrier name and subscriber. It's fastest if you supply a plan list that contains the plan, but it also works just fine if it can't initally locate the plan in the list.  You can supply an array of length 0 for both family and planlist.</summary>
        public static string GetDescript(int planNum, Family family, InsPlan[] PlanList)
        {
            if (planNum == 0)
            {
                return("");
            }
            InsPlan plan = GetPlan(planNum, PlanList);

            if (plan == null || plan.PlanNum == 0)
            {
                return("");
            }
            string subscriber = family.GetNameInFamFL(plan.Subscriber);

            if (subscriber == "")           //subscriber from another family
            {
                subscriber = Patients.GetLim(plan.Subscriber).GetNameLF();
            }
            string retStr = "";
            //loop just to get the index of the plan in the family list
            bool otherFam = true;

            for (int i = 0; i < PlanList.Length; i++)
            {
                if (PlanList[i].PlanNum == planNum)
                {
                    otherFam = false;
                    //retStr += (i+1).ToString()+": ";
                }
            }
            if (otherFam)           //retStr=="")
            {
                retStr = "(other fam):";
            }
            Carrier carrier     = Carriers.GetCarrier(plan.CarrierNum);
            string  carrierName = carrier.CarrierName;

            if (carrierName.Length > 20)
            {
                carrierName = carrierName.Substring(0, 20) + "...";
            }
            retStr += carrierName;
            retStr += " (" + subscriber + ")";
            return(retStr);
        }
示例#12
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Carrier carrier = Carriers.GetCarrier(PIn.Long(table.Rows[e.Row]["CarrierNum"].ToString()));

            if (IsSelectMode)
            {
                SelectedCarrier = carrier;
                DialogResult    = DialogResult.OK;
                return;
            }
            FormCarrierEdit FormCE = new FormCarrierEdit();

            FormCE.CarrierCur = carrier;
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrid();
            DataValid.SetInvalid(InvalidType.Carriers);
        }
示例#13
0
        ///<summary>raised for each page to be printed.  One page per appointment.</summary>
        private void pd_PrintPage(object sender, PrintPageEventArgs ev)
        {
            if (ApptNum != 0)           //just for one appointment
            {
                date = Appointments.DateSelected;
            }
            Graphics   g = ev.Graphics;
            float      y = 50;
            float      x = 0;
            string     str;
            float      sizeW;       //used when measuring text for placement
            Font       fontTitle   = new Font(FontFamily.GenericSansSerif, 11, FontStyle.Bold);
            Font       fontHeading = new Font(FontFamily.GenericSansSerif, 9, FontStyle.Bold);
            Font       font        = new Font(FontFamily.GenericSansSerif, 8);
            SolidBrush brush       = new SolidBrush(Color.Black);

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

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

            if (patPlanList.Length == 0)
            {
                str = Lan.g(this, "none");
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            for (int i = 0; i < patPlanList.Length; i++)
            {
                plan    = InsPlans.GetPlan(patPlanList[i].PlanNum, plans);
                carrier = Carriers.GetCarrier(plan.CarrierNum);
                str     = carrier.CarrierName;
                g.DrawString(str, fontHeading, brush, x, y);
                y         += 18;
                subscriber = fam.GetNameInFamFL(plan.Subscriber);
                if (subscriber == "")               //subscriber from another family
                {
                    subscriber = Patients.GetLim(plan.Subscriber).GetNameLF();
                }
                str = Lan.g(this, "Subscriber:") + " " + subscriber;
                g.DrawString(str, font, brush, x, y);
                y += 15;
                bool isFamMax = Benefits.GetIsFamMax(benefits, plan.PlanNum);
                str = "";
                if (isFamMax)
                {
                    str += Lan.g(this, "Family ");
                }
                str += Lan.g(this, "Annual Max:") + " ";
                max  = Benefits.GetAnnualMax(benefits, plan.PlanNum, patPlanList[i].PatPlanNum);
                if (max != -1)
                {
                    str += max.ToString("n0") + " ";
                }
                str += "   ";
                bool isFamDed = Benefits.GetIsFamDed(benefits, plan.PlanNum);
                if (isFamDed)
                {
                    str += Lan.g(this, "Family ");
                }
                str   += Lan.g(this, "Deductible:") + " ";
                deduct = Benefits.GetDeductible(benefits, plan.PlanNum, patPlanList[i].PatPlanNum);
                if (deduct != -1)
                {
                    str += deduct.ToString("n0");
                }
                g.DrawString(str, font, brush, x, y);
                y  += 15;
                str = "";
                for (int j = 0; j < benefits.Length; j++)
                {
                    if (benefits[j].PlanNum != plan.PlanNum)
                    {
                        continue;
                    }
                    if (benefits[j].BenefitType != InsBenefitType.Percentage)
                    {
                        continue;
                    }
                    if (str != "")
                    {
                        str += ",  ";
                    }
                    str += CovCats.GetDesc(benefits[j].CovCatNum) + " " + benefits[j].Percent.ToString() + "%";
                }
                if (str != "")
                {
                    g.DrawString(str, font, brush, x, y);
                    y += 15;
                }
                double pend = 0;
                double used = 0;
                if (isFamMax || isFamDed)
                {
                    ClaimProc[] claimProcsFam = ClaimProcs.RefreshFam(plan.PlanNum);
                    used = InsPlans.GetInsUsed(claimProcsFam, date, plan.PlanNum, patPlanList[i].PatPlanNum, -1, plans, benefits);
                    pend = InsPlans.GetPending(claimProcsFam, date, plan, patPlanList[i].PatPlanNum, -1, benefits);
                }
                else
                {
                    used = InsPlans.GetInsUsed(claimProcList, date, plan.PlanNum, patPlanList[i].PatPlanNum, -1, plans, benefits);
                    pend = InsPlans.GetPending(claimProcList, date, plan, patPlanList[i].PatPlanNum, -1, benefits);
                }
                str = Lan.g(this, "Ins Used:") + " " + used.ToString("n");
                g.DrawString(str, font, brush, x, y);
                y  += 15;
                str = Lan.g(this, "Ins Pending:") + " " + pend.ToString("n");
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            y += 10;
            //Account Info---------------------------------------------------------------------------------------------------
            g.DrawLine(Pens.Black, 75, y, 775, y);
            str = Lan.g(this, "Account Info");
            g.DrawString(str, fontHeading, brush, x, y);
            y  += 18;
            str = Lan.g(this, "Guarantor:") + " " + fam.List[0].GetNameFL();
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Balance:") + (fam.List[0].BalTotal - fam.List[0].InsEst).ToString("c");
            if (fam.List[0].InsEst > .01)
            {
                str += "  (" + fam.List[0].BalTotal.ToString("c") + " - "
                       + fam.List[0].InsEst.ToString("c") + " " + Lan.g(this, "InsEst") + ")";
            }
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Aging:")
                  + "  0-30:" + fam.List[0].Bal_0_30.ToString("c")
                  + "  31-60:" + fam.List[0].Bal_31_60.ToString("c")
                  + "  61-90:" + fam.List[0].Bal_61_90.ToString("c")
                  + "  90+:" + fam.List[0].BalOver90.ToString("c");
            g.DrawString(str, font, brush, x, y);
            y  += 15;
            str = Lan.g(this, "Fam Urgent Fin Note:")
                  + fam.List[0].FamFinUrgNote;
            g.DrawString(str, font, brush, x, y);
            y += 15;
            y += 10;
            //Treatment Plan--------------------------------------------------------------------------------------------------
            g.DrawLine(Pens.Black, 75, y, 775, y);
            str = Lan.g(this, "Treatment Plan");
            g.DrawString(str, fontHeading, brush, x, y);
            y += 18;
            for (int i = 0; i < procsAll.Length; i++)
            {
                if (procsAll[i].ProcStatus != ProcStat.TP)
                {
                    continue;
                }
                str = Procedures.GetDescription(procsAll[i]);
                g.DrawString(str, font, brush, x, y);
                y += 15;
            }
            pagesPrinted++;
            if (pagesPrinted == Appts.Length)
            {
                ev.HasMorePages = false;
                pagesPrinted    = 0;
            }
            else
            {
                ev.HasMorePages = true;
            }
        }
示例#14
0
        private void butSend_Click(object sender, EventArgs ea)
        {
            if (gridMain.SelectedIndices.Length != 1)
            {
                MsgBox.Show(this, "Exactly one Rx must be selected.");
                return;
            }
            Pharmacy      pharmacy = Pharmacies.GetOne(listRx[gridMain.SelectedIndices[0]].PharmacyNum);
            StringBuilder strb     = new StringBuilder();
            //These characters will be replaced in a production by unprintable characters, but hardcoded for debugging.
            char   f = ':';        //separates fields within a composite element
            char   e = '+';        //(separates composite elements) SureScripts may require an unprintable character here.
            char   d = '.';        //decimal notation
            char   r = '/';        //release indicator
            char   p = '*';        //repetition separator
            string s = "'\r\n";    //segment separator

                        #if DEBUG
            if (true)
            {
                //Set false if you want to use unprintable characters to simulate running in release mode.
            }
            else
            {
                //f=''; we don't know the values for these characters yet.
                //e='';
                //d='';
                //r='';
                //p='';
                //s='';
            }
                        #else
            //f=''; we don't know the values for these characters yet.
            //e='';
            //d='';
            //r='';
            //p='';
            //s='';
                        #endif
            RxPat          rx          = listRx[gridMain.SelectedIndices[0]];
            Patient        pat         = Patients.GetPat(rx.PatNum);
            Provider       prov        = Providers.GetProv(rx.ProvNum);
            PatPlan        patPlan     = PatPlans.GetPatPlan(pat.PatNum, 1);
            Family         fam         = Patients.GetFamily(pat.PatNum);
            List <InsSub>  subList     = InsSubs.RefreshForFam(fam);
            List <InsPlan> planList    = InsPlans.RefreshForSubList(subList);
            InsSub         sub         = InsSubs.GetOne(patPlan.InsSubNum);
            InsPlan        plan        = InsPlans.GetPlan(sub.PlanNum, planList);
            Carrier        car         = Carriers.GetCarrier(plan.CarrierNum);
            DateTime       msgTimeSent = DateTime.Now;
            //Hardcoded values should never change. Ex:Message type, version, release should always be SCRIPT:010:006
            //Hardcoded values allowed to change until released version.
            //UNA:+./*'------------------------------------------------------------------------------------------------
            strb.Append("UNA" + f + e + d + r + p + s);
            //UIB+UNOA:0++1234567+++77777777:C:PASSWORDQ+7701630:P+19971001:081522'------------------------------------
            strb.Append("UIB" + e);                                                                                                //000
            strb.Append("UNOA" + f + "0" + e);                                                                                     //010 Syntax identifier and version
            strb.Append(e);                                                                                                        //020 not used
            strb.Append(Sout(POut.Long(rx.RxNum)) + e);                                                                            //030 Transaction reference (Clinic system trace number.) Sender creates a Unique Trace number for each message sent.
            strb.Append(e);                                                                                                        //040 not used
            strb.Append(e);                                                                                                        //050 not used
            strb.Append("56873771" + f + "C" + f + "PASSWORDQ" + e);                                                               //060 Sender identification (This is the Clinic ID of the sender; C means it is a Clinic.)
            strb.Append(Sout(pharmacy.PharmID) + f + "P" + e);                                                                     //070 Recipient ID (NCPDP Provider ID Number of pharmacy; P means it is a pharmacy.)
            strb.Append(Sout(msgTimeSent.ToString("yyyyMMdd")) + f + Sout(msgTimeSent.ToString("HHmmss")) + s);                    //080 Date of initiation CCYYMMDD:HHMMSS,S
            //UIH+SCRIPT:010:006:NEWRX+110072+++19971001:081522'-------------------------------------------------------
            strb.Append("UIH" + e);                                                                                                //000
            strb.Append("SCRIPT" + f + "010" + f + "006" + f + "NEWRX" + e);                                                       //010 Message type:version:release:function.
            //Clinic's reference number for message. Usually this is the folio number for the patient. However, this is the ID by which the clinic will be able to refer to this prescription.
            strb.Append(Sout(rx.RxNum.ToString()) + e);                                                                            //020 Message reference number (Must match number in UIT segment below, must be unique. Recommend using rx num)
            strb.Append(e);                                                                                                        //030 conditional Dialogue Reference
            strb.Append(e);                                                                                                        //040 not used
            strb.Append(Sout(msgTimeSent.ToString("yyyyMMdd")) + f + Sout(msgTimeSent.ToString("HHmmss")) + s);                    //050 Date of initiation
            //PVD+P1+7701630:D3+++++MAIN STREET PHARMACY++6152205656:TE'-----------------------------------------------
            strb.Append("PVD" + e);                                                                                                //000
            strb.Append("P1" + e);                                                                                                 //010 Provider coded (see external code list pg.109)
            strb.Append(Sout(pharmacy.PharmID) + f + "D3" + e);                                                                    //020 Reference number and qualifier (Pharmacy ID)
            strb.Append(e);                                                                                                        //030 not used
            strb.Append(e);                                                                                                        //040 conditional Provider specialty
            strb.Append(e);                                                                                                        //050 conditional The name of the prescriber or pharmacist or supervisor
            strb.Append(e);                                                                                                        //060 not used
            strb.Append(e);                                                                                                        //070 conditional The clinic or pharmacy name
            strb.Append(Sout(pharmacy.Address) + f + Sout(pharmacy.City) + f + Sout(pharmacy.State) + f + Sout(pharmacy.Zip) + e); //080 Address
            strb.Append(Regex.Replace(Sout(pharmacy.Phone), @"[-()]", string.Empty) + f + "TE" + s);                               //090 Communication number and qualifier
            //PVD+PC+6666666:0B+++JONES:MARK++++6152219800:TE'---------------------------------------------------------
            strb.Append("PVD" + e);                                                                                                //000
            strb.Append("PC" + e);                                                                                                 //010 Provider coded
            strb.Append(Sout(prov.StateRxID) + f + "0B" + e);                                                                      //020 Reference number and qualifier (0B: Provider State License Number)
            strb.Append(e);                                                                                                        //030 not used
            strb.Append(e);                                                                                                        //040 conditional Provider specialty
            strb.Append(Sout(prov.LName) + f + Sout(prov.FName) + e);                                                              //050 The name of the prescriber or pharmacist or supervisor
            strb.Append(e);                                                                                                        //060 not used
            strb.Append(e);                                                                                                        //070 conditional The clinic or pharmacy name
            strb.Append(e);                                                                                                        //080 conditional Address
            strb.Append(Regex.Replace(Sout(PrefC.GetString(PrefName.PracticePhone)), @"[-()]", string.Empty) + f + "TE" + s);      //090 Communication number and qualifier
            //PTT++19541225+SMITH:MARY+F+333445555:SY'-----------------------------------------------------------------
            strb.Append("PTT" + e);                                                                                                //000
            strb.Append(e);                                                                                                        //010 conditional Individual relationship
            strb.Append(Sout(pat.Birthdate.ToString("yyyyMMdd")) + e);                                                             //020 Birth date of patient YYYYMMDD
            strb.Append(Sout(pat.LName) + f + Sout(pat.FName) + e);                                                                //030 Name
            strb.Append(Sout(pat.Gender.ToString().Substring(0, 1)) + e);                                                          //040 Gender (M,F,U)
            strb.Append(Sout(pat.SSN.Replace("-", "")) + f + "SY" + s);                                                            //050 Patient ID and/or SSN and qualifier
            //COO+123456:BO+INSURANCE COMPANY NAME++123456789++AA112'--------------------------------------------------
            strb.Append("COO" + e);                                                                                                //000
            strb.Append(Sout(plan.RxBIN) + f + "BO" + e);                                                                          //010 Payer ID Information and qualifier (Primary Payer's identification number? BO is for BIN Location Number.)
            strb.Append(Sout(car.CarrierName) + e);                                                                                //020 Payer name
            strb.Append(e);                                                                                                        //030 conditional Service type, coded
            strb.Append(Sout(sub.SubscriberID) + e);                                                                               //040 Cardholder ID
            strb.Append(e);                                                                                                        //050 conditional Cardholder name
            strb.Append(Sout(plan.GroupNum) + s);                                                                                  //060 Group ID
            //DRU------------------------------------------------------------------------------------------------------
            //DRU+P:CALAN SR 240MG::::240:::::::AA:C42998:AB:C28253+::60:38:AC:C48542+:1 TID -TAKE ONE TABLET TWO TIMES A DAY UNTIL GONE+85:19971001:102*ZDS:30:804+0+R:1'
            strb.Append("DRU" + e);          //000
            //P means prescribed. Drug prescribed is Calan Sr 240mg.
            //240 is the strength (free text); AA is the Source for NCI Pharmaceutical Dosage Form. C42998 is the code for “Tablet dosing form”.
            //AB is the Source for NCI Units of Presentation. C28253 is the code for “Milligram”. So this means the prescription is for 240mg tablets.
            //There's AA, AB and AC - AC is Potency Unit
            //The definitions for C42998 and C28253 and be found @ http://nciterms.nci.nih.gov/ncitbrowser/pages/vocabulary.jsf?dictionary=NCI_Thesaurus
            strb.Append("P" + f + Sout(rx.Drug) + f + f + f + f + f + f + Sout(rx.RxCui.ToString()) + f + "SBD" + e); //f+f+f+f+"AA"+f+"C42998"+f+"AB"+f+"C28253"+e);//010 Item Description Identification
            //This means dispense 60 tablets. 38 is the code value for Original Qty. AC is the Source for NCI Potency Units. C48542 is the code for “Tablet dosing unit”.
            strb.Append("" + f + f + Sout(rx.Disp) + f + f + "AA" + f + Sout(rx.DosageCode) + e);                     //020 Quantity
            strb.Append(f + Sout(rx.Sig) + e);                                                                        //030 Directions
            //85 qualifier for Date Issued (Written date) 102 is qualifier for CCYYMMDD format.
            //ZDS is the qualifier for Days Supply. 30 is the number of days supply. 804 is the qualifier for Quantity of Days.
            strb.Append("85" + f + Sout(rx.RxDate.ToString("yyyyMMdd")) + f + "102" + e); //+p+"ZDS"+f+"30"+f+"804"+e);//040 Date Note: It is strongly recommended that Days Supply (value “ZDS”) be supported.
            strb.Append("0" + e);                                                         //050 Product/Service substitution, coded
            strb.Append("R" + f + Sout(rx.Refills) + s);                                  //060 Refill and quantity
            //UIT+110072+6'---------------------------------------------------------------------------------------------
            strb.Append("UIT" + e);                                                       //000
            strb.Append(Sout(rx.RxNum.ToString()) + e);                                   //010 Message reference number
            strb.Append("5" + s);                                                         //020 Mandatory field. This is the count of the number of segments in the message including the UIH and UIT
            //UIZ++1'---------------------------------------------------------------------------------------------------
            strb.Append("UIZ" + e);                                                       //000
            strb.Append(e);                                                               //010 not used
            strb.Append("1" + s);                                                         //020 Number of messages per interchange. The count of UIH-UIT occurrences
            //Uncomment if you want to see the message text:
            //MsgBoxCopyPaste msgbox=new MsgBoxCopyPaste(strb.ToString());
            //msgbox.ShowDialog();
            Cursor = Cursors.WaitCursor;
            try {
                                #if EHRTEST
                EHR.EhrEmail.Send("10.6 SCRIPT for NEWRX", "SCRIPT.txt", strb.ToString());
                                #else
                //can't send email unless in debug/ehrtest mode.
                                #endif
            }
            catch (Exception ex) {
                Cursor = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            Cursor = Cursors.Default;
            MessageBox.Show("Sent");
            rx.SendStatus = RxSendStatus.SentElect;          //Removes the Rx from the grid.
            RxPats.Update(rx);
            FillGrid();
        }
示例#15
0
        private bool VerifyCarrierCombineData(long pickedCarrierNum, List <long> pickedCarrierNums)
        {
            List <Carrier> listCarriers = Carriers.GetCarriers(pickedCarrierNums);
            List <string>  listWarnings = new List <string>();
            Carrier        carCur       = listCarriers.FirstOrDefault(x => x.CarrierNum == pickedCarrierNum);

            if (carCur == null)           //In case it wasn't included in the list of picked carrier nums.
            {
                carCur = Carriers.GetCarrier(pickedCarrierNum);
            }
            if (carCur == null)           //In case it is a completely invalid carrier
            {
                return(false);            //should never happen.
            }
            //==================== NAME ====================
            if (listCarriers.Any(x => x.CarrierName != carCur.CarrierName && !string.IsNullOrWhiteSpace(x.CarrierName)))
            {
                listWarnings.Add(Lan.g(this, "Carrier Name"));
            }
            //==================== ADDRESS INFO ====================
            if (listCarriers.Any(x => x.Address != carCur.Address && !string.IsNullOrWhiteSpace(x.Address)) ||
                listCarriers.Any(x => x.Address2 != carCur.Address2 && !string.IsNullOrWhiteSpace(x.Address2)) ||
                listCarriers.Any(x => x.City != carCur.City && !string.IsNullOrWhiteSpace(x.City)) ||
                listCarriers.Any(x => x.State != carCur.State && !string.IsNullOrWhiteSpace(x.State)) ||
                listCarriers.Any(x => x.Zip != carCur.Zip && !string.IsNullOrWhiteSpace(x.Zip)))
            {
                listWarnings.Add(Lan.g(this, "Carrier Address"));
            }
            //==================== PHONE ====================
            if (listCarriers.Any(x => x.Phone != carCur.Phone && !string.IsNullOrWhiteSpace(x.Phone)))
            {
                listWarnings.Add(Lan.g(this, "Carrier Phone"));
            }
            //==================== ElectID ====================
            if (listCarriers.Any(x => x.ElectID != carCur.ElectID && !string.IsNullOrWhiteSpace(x.ElectID)))
            {
                listWarnings.Add(Lan.g(this, "Carrier ElectID"));
            }
            //==================== TIN ====================
            if (listCarriers.Any(x => x.TIN != carCur.TIN && !string.IsNullOrWhiteSpace(x.TIN)))
            {
                listWarnings.Add(Lan.g(this, "Carrier TIN"));
            }
            //==================== CDAnetVersion ====================
            if (listCarriers.Any(x => x.CDAnetVersion != carCur.CDAnetVersion && !string.IsNullOrWhiteSpace(x.CDAnetVersion)))
            {
                listWarnings.Add(Lan.g(this, "Carrier CDAnet Version"));
            }
            //==================== IsCDA ====================
            if (listCarriers.Any(x => x.IsCDA != carCur.IsCDA))
            {
                listWarnings.Add(Lan.g(this, "Carrier Is CDA"));
            }
            //==================== CanadianNetworkNum ====================
            if (listCarriers.Any(x => x.CanadianNetworkNum != carCur.CanadianNetworkNum))
            {
                listWarnings.Add(Lan.g(this, "Canadian Network"));
            }
            //==================== NoSendElect ====================
            if (listCarriers.Any(x => x.NoSendElect != carCur.NoSendElect))
            {
                listWarnings.Add(Lan.g(this, "Send Elect"));
            }
            //==================== IsHidden ====================
            if (listCarriers.Any(x => x.IsHidden != carCur.IsHidden))
            {
                listWarnings.Add(Lan.g(this, "Is Hidden"));
            }
            //==================== CanadianEncryptionMethod ====================
            if (listCarriers.Any(x => x.CanadianEncryptionMethod != carCur.CanadianEncryptionMethod))
            {
                listWarnings.Add(Lan.g(this, "Canadian Encryption Method"));
            }
            //==================== CanadianSupportedTypes ====================
            if (listCarriers.Any(x => x.CanadianSupportedTypes != carCur.CanadianSupportedTypes))
            {
                listWarnings.Add(Lan.g(this, "Canadian Supported Types"));
            }
            //==================== Additional fields ====================
            //If anyone asks for them, these fields can also be checked.
            // public long							SecUserNumEntry;
            // public DateTime					SecDateEntry;
            // public DateTime					SecDateTEdit;
            //====================USER PROMPT====================
            if (listWarnings.Count > 0)
            {
                string warningMessage = Lan.g(this, "WARNING!") + " " + Lan.g(this, "Mismatched data has been detected between selected carriers") + ":\r\n\r\n"
                                        + string.Join("\r\n", listWarnings) + "\r\n\r\n"
                                        + Lan.g(this, "Would you like to continue combining carriers anyway?");
                if (MessageBox.Show(warningMessage, "", MessageBoxButtons.YesNo) != DialogResult.Yes)
                {
                    return(false);
                }
            }
            return(true);
        }