Ejemplo n.º 1
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            SelectedPatNum = PIn.PInt(table.Rows[e.Row]["PatNum"].ToString());
            Recall[]           recalls = Recalls.GetList(new int[] { SelectedPatNum });
            FormRecallListEdit FormRE  = new FormRecallListEdit(recalls[0]);

            FormRE.ShowDialog();
            if (FormRE.PinClicked)
            {
                PinClicked   = true;
                AptSelected  = FormRE.AptSelected;
                DialogResult = DialogResult.OK;
                return;
            }
            else
            {
                FillMain();
            }
            for (int i = 0; i < gridMain.Rows.Count; i++)
            {
                if (PIn.PInt(table.Rows[i]["PatNum"].ToString()) == SelectedPatNum)
                {
                    gridMain.SetSelected(i, true);
                }
            }
            SetFamilyColors();
        }
Ejemplo n.º 2
0
        private void butRecall_Click(object sender, System.EventArgs e)
        {
            Procedure[] procList   = Procedures.Refresh(PatCur.PatNum);
            Recall[]    recallList = Recalls.GetList(new int[] { PatCur.PatNum });     //get the recall for this pt
            if (recallList.Length == 0)
            {
                MsgBox.Show(this, "This patient does not have any recall due.");
                return;
            }
            Recall recallCur = recallList[0];

            InsPlan[]   planList = InsPlans.Refresh(FamCur);
            Appointment apt      = Appointments.CreateRecallApt(PatCur, procList, recallCur, planList);

            AptSelected = apt.AptNum;
            oResult     = OtherResult.PinboardAndSearch;
            if (recallCur.DateDue < DateTime.Today)
            {
                DateJumpToString = DateTime.Today.ToShortDateString();              //they are overdue
            }
            else
            {
                DateJumpToString = recallCur.DateDue.ToShortDateString();
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 3
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;
            }
        }
Ejemplo n.º 4
0
        ///<summary>Creates appointments for each patient in _famCur.  MsgBox informs user of anyone skipped.  StringDateJumpTo will contain the due date (of the last family member) to jump to.  ListAptNumsSelected will contain the AptNums of the new appointments on the pinboard.</summary>
        public void MakeRecallFamily()
        {
            List <Recall>  listPatRecalls;
            List <InsPlan> listInsPlans;
            List <InsSub>  listInsSubs;
            Appointment    apt = null;
            Recall         recall;
            int            countAlreadySched           = 0;
            int            countNoRecalls              = 0;
            int            countPatsRestricted         = 0;
            int            countPatsArchivedOrDeceased = 0;

            for (int i = 0; i < _famCur.ListPats.Length; i++)
            {
                Patient patCur = _famCur.ListPats[i];
                if (PatRestrictionL.IsRestricted(patCur.PatNum, PatRestrict.ApptSchedule, true))
                {
                    countPatsRestricted++;
                    continue;
                }
                if (patCur.PatStatus.In(PatientStatus.Archived, PatientStatus.Deceased))
                {
                    countPatsArchivedOrDeceased++;
                    continue;
                }
                listPatRecalls = Recalls.GetList(patCur.PatNum);              //get the recall for this pt
                //Check to see if the special type recall is disabled or already scheduled.  This is also done in AppointmentL.CreateRecallApt() below so I'm
                //	not sure why we do it here.
                List <Recall> listRecalls = listPatRecalls.FindAll(x => x.RecallTypeNum == RecallTypes.PerioType || x.RecallTypeNum == RecallTypes.ProphyType);
                if (listRecalls.Count == 0 || listRecalls.Exists(x => x.IsDisabled))
                {
                    countNoRecalls++;
                    continue;
                }
                if (listRecalls.Exists(x => x.DateScheduled.Year > 1880))
                {
                    countAlreadySched++;
                    continue;
                }
                listInsSubs  = InsSubs.RefreshForFam(_famCur);
                listInsPlans = InsPlans.RefreshForSubList(listInsSubs);
                try {
                    apt = AppointmentL.CreateRecallApt(patCur, listInsPlans, -1, listInsSubs);
                }
                catch (Exception ex) {
                    ex.DoNothing();
                    continue;
                }
                ListAptNumsSelected.Add(apt.AptNum);
                _otherResult = OtherResult.PinboardAndSearch;
                recall       = Recalls.GetRecallProphyOrPerio(patCur.PatNum);        //should not return null
                if (recall.DateDue < DateTime.Today)
                {
                    StringDateJumpTo = DateTime.Today.ToShortDateString();                  //they are overdue
                }
                else
                {
                    StringDateJumpTo = recall.DateDue.ToShortDateString();
                }
                //Log will be made when appointment dragged off of the pinboard.
                //SecurityLogs.MakeLogEntry(Permissions.AppointmentCreate,apt.PatNum,apt.AptDateTime.ToString(),apt.AptNum);
            }
            List <string> listUserMsgs = new List <string>();

            if (countPatsRestricted > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped due to patient restriction") + " "
                                 + PatRestrictions.GetPatRestrictDesc(PatRestrict.ApptSchedule) + ": " + countPatsRestricted + ".");
            }
            if (countNoRecalls > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped because recall disabled") + ": " + countNoRecalls + ".");
            }
            if (countAlreadySched > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped because already scheduled") + ": " + countAlreadySched + ".");
            }
            if (countPatsArchivedOrDeceased > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped because status is archived or deceased") + ": " + countPatsArchivedOrDeceased + ".");
            }
            if (ListAptNumsSelected.Count == 0)
            {
                listUserMsgs.Add(Lan.g(this, "There are no recall appointments to schedule."));
            }
            if (listUserMsgs.Count > 0)
            {
                MessageBox.Show(string.Join("\r\n", listUserMsgs));
                if (ListAptNumsSelected.Count == 0)
                {
                    return;
                }
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 5
0
        private void FillFamily()
        {
            PatNumSelected = _patCur.PatNum;          //just in case user has selected a different family member
            _listRecalls   = Recalls.GetList(_famCur.ListPats.ToList());
            //Appointment[] aptsOnePat;
            List <PatientLink> listLinks = PatientLinks.GetLinks(_famCur.ListPats.Select(x => x.PatNum).ToList(), PatientLinkType.Merge);

            listViewFamily.Items.Clear();
            ListViewItem item;
            DateTime     dateDue;
            DateTime     dateSched;

            for (int i = 0; i < _famCur.ListPats.Length; i++)
            {
                if (PatientLinks.WasPatientMerged(_famCur.ListPats[i].PatNum, listLinks))
                {
                    continue;                    //Do not include Merged patients in the displayed list.
                }
                item     = new ListViewItem(_famCur.GetNameInFamFLI(i));
                item.Tag = _famCur.ListPats[i];
                if (_famCur.ListPats[i].PatNum == _patCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(_famCur.ListPats[i].Age.ToString());
                item.SubItems.Add(_famCur.ListPats[i].Gender.ToString());
                dateDue   = DateTime.MinValue;
                dateSched = DateTime.MinValue;
                bool isdisabled = false;
                for (int j = 0; j < _listRecalls.Count; j++)
                {
                    if (_listRecalls[j].PatNum == _famCur.ListPats[i].PatNum &&
                        (_listRecalls[j].RecallTypeNum == RecallTypes.PerioType ||
                         _listRecalls[j].RecallTypeNum == RecallTypes.ProphyType))
                    {
                        dateDue    = _listRecalls[j].DateDue;
                        dateSched  = _listRecalls[j].DateScheduled;
                        isdisabled = _listRecalls[j].IsDisabled;
                    }
                }
                if (isdisabled)
                {
                    item.SubItems.Add(Lan.g(this, "disabled"));
                }
                else if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                if (dateSched.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateSched.ToShortDateString());
                }
                listViewFamily.Items.Add(item);
            }
            checkDone.Checked = _patCur.PlannedIsDone;
            textFinUrg.Text   = _famCur.ListPats[0].FamFinUrgNote;
        }
Ejemplo n.º 6
0
        private void FillGrid()
        {
            Recalls.Synch(PatNum);
            RecallList = Recalls.GetList(PatNum);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableRecallsPat", "Type"), 90);

            gridMain.Columns.Add(col);
            //col=new ODGridColumn(Lan.g("TableRecallsPat","Disabled"),60,HorizontalAlignment.Center);
            //gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallsPat", "PreviousDate"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallsPat", "Due Date"), 80);
            gridMain.Columns.Add(col);
            //col=new ODGridColumn(Lan.g("TableRecallsPat","Sched Date"),80);
            //gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallsPat", "Interval"), 70);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallsPat", "Status"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallsPat", "Note"), 100);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow  row;
            ODGridCell cell;

            IsPerio       = false;
            butPerio.Text = Lan.g(this, "Set Perio");
            string cellStr;

            for (int i = 0; i < RecallList.Count; i++)
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallList[i].RecallTypeNum)
                {
                    IsPerio       = true;
                    butPerio.Text = Lan.g(this, "Set Prophy");
                }
                row = new ODGridRow();
                row.Cells.Add(RecallTypes.GetDescription(RecallList[i].RecallTypeNum));
                //if(RecallList[i].IsDisabled){
                //	row.Cells.Add("X");
                //}
                //else{
                //	row.Cells.Add("");
                //}
                if (RecallList[i].DatePrevious.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(RecallList[i].DatePrevious.ToShortDateString());
                }
                if (RecallList[i].DateDue.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    cell = new ODGridCell(RecallList[i].DateDue.ToShortDateString());
                    if (RecallList[i].DateDue < DateTime.Today)
                    {
                        cell.Bold      = YN.Yes;
                        cell.ColorText = Color.Firebrick;
                    }
                    row.Cells.Add(cell);
                }
                //row.Cells.Add("");//sched
                row.Cells.Add(RecallList[i].RecallInterval.ToString());
                row.Cells.Add(DefC.GetValue(DefCat.RecallUnschedStatus, RecallList[i].RecallStatus));
                cellStr = "";
                if (RecallList[i].IsDisabled)
                {
                    cellStr += Lan.g(this, "Disabled");
                }
                if (RecallList[i].DisableUntilDate.Year > 1880)
                {
                    if (cellStr != "")
                    {
                        cellStr += ", ";
                    }
                    cellStr += Lan.g(this, "Disabled until ") + RecallList[i].DisableUntilDate.ToShortDateString();
                }
                if (RecallList[i].DisableUntilBalance > 0)
                {
                    if (cellStr != "")
                    {
                        cellStr += ", ";
                    }
                    cellStr += Lan.g(this, "Disabled until balance ") + RecallList[i].DisableUntilBalance.ToString("c");
                }
                if (RecallList[i].Note != "")
                {
                    if (cellStr != "")
                    {
                        cellStr += ", ";
                    }
                    cellStr += RecallList[i].Note;
                }
                row.Cells.Add(cellStr);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Ejemplo n.º 7
0
        private void Filltb()
        {
            SelectedPatNum = PatCur.PatNum;          //just in case user has selected a different family member
            RecallList     = Recalls.GetList(FamCur.List);
            Appointment[] aptsOnePat;
            listFamily.Items.Clear();
            ListViewItem item;
            DateTime     dateDue;

            for (int i = 0; i < FamCur.List.Length; i++)
            {
                item = new ListViewItem(FamCur.GetNameInFamFLI(i));
                if (FamCur.List[i].PatNum == PatCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(FamCur.List[i].Age.ToString());
                item.SubItems.Add(FamCur.List[i].Gender.ToString());
                dateDue = DateTime.MinValue;
                for (int j = 0; j < RecallList.Length; j++)
                {
                    if (RecallList[j].PatNum == FamCur.List[i].PatNum)
                    {
                        dateDue = RecallList[j].DateDue;
                    }
                }
                if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                aptsOnePat = Appointments.GetForPat(FamCur.List[i].PatNum);
                for (int a = 0; a < aptsOnePat.Length; a++)
                {
                    if (aptsOnePat[a].AptDateTime.Date <= DateTime.Today)
                    {
                        continue;                        //disregard old appts.
                    }
                    item.SubItems.Add(aptsOnePat[a].AptDateTime.ToShortDateString());
                    break;                    //we only want one appt
                    //could add condition here to add blank subitem if no date found
                }
                listFamily.Items.Add(item);
            }
            if (PatCur.NextAptNum == -1)
            {
                checkDone.Checked = true;
            }
            else
            {
                checkDone.Checked = false;
            }
            ListOth = Appointments.GetForPat(PatCur.PatNum);
            tbApts.ResetRows(ListOth.Length);
            tbApts.SetGridColor(Color.DarkGray);
            for (int i = 0; i < ListOth.Length; i++)
            {
                tbApts.Cell[0, i] = ListOth[i].AptStatus.ToString();
                if (ListOth[i].AptDateTime.Year > 1880)
                {
                    //only regular still scheduled appts
                    if (ListOth[i].AptStatus != ApptStatus.Planned && ListOth[i].AptStatus != ApptStatus.PtNote &&
                        ListOth[i].AptStatus != ApptStatus.PtNoteCompleted && ListOth[i].AptStatus != ApptStatus.UnschedList &&
                        ListOth[i].AptStatus != ApptStatus.Broken)
                    {
                        tbApts.Cell[1, i] = ListOth[i].AptDateTime.ToString("d");
                        tbApts.Cell[2, i] = ListOth[i].AptDateTime.ToString("t");
                        if (ListOth[i].AptDateTime < DateTime.Today)                          //Past
                        {
                            tbApts.SetBackColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][11].ItemColor));
                            tbApts.SetTextColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][10].ItemColor));
                        }
                        else if (ListOth[i].AptDateTime.Date == DateTime.Today.Date)                          //Today
                        {
                            tbApts.SetBackColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][9].ItemColor));
                            tbApts.SetTextColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][8].ItemColor));
                            tbApts.Cell[0, i] = Lan.g(this, "Today");
                        }
                        else if (ListOth[i].AptDateTime > DateTime.Today)                          //Future
                        {
                            tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][13].ItemColor);
                            tbApts.SetTextColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][12].ItemColor));
                        }
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.Planned)                      //show line for planned appt
                    {
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][16].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][17].ItemColor);
                        tbApts.Cell[0, i] = Lan.g("enumApptStatus", "Planned");
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.PtNote)
                    {
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][18].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][19].ItemColor);
                        tbApts.Cell[0, i] = Lan.g("enumApptStatus", "PtNote");
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.PtNoteCompleted)
                    {
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][20].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][21].ItemColor);
                        tbApts.Cell[0, i] = Lan.g("enumApptStatus", "PtNoteCompleted");
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.Broken | ListOth[i].AptStatus == ApptStatus.UnschedList)
                    {
                        if (ListOth[i].AptStatus == ApptStatus.Broken)
                        {
                            tbApts.Cell[0, i] = Lan.g("enumApptStatus", "Broken");
                        }
                        else
                        {
                            tbApts.Cell[0, i] = Lan.g("enumApptStatus", "UnschedList");
                        }
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][14].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][15].ItemColor);
                    }
                }
                else
                {
                    tbApts.Cell[1, i] = "";
                    tbApts.Cell[2, i] = "";
                }
                tbApts.Cell[3, i] = (ListOth[i].Pattern.Length * 5).ToString();
                tbApts.Cell[4, i] = ListOth[i].ProcDescript;
                tbApts.Cell[5, i] = ListOth[i].Note;
            }
            textFinUrg.Text = PatCur.FamFinUrgNote;
            tbApts.LayoutTables();
        }
Ejemplo n.º 8
0
        private void FillRecall()
        {
            comboStatus.Items.Clear();
            comboStatus.Items.Add(Lan.g(this, "None"));
            comboStatus.SelectedIndex = 0;
            for (int i = 0; i < DefB.Short[(int)DefCat.RecallUnschedStatus].Length; i++)
            {
                comboStatus.Items.Add(DefB.Short[(int)DefCat.RecallUnschedStatus][i].ItemName);
                if (DefB.Short[(int)DefCat.RecallUnschedStatus][i].DefNum == RecallCur.RecallStatus)
                {
                    comboStatus.SelectedIndex = i + 1;
                }
            }
            textNote.Text = RecallCur.Note;
            //Now, the family list:
            listFamily.Items.Clear();
            Appointment[] aptsOnePat;
            ListViewItem  item;

            Recall[] recallList = Recalls.GetList(FamCur.List);
            DateTime dateDue;

            for (int i = 0; i < FamCur.List.Length; i++)
            {
                item = new ListViewItem(FamCur.GetNameInFamFLI(i));
                if (FamCur.List[i].PatNum == PatCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(Shared.AgeToString(FamCur.List[i].Age));
                item.SubItems.Add(FamCur.List[i].Gender.ToString());
                dateDue = DateTime.MinValue;
                for (int j = 0; j < recallList.Length; j++)
                {
                    if (recallList[j].PatNum == FamCur.List[i].PatNum)
                    {
                        dateDue = recallList[j].DateDue;
                    }
                }
                if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                aptsOnePat = Appointments.GetForPat(FamCur.List[i].PatNum);
                for (int a = 0; a < aptsOnePat.Length; a++)
                {
                    if (aptsOnePat[a].AptDateTime.Date <= DateTime.Today)
                    {
                        continue;                        //disregard old appts.
                    }
                    item.SubItems.Add(aptsOnePat[a].AptDateTime.ToShortDateString());
                    break;                    //we only want one appt
                    //could add condition here to add blank subitem if no date found
                }
                listFamily.Items.Add(item);
                //if(Patients.FamilyList[i].PatNum==Patients.Cur.PatNum){
                //	listFamily.Items[i].Selected=true;//doesn't work
                //}
            }
        }
Ejemplo n.º 9
0
        /*
         * ///<summary>Only used in GetSearchResults.  All times between start and stop get set to true in provBarSched.</summary>
         * private static void SetProvBarSched(ref bool[] provBarSched,TimeSpan timeStart,TimeSpan timeStop){
         *      int startI=GetProvBarIndex(timeStart);
         *      int stopI=GetProvBarIndex(timeStop);
         *      for(int i=startI;i<=stopI;i++){
         *              provBarSched[i]=true;
         *      }
         * }
         *
         * private static int GetProvBarIndex(TimeSpan time) {
         *      return (int)(((double)time.Hours*(double)60/(double)PrefC.GetLong(PrefName.AppointmentTimeIncrement)//aptTimeIncr=minutesPerIncr
         +(double)time.Minutes/(double)PrefC.GetLong(PrefName.AppointmentTimeIncrement))
         *(double)ApptDrawing.LineH*ApptDrawing.RowsPerIncr)
         *              /ApptDrawing.LineH;//rounds down
         * }*/

        ///<summary>Used by UI when it needs a recall appointment placed on the pinboard ready to schedule.  This method creates the appointment and attaches all appropriate procedures.  It's up to the calling class to then place the appointment on the pinboard.  If the appointment doesn't get scheduled, it's important to delete it.  If a recallNum is not 0 or -1, then it will create an appt of that recalltype.</summary>
        public static Appointment CreateRecallApt(Patient patCur, List <InsPlan> planList, long recallNum, List <InsSub> subList
                                                  , DateTime aptDateTime = default(DateTime))
        {
            List <Recall> recallList = Recalls.GetList(patCur.PatNum);
            Recall        recallCur  = null;

            if (recallNum > 0)
            {
                recallCur = Recalls.GetRecall(recallNum);
            }
            else
            {
                for (int i = 0; i < recallList.Count; i++)
                {
                    if (recallList[i].RecallTypeNum == RecallTypes.PerioType || recallList[i].RecallTypeNum == RecallTypes.ProphyType)
                    {
                        if (!recallList[i].IsDisabled)
                        {
                            recallCur = recallList[i];
                        }
                        break;
                    }
                }
            }
            if (recallCur == null)
            {
                //Typically never happens because everyone has a recall.  However, it can happen when patients have custom recalls due
                throw new ApplicationException(Lan.g("AppointmentL", "No special type recall is due."));
            }
            if (recallCur.DateScheduled.Date > DateTime.Today)
            {
                throw new ApplicationException(Lan.g("AppointmentL", "Recall has already been scheduled for ") + recallCur.DateScheduled.ToShortDateString());
            }
            Appointment aptCur = new Appointment();

            aptCur.AptDateTime = aptDateTime;
            List <string>    procs     = RecallTypes.GetProcs(recallCur.RecallTypeNum);
            List <Procedure> listProcs = Appointments.FillAppointmentForRecall(aptCur, recallCur, recallList, patCur, procs, planList, subList);

            for (int i = 0; i < listProcs.Count; i++)
            {
                if (Programs.UsingOrion)
                {
                    FormProcEdit FormP = new FormProcEdit(listProcs[i], patCur.Copy(), Patients.GetFamily(patCur.PatNum));
                    FormP.IsNew = true;
                    FormP.ShowDialog();
                    if (FormP.DialogResult == DialogResult.Cancel)
                    {
                        //any created claimprocs are automatically deleted from within procEdit window.
                        try {
                            Procedures.Delete(listProcs[i].ProcNum);                            //also deletes the claimprocs
                        }
                        catch (Exception ex) {
                            MessageBox.Show(ex.Message);
                        }
                    }
                    else
                    {
                        //Do not synch. Recalls based on ScheduleByDate reports in Orion mode.
                        //Recalls.Synch(PatCur.PatNum);
                    }
                }
            }
            return(aptCur);
        }
Ejemplo n.º 10
0
        private void Filltb()
        {
            RecallList = Recalls.GetList(FamCur.List);
            Appointment[] aptsOnePat;
            listFamily.Items.Clear();
            ListViewItem item;
            DateTime     dateDue;

            for (int i = 0; i < FamCur.List.Length; i++)
            {
                item = new ListViewItem(FamCur.GetNameInFamFLI(i));
                if (FamCur.List[i].PatNum == PatCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(FamCur.List[i].Age.ToString());
                item.SubItems.Add(FamCur.List[i].Gender.ToString());
                dateDue = DateTime.MinValue;
                for (int j = 0; j < RecallList.Length; j++)
                {
                    if (RecallList[j].PatNum == FamCur.List[i].PatNum)
                    {
                        dateDue = RecallList[j].DateDue;
                    }
                }
                if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                aptsOnePat = Appointments.GetForPat(FamCur.List[i].PatNum);
                for (int a = 0; a < aptsOnePat.Length; a++)
                {
                    if (aptsOnePat[a].AptDateTime.Date <= DateTime.Today)
                    {
                        continue;                        //disregard old appts.
                    }
                    item.SubItems.Add(aptsOnePat[a].AptDateTime.ToShortDateString());
                    break;                    //we only want one appt
                    //could add condition here to add blank subitem if no date found
                }
                listFamily.Items.Add(item);
            }
            if (PatCur.NextAptNum == -1)
            {
                checkDone.Checked = true;
            }
            else
            {
                checkDone.Checked = false;
            }
            ListOth = Appointments.GetForPat(PatCur.PatNum);
            tbApts.ResetRows(ListOth.Length);
            tbApts.SetGridColor(Color.DarkGray);
            for (int i = 0; i < ListOth.Length; i++)
            {
                tbApts.Cell[0, i] = ListOth[i].AptStatus.ToString();
                if (ListOth[i].AptDateTime.Year > 1880)
                {
                    if (ListOth[i].AptStatus != ApptStatus.Planned)                  //don't show date/time for planned appts.
                    {
                        tbApts.Cell[1, i] = ListOth[i].AptDateTime.ToString("d");
                        tbApts.Cell[2, i] = ListOth[i].AptDateTime.ToString("t");
                    }
                }
                else
                {
                    tbApts.Cell[1, i] = "";
                    tbApts.Cell[2, i] = "";
                }
                tbApts.Cell[3, i] = (ListOth[i].Pattern.Length * 5).ToString();
                tbApts.Cell[4, i] = ListOth[i].ProcDescript;
                tbApts.Cell[5, i] = ListOth[i].Note;
            }
            tbApts.LayoutTables();
        }
Ejemplo n.º 11
0
        /*
         * ///<summary>Only used in GetSearchResults.  All times between start and stop get set to true in provBarSched.</summary>
         * private static void SetProvBarSched(ref bool[] provBarSched,TimeSpan timeStart,TimeSpan timeStop){
         *      int startI=GetProvBarIndex(timeStart);
         *      int stopI=GetProvBarIndex(timeStop);
         *      for(int i=startI;i<=stopI;i++){
         *              provBarSched[i]=true;
         *      }
         * }
         *
         * private static int GetProvBarIndex(TimeSpan time) {
         *      return (int)(((double)time.Hours*(double)60/(double)PrefC.GetLong(PrefName.AppointmentTimeIncrement)//aptTimeIncr=minutesPerIncr
         +(double)time.Minutes/(double)PrefC.GetLong(PrefName.AppointmentTimeIncrement))
         *(double)ApptDrawing.LineH*ApptDrawing.RowsPerIncr)
         *              /ApptDrawing.LineH;//rounds down
         * }*/

        ///<summary>Used by UI when it needs a recall appointment placed on the pinboard ready to schedule.  This method creates the appointment and attaches all appropriate procedures.  It's up to the calling class to then place the appointment on the pinboard.  If the appointment doesn't get scheduled, it's important to delete it.  If a recallNum is not 0 or -1, then it will create an appt of that recalltype.</summary>
        public static Appointment CreateRecallApt(Patient patCur, List <Procedure> procList, List <InsPlan> planList, long recallNum, List <InsSub> subList)
        {
            List <Recall> recallList = Recalls.GetList(patCur.PatNum);
            Recall        recallCur  = null;

            if (recallNum > 0)
            {
                recallCur = Recalls.GetRecall(recallNum);
            }
            else
            {
                for (int i = 0; i < recallList.Count; i++)
                {
                    if (recallList[i].RecallTypeNum == RecallTypes.PerioType || recallList[i].RecallTypeNum == RecallTypes.ProphyType)
                    {
                        if (!recallList[i].IsDisabled)
                        {
                            recallCur = recallList[i];
                        }
                        break;
                    }
                }
            }
            if (recallCur == null)                                                          // || recallCur.DateDue.Year<1880){
            {
                throw new ApplicationException(Lan.g("AppointmentL", "No recall is due.")); //should never happen because everyone has a recall.
            }
            if (recallCur.DateScheduled.Date >= DateTime.Now.Date)
            {
                throw new ApplicationException(Lan.g("AppointmentL", "Recall has already been scheduled for ") + recallCur.DateScheduled.ToShortDateString());
            }
            Appointment AptCur = new Appointment();

            AptCur.PatNum    = patCur.PatNum;
            AptCur.AptStatus = ApptStatus.UnschedList;          //In all places where this is used, the unsched status with no aptDateTime will cause the appt to be deleted when the pinboard is cleared.
            if (patCur.PriProv == 0)
            {
                AptCur.ProvNum = PrefC.GetLong(PrefName.PracticeDefaultProv);
            }
            else
            {
                AptCur.ProvNum = patCur.PriProv;
            }
            AptCur.ProvHyg = patCur.SecProv;
            if (AptCur.ProvHyg != 0)
            {
                AptCur.IsHygiene = true;
            }
            AptCur.ClinicNum = patCur.ClinicNum;
            //whether perio or prophy:
            List <string> procs         = RecallTypes.GetProcs(recallCur.RecallTypeNum);
            string        recallPattern = RecallTypes.GetTimePattern(recallCur.RecallTypeNum);

            if (RecallTypes.IsSpecialRecallType(recallCur.RecallTypeNum) &&
                patCur.Birthdate.AddYears(12) > ((recallCur.DateDue > DateTime.Today)?recallCur.DateDue:DateTime.Today))                  //if pt's 12th birthday falls after recall date. ie younger than 12.
            {
                for (int i = 0; i < RecallTypeC.Listt.Count; i++)
                {
                    if (RecallTypeC.Listt[i].RecallTypeNum == RecallTypes.ChildProphyType)
                    {
                        List <string> childprocs = RecallTypes.GetProcs(RecallTypeC.Listt[i].RecallTypeNum);
                        if (childprocs.Count > 0)
                        {
                            procs = childprocs;                          //overrides adult procs.
                        }
                        string childpattern = RecallTypes.GetTimePattern(RecallTypeC.Listt[i].RecallTypeNum);
                        if (childpattern != "")
                        {
                            recallPattern = childpattern;                          //overrides adult pattern.
                        }
                    }
                }
            }
            //convert time pattern to 5 minute increment
            StringBuilder savePattern = new StringBuilder();

            for (int i = 0; i < recallPattern.Length; i++)
            {
                savePattern.Append(recallPattern.Substring(i, 1));
                if (PrefC.GetLong(PrefName.AppointmentTimeIncrement) == 10)
                {
                    savePattern.Append(recallPattern.Substring(i, 1));
                }
                if (PrefC.GetLong(PrefName.AppointmentTimeIncrement) == 15)
                {
                    savePattern.Append(recallPattern.Substring(i, 1));
                    savePattern.Append(recallPattern.Substring(i, 1));
                }
            }
            if (savePattern.ToString() == "")
            {
                if (PrefC.GetLong(PrefName.AppointmentTimeIncrement) == 15)
                {
                    savePattern.Append("///XXX///");
                }
                else
                {
                    savePattern.Append("//XX//");
                }
            }
            AptCur.Pattern = savePattern.ToString();
            //Add films------------------------------------------------------------------------------------------------------
            if (RecallTypes.IsSpecialRecallType(recallCur.RecallTypeNum))            //if this is a prophy or perio
            {
                for (int i = 0; i < recallList.Count; i++)
                {
                    if (recallCur.RecallNum == recallList[i].RecallNum)
                    {
                        continue;                        //already handled.
                    }
                    if (recallList[i].IsDisabled)
                    {
                        continue;
                    }
                    if (recallList[i].DateDue.Year < 1880)
                    {
                        continue;
                    }
                    if (recallList[i].DateDue > recallCur.DateDue &&              //if film due date is after prophy due date
                        recallList[i].DateDue > DateTime.Today)                         //and not overdue
                    {
                        continue;
                    }
                    //incomplete: exclude manual recall types
                    procs.AddRange(RecallTypes.GetProcs(recallList[i].RecallTypeNum));
                }
            }
            AptCur.ProcDescript = "";
            for (int i = 0; i < procs.Count; i++)
            {
                if (i > 0)
                {
                    AptCur.ProcDescript += ", ";
                }
                AptCur.ProcDescript += ProcedureCodes.GetProcCode(procs[i]).AbbrDesc;
            }
            Appointments.Insert(AptCur);
            Procedure      ProcCur;
            List <PatPlan> patPlanList = PatPlans.Refresh(patCur.PatNum);
            List <Benefit> benefitList = Benefits.Refresh(patPlanList, subList);
            InsPlan        priplan     = null;
            InsSub         prisub      = null;

            if (patPlanList.Count > 0)
            {
                prisub  = InsSubs.GetSub(patPlanList[0].InsSubNum, subList);
                priplan = InsPlans.GetPlan(prisub.PlanNum, planList);
            }
            double insfee;
            double standardfee;

            for (int i = 0; i < procs.Count; i++)
            {
                ProcCur = new Procedure();              //this will be an insert
                //procnum
                ProcCur.PatNum   = patCur.PatNum;
                ProcCur.AptNum   = AptCur.AptNum;
                ProcCur.CodeNum  = ProcedureCodes.GetCodeNum(procs[i]);
                ProcCur.ProcDate = DateTime.Now;
                ProcCur.DateTP   = DateTime.Now;
                //Check if it's a medical procedure.
                bool isMed = false;
                ProcCur.MedicalCode = ProcedureCodes.GetProcCode(ProcCur.CodeNum).MedicalCode;
                if (ProcCur.MedicalCode != null && ProcCur.MedicalCode != "")
                {
                    isMed = true;
                }
                //Get fee schedule for medical or dental.
                long feeSch;
                if (isMed)
                {
                    feeSch = Fees.GetMedFeeSched(patCur, planList, patPlanList, subList);
                }
                else
                {
                    feeSch = Fees.GetFeeSched(patCur, planList, patPlanList, subList);
                }
                //Get the fee amount for medical or dental.
                if (PrefC.GetBool(PrefName.MedicalFeeUsedForNewProcs) && isMed)
                {
                    insfee = Fees.GetAmount0(ProcedureCodes.GetProcCode(ProcCur.MedicalCode).CodeNum, feeSch);
                }
                else
                {
                    insfee = Fees.GetAmount0(ProcCur.CodeNum, feeSch);
                }
                if (priplan != null && priplan.PlanType == "p")             //PPO
                {
                    standardfee = Fees.GetAmount0(ProcCur.CodeNum, Providers.GetProv(Patients.GetProvNum(patCur)).FeeSched);
                    if (standardfee > insfee)
                    {
                        ProcCur.ProcFee = standardfee;
                    }
                    else
                    {
                        ProcCur.ProcFee = insfee;
                    }
                }
                else
                {
                    ProcCur.ProcFee = insfee;
                }
                //surf
                //toothnum
                //Procedures.Cur.ToothRange="";
                //ProcCur.NoBillIns=ProcedureCodes.GetProcCode(ProcCur.CodeNum).NoBillIns;
                //priority
                ProcCur.ProcStatus = ProcStat.TP;
                ProcCur.Note       = "";
                //Procedures.Cur.PriEstim=
                //Procedures.Cur.SecEstim=
                //claimnum
                ProcCur.ProvNum = patCur.PriProv;
                //Procedures.Cur.Dx=
                ProcCur.ClinicNum = patCur.ClinicNum;
                //nextaptnum
                ProcCur.BaseUnits = ProcedureCodes.GetProcCode(ProcCur.CodeNum).BaseUnits;
                Procedures.Insert(ProcCur);                //no recall synch required
                Procedures.ComputeEstimates(ProcCur, patCur.PatNum, new List <ClaimProc>(), false, planList, patPlanList, benefitList, patCur.Age, subList);
                if (Programs.UsingOrion)
                {
                    FormProcEdit FormP = new FormProcEdit(ProcCur, patCur.Copy(), Patients.GetFamily(patCur.PatNum));
                    FormP.IsNew = true;
                    FormP.ShowDialog();
                    if (FormP.DialogResult == DialogResult.Cancel)
                    {
                        //any created claimprocs are automatically deleted from within procEdit window.
                        try{
                            Procedures.Delete(ProcCur.ProcNum);                            //also deletes the claimprocs
                        }
                        catch (Exception ex) {
                            MessageBox.Show(ex.Message);
                        }
                    }
                    else
                    {
                        //Do not synch. Recalls based on ScheduleByDate reports in Orion mode.
                        //Recalls.Synch(PatCur.PatNum);
                    }
                }
            }
            return(AptCur);
        }