Ejemplo n.º 1
0
        private void FillGrid()
        {
            RecallTypes.RefreshCache();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableRecallTypes", "Description"), 110);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallTypes", "Special Type"), 110);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallTypes", "Triggers"), 190);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallTypes", "Interval"), 60);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallTypes", "Time Pattern"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallTypes", "Procedures"), 190);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            //string txt;
            for (int i = 0; i < RecallTypeC.Listt.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(RecallTypeC.Listt[i].Description);
                row.Cells.Add(RecallTypes.GetSpecialTypeStr(RecallTypeC.Listt[i].RecallTypeNum));
                row.Cells.Add(GetStringForType(RecallTypeC.Listt[i].RecallTypeNum));
                row.Cells.Add(RecallTypeC.Listt[i].DefaultInterval.ToString());
                row.Cells.Add(RecallTypeC.Listt[i].TimePattern);
                row.Cells.Add(RecallTypeC.Listt[i].Procedures);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Ejemplo n.º 2
0
        ///<summary></summary>
        public static RecallType CreateRecallType(string description       = "Cleaning", string procedures = "D1110,D0150", string timePattern = "///X///",
                                                  Interval defaultInterval = default(Interval))
        {
            RecallType recallType = new RecallType();

            if (defaultInterval == default(Interval))
            {
                recallType.DefaultInterval = new Interval(1, 0, 6, 0);
            }
            else
            {
                recallType.DefaultInterval = defaultInterval;
            }
            recallType.Description = description;
            recallType.Procedures  = procedures;
            recallType.TimePattern = timePattern;
            RecallTypes.Insert(recallType);
            RecallTypes.RefreshCache();
            foreach (string procStr in procedures.Split(','))
            {
                RecallTriggers.Insert(new RecallTrigger {
                    CodeNum       = ProcedureCodes.GetOne(procStr).CodeNum,
                    RecallTypeNum = recallType.RecallTypeNum
                });
            }
            return(recallType);
        }
Ejemplo n.º 3
0
        ///<summary>Gets up to 30 days of open time slots based on the RecallType passed in.
        ///Open time slots are found by looping through operatories flagged for Web Sched and finding openings that can hold the RecallType.
        ///The RecallType passed in must be a valid recall type.
        ///Providers passed in will be the only providers considered when looking for available time slots.
        ///Passing in a null clinic will only consider operatories with clinics set to 0 (unassigned).
        ///The timeslots on and between the Start and End dates passed in will be considered and potentially returned as available.
        ///Optionally pass in a recall object in order to consider all other recalls due for the patient.  This will potentially affect the time pattern.
        ///Throws exceptions.</summary>
        public static List <TimeSlot> GetAvailableWebSchedTimeSlots(RecallType recallType, List <Provider> listProviders, Clinic clinic
                                                                    , DateTime dateStart, DateTime dateEnd, Recall recallCur = null)
        {
            //No need to check RemotingRole; no call to db.
            if (recallType == null)           //Validate that recallType is not null.
            {
                throw new ODException(Lans.g("WebSched", "The recall appointment you are trying to schedule is no longer available.") + "\r\n"
                                      + Lans.g("WebSched", "Please call us to schedule your appointment."));
            }
            //Get all the Operatories that are flagged for Web Sched.
            List <Operatory> listOperatories = Operatories.GetOpsForWebSched();

            if (listOperatories.Count < 1)             //This is very possible for offices that aren't set up the way that we expect them to be.
            {
                throw new ODException(Lans.g("WebSched", "There are no operatories set up for Web Sched.") + "\r\n"
                                      + Lans.g("WebSched", "Please call us to schedule your appointment."), ODException.ErrorCodes.NoOperatoriesSetup);
            }
            List <long>     listProvNums  = listProviders.Select(x => x.ProvNum).Distinct().ToList();
            List <Schedule> listSchedules = Schedules.GetSchedulesAndBlockoutsForWebSched(listProvNums, dateStart, dateEnd, true
                                                                                          , (clinic == null) ? 0 : clinic.ClinicNum);
            string timePatternRecall = recallType.TimePattern;

            //Apparently scheduling this one recall can potentially schedule a bunch of other recalls at the same time.
            //We need to potentially bloat our time pattern based on the other recalls that are due for this specific patient.
            if (recallCur != null)
            {
                Patient       patCur      = Patients.GetLim(recallCur.PatNum);
                List <Recall> listRecalls = Recalls.GetList(recallCur.PatNum);
                timePatternRecall = Recalls.GetRecallTimePattern(recallCur, listRecalls, patCur, new List <string>());
            }
            string timePatternAppointment = RecallTypes.ConvertTimePattern(timePatternRecall);

            return(GetTimeSlotsForRange(dateStart, dateEnd, timePatternAppointment, listProvNums, listOperatories, listSchedules, clinic));
        }
        ///<summary>Also refreshed the combo box of available recall types.</summary>
        private void FillGridWebSchedRecallTypes()
        {
            //Keep track of the previously selected recall type.
            long selectedRecallTypeNum = 0;

            if (comboWebSchedRecallTypes.SelectedIndex != -1)
            {
                selectedRecallTypeNum = _listRecallTypes[comboWebSchedRecallTypes.SelectedIndex].RecallTypeNum;
            }
            //Fill the combo boxes for the time slots preview.
            comboWebSchedRecallTypes.Items.Clear();
            _listRecallTypes = RecallTypes.GetDeepCopy();
            for (int i = 0; i < _listRecallTypes.Count; i++)
            {
                comboWebSchedRecallTypes.Items.Add(_listRecallTypes[i].Description);
                if (_listRecallTypes[i].RecallTypeNum == selectedRecallTypeNum)
                {
                    comboWebSchedRecallTypes.SelectedIndex = i;
                }
            }
            if (selectedRecallTypeNum == 0 && comboWebSchedRecallTypes.Items.Count > 0)
            {
                comboWebSchedRecallTypes.SelectedIndex = 0;              //Arbitrarily select the first recall type.
            }
            gridWebSchedRecallTypes.BeginUpdate();
            gridWebSchedRecallTypes.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableRecallTypes", "Description"), 130);

            gridWebSchedRecallTypes.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableRecallTypes", "Time Pattern"), 100);
            gridWebSchedRecallTypes.Columns.Add(col);
            col           = new ODGridColumn(Lan.g("TableRecallTypes", "Time Length"), 0);
            col.TextAlign = HorizontalAlignment.Center;
            gridWebSchedRecallTypes.Columns.Add(col);
            gridWebSchedRecallTypes.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < _listRecallTypes.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(_listRecallTypes[i].Description);
                row.Cells.Add(_listRecallTypes[i].TimePattern);
                int timeLength = RecallTypes.ConvertTimePattern(_listRecallTypes[i].TimePattern).Length * 5;
                if (timeLength == 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(timeLength.ToString() + " " + Lan.g("TableRecallTypes", "mins"));
                }
                gridWebSchedRecallTypes.Rows.Add(row);
            }
            gridWebSchedRecallTypes.EndUpdate();
        }
Ejemplo n.º 5
0
        public static Appointment CreateAppointmentFromRecall(Recall recall, Patient pat, DateTime aptDateTime, long opNum, long provNum)
        {
            RecallType  recallType = RecallTypes.GetFirstOrDefault(x => x.RecallTypeNum == recall.RecallTypeNum);
            Appointment appt       = CreateAppointment(pat.PatNum, aptDateTime, opNum, provNum, pattern: recallType.TimePattern, clinicNum: pat.ClinicNum);

            foreach (string procCode in RecallTypes.GetProcs(recallType.RecallTypeNum))
            {
                ProcedureT.CreateProcedure(pat, procCode, ProcStat.TP, "", 50, appt.AptDateTime, provNum: provNum, aptNum: appt.AptNum);
            }
            return(appt);
        }
Ejemplo n.º 6
0
 private void butPerio_Click(object sender, EventArgs e)
 {
     //make sure we have both special types properly setup.
     if (!RecallTypes.PerioAndProphyBothHaveTriggers())
     {
         MsgBox.Show(this, "Prophy and Perio special recall types are not setup properly.  They must both exist, and they must both have a trigger.");
         return;
     }
     if (IsPerio)
     {
         //change the perio types to prophy
         for (int i = 0; i < RecallList.Count; i++)
         {
             if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallList[i].RecallTypeNum)
             {
                 RecallList[i].RecallTypeNum  = PrefC.GetLong(PrefName.RecallTypeSpecialProphy);
                 RecallList[i].RecallInterval = RecallTypes.GetInterval(PrefC.GetLong(PrefName.RecallTypeSpecialProphy));
                 //previous date will be reset below in synch, but probably won't change since similar triggers.
                 Recalls.Update(RecallList[i]);
                 SecurityLogs.MakeLogEntry(Permissions.RecallEdit, RecallList[i].PatNum, "Recall changed to Prophy from the Recalls for Patient window.");
                 break;
             }
         }
     }
     else
     {
         bool found = false;
         //change any prophy types to perio
         for (int i = 0; i < RecallList.Count; i++)
         {
             if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallList[i].RecallTypeNum)
             {
                 RecallList[i].RecallTypeNum  = PrefC.GetLong(PrefName.RecallTypeSpecialPerio);
                 RecallList[i].RecallInterval = RecallTypes.GetInterval(PrefC.GetLong(PrefName.RecallTypeSpecialPerio));
                 //previous date will be reset below in synch, but probably won't change since similar triggers.
                 Recalls.Update(RecallList[i]);
                 SecurityLogs.MakeLogEntry(Permissions.RecallEdit, RecallList[i].PatNum, "Recall changed to Perio from the Recalls for Patient window.");
                 found = true;
                 break;
             }
         }
         //if none found, then add a perio
         if (!found)
         {
             Recall recall = new Recall();
             recall.PatNum         = PatNum;
             recall.RecallInterval = RecallTypes.GetInterval(PrefC.GetLong(PrefName.RecallTypeSpecialPerio));
             recall.RecallTypeNum  = PrefC.GetLong(PrefName.RecallTypeSpecialPerio);
             Recalls.Insert(recall);
             SecurityLogs.MakeLogEntry(Permissions.RecallEdit, recall.PatNum, "Perio recall added from the Recalls for Patient window.");
         }
     }
     FillGrid();
 }
Ejemplo n.º 7
0
        ///<summary>Gets up to 30 days of open time slots based on the RecallType passed in.
        ///Open time slots are found by looping through operatories flagged for Web Sched and finding openings that can hold the RecallType.
        ///The RecallType passed in must be a valid recall type.
        ///Providers passed in will be the only providers considered when looking for available time slots.
        ///Passing in a null clinic will only consider operatories with clinics set to 0 (unassigned).
        ///The timeslots on and between the Start and End dates passed in will be considered and potentially returned as available.
        ///Optionally pass in a recall object in order to consider all other recalls due for the patient.  This will potentially affect the time pattern.
        ///Throws exceptions.</summary>
        public static List <TimeSlot> GetAvailableWebSchedTimeSlots(RecallType recallType, List <Provider> listProviders, Clinic clinic
                                                                    , DateTime dateStart, DateTime dateEnd, Recall recallCur = null, Logger.IWriteLine log = null)
        {
            //No need to check RemotingRole; no call to db.
            if (recallType == null)           //Validate that recallType is not null.
            {
                throw new ODException(Lans.g("WebSched", "The recall appointment you are trying to schedule is no longer available.") + "\r\n"
                                      + Lans.g("WebSched", "Please call us to schedule your appointment."));
            }
            //Get all the Operatories that are flagged for Web Sched.
            List <Operatory> listOperatories = Operatories.GetOpsForWebSched();

            if (listOperatories.Count < 1)             //This is very possible for offices that aren't set up the way that we expect them to be.
            {
                throw new ODException(Lans.g("WebSched", "There are no operatories set up for Web Sched.") + "\r\n"
                                      + Lans.g("WebSched", "Please call us to schedule your appointment."), ODException.ErrorCodes.NoOperatoriesSetup);
            }
            log?.WriteLine("listOperatories:\r\n\t" + string.Join(",\r\n\t", listOperatories.Select(x => x.OperatoryNum + " - " + x.Abbrev)), LogLevel.Verbose);
            List <long>     listProvNums  = listProviders.Select(x => x.ProvNum).Distinct().ToList();
            List <Schedule> listSchedules = Schedules.GetSchedulesAndBlockoutsForWebSched(listProvNums, dateStart, dateEnd, true
                                                                                          , (clinic == null) ? 0 : clinic.ClinicNum, log);

            log?.WriteLine("listSchedules:\r\n\t" + string.Join(",\r\n\t", listSchedules.Select(x => x.ScheduleNum + " - " + x.SchedDate + " " + x.StartTime))
                           , LogLevel.Verbose);
            string timePatternRecall = recallType.TimePattern;

            //Apparently scheduling this one recall can potentially schedule a bunch of other recalls at the same time.
            //We need to potentially bloat our time pattern based on the other recalls that are due for this specific patient.
            if (recallCur != null)
            {
                Patient       patCur      = Patients.GetPat(recallCur.PatNum);
                List <Recall> listRecalls = Recalls.GetList(recallCur.PatNum);
                timePatternRecall = Recalls.GetRecallTimePattern(recallCur, listRecalls, patCur, new List <string>());
            }
            string timePatternAppointment = RecallTypes.ConvertTimePattern(timePatternRecall);

            return(GetTimeSlotsForRange(dateStart, dateEnd, timePatternAppointment, listProvNums, listOperatories, listSchedules, clinic, log: log,
                                        isDoubleBookingAllowed: PrefC.GetInt(PrefName.WebSchedRecallDoubleBooking) == 0));//is double booking allowed according to the preference
        }
Ejemplo n.º 8
0
        ///<summary>Gets up to 30 days of open time slots based on the recall passed in.
        ///Open time slots are found by looping through operatories flagged for Web Sched and finding openings that can hold the recall.
        ///The amount of time required to be considered "available" is dictated by the RecallType associated to the recall passed in.
        ///Throws exceptions.</summary>
        public static List <TimeSlot> GetAvailableWebSchedTimeSlots(long recallNum, DateTime dateStart, DateTime dateEnd, long provNum = 0,
                                                                    bool allowOtherProv = true)
        {
            //No need to check RemotingRole; no call to db.
            Clinic clinic = Clinics.GetClinicForRecall(recallNum);
            Recall recall = Recalls.GetRecall(recallNum);

            if (recall == null)
            {
                throw new ODException(Lans.g("WebSched", "The recall appointment you are trying to schedule is no longer available.") + "\r\n"
                                      + Lans.g("WebSched", "Please call us to schedule your appointment."));
            }
            List <Provider> listProviders = Providers.GetProvidersForWebSched(recall.PatNum);

            if (provNum > 0 && !allowOtherProv)
            {
                listProviders = listProviders.FindAll(x => x.ProvNum == provNum);
            }
            RecallType recallType = RecallTypes.GetFirstOrDefault(x => x.RecallTypeNum == recall.RecallTypeNum);

            return(GetAvailableWebSchedTimeSlots(recallType, listProviders, clinic, dateStart, dateEnd, recall));
        }
Ejemplo n.º 9
0
        ///<summary>Gets up to 30 days of open time slots based on the recall passed in.
        ///Open time slots are found by looping through operatories flagged for Web Sched and finding openings that can hold the recall.
        ///The amount of time required to be considered "available" is dictated by the RecallType associated to the recall passed in.
        ///Throws exceptions.</summary>
        public static List <TimeSlot> GetAvailableWebSchedTimeSlots(long recallNum, DateTime dateStart, DateTime dateEnd, long provNum = 0,
                                                                    bool allowOtherProv = true, Logger.IWriteLine log = null)
        {
            //No need to check RemotingRole; no call to db.
            Clinic clinic = Clinics.GetClinicForRecall(recallNum);
            Recall recall = Recalls.GetRecall(recallNum);

            if (recall == null)
            {
                throw new ODException(Lans.g("WebSched", "The recall appointment you are trying to schedule is no longer available.") + "\r\n"
                                      + Lans.g("WebSched", "Please call us to schedule your appointment."));
            }
            List <Provider> listProviders = Providers.GetProvidersForWebSched(recall.PatNum, clinic?.ClinicNum ?? 0);

            if (provNum > 0 && !allowOtherProv)
            {
                listProviders = listProviders.FindAll(x => x.ProvNum == provNum);
            }
            log?.WriteLine("listProviders:\r\n\t" + string.Join(",\r\n\t", listProviders.Select(x => x.ProvNum + " - " + x.Abbr)), LogLevel.Verbose);
            RecallType recallType = RecallTypes.GetFirstOrDefault(x => x.RecallTypeNum == recall.RecallTypeNum);

            return(GetAvailableWebSchedTimeSlots(recallType, listProviders, clinic, dateStart, dateEnd, recall, log));
        }
Ejemplo n.º 10
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (RecallCur.DatePrevious.Year > 1880)
     {
         if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "This recall should not normally be deleted because the Previous Date has a value.  You should use the Disabled checkBox instead.  But if you are just deleting a duplicate, it's ok to continue.  Continue?"))
         {
             return;
         }
     }
     else if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete this recall?"))
     {
         return;
     }
     Recalls.Delete(RecallCur);
     SecurityLogs.MakeLogEntry(Permissions.RecallEdit, RecallCur.PatNum
                               , "Recall deleted with type '" + RecallTypes.GetSpecialTypeStr(RecallCur.RecallTypeNum) + "' and interval '" + RecallCur.RecallInterval + "'");
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 11
0
 private void FormRecallEdit_Load(object sender, System.EventArgs e)
 {
     _listRecallTypes = RecallTypes.GetDeepCopy();
     for (int i = 0; i < _listRecallTypes.Count; i++)
     {
         comboType.Items.Add(_listRecallTypes[i].Description);
         if (RecallCur.RecallTypeNum == _listRecallTypes[i].RecallTypeNum)
         {
             comboType.SelectedIndex = i;
         }
     }
     if (!IsNew)
     {
         comboType.Enabled = false;
     }
     checkASAP.Checked       = RecallCur.Priority == RecallPriority.ASAP;
     checkIsDisabled.Checked = RecallCur.IsDisabled;
     if (checkIsDisabled.Checked)
     {
         textDateDue.ReadOnly = true;
     }
     if (RecallCur.DisableUntilBalance == 0)
     {
         textBalance.Text = "";
     }
     else
     {
         textBalance.Text = RecallCur.DisableUntilBalance.ToString("f");
     }
     if (RecallCur.DisableUntilDate.Year < 1880)
     {
         textDisableDate.Text = "";
     }
     else
     {
         textDisableDate.Text = RecallCur.DisableUntilDate.ToShortDateString();
     }
     if (RecallCur.DatePrevious.Year > 1880)
     {
         textDatePrevious.Text = RecallCur.DatePrevious.ToShortDateString();
     }
     if (RecallCur.DateDueCalc.Year > 1880)
     {
         textDateDueCalc.Text = RecallCur.DateDueCalc.ToShortDateString();
     }
     if (RecallCur.DateDue.Year > 1880)
     {
         textDateDue.Text = RecallCur.DateDue.ToShortDateString();
     }
     if (RecallCur.DateScheduled.Year > 1880)
     {
         textScheduledDate.Text = RecallCur.DateScheduled.ToShortDateString();
     }
     textYears.Text  = RecallCur.RecallInterval.Years.ToString();
     textMonths.Text = RecallCur.RecallInterval.Months.ToString();
     textWeeks.Text  = RecallCur.RecallInterval.Weeks.ToString();
     textDays.Text   = RecallCur.RecallInterval.Days.ToString();
     comboStatus.Items.Add(Lan.g(this, "None"));
     comboStatus.SelectedIndex    = 0;
     _listRecallUnschedStatusDefs = Defs.GetDefsForCategory(DefCat.RecallUnschedStatus, true);
     for (int i = 0; i < _listRecallUnschedStatusDefs.Count; i++)
     {
         comboStatus.Items.Add(_listRecallUnschedStatusDefs[i].ItemName);
         if (_listRecallUnschedStatusDefs[i].DefNum == RecallCur.RecallStatus)
         {
             comboStatus.SelectedIndex = i + 1;
         }
     }
     textNote.Text = RecallCur.Note;
 }
Ejemplo n.º 12
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescription.Text == "")
            {
                MsgBox.Show(this, "Description cannot be blank.");
                return;
            }
            for (int i = 0; i < textPattern.Text.Length; i++)
            {
                if (textPattern.Text[i] != '/' && textPattern.Text[i] != 'X')
                {
                    MsgBox.Show(this, "Time Pattern may only contain '/' and 'X'.  Please fix to continue.");
                    return;
                }
            }
            if (textYears.errorProvider1.GetError(textYears) != "" ||
                textMonths.errorProvider1.GetError(textMonths) != "" ||
                textWeeks.errorProvider1.GetError(textWeeks) != "" ||
                textDays.errorProvider1.GetError(textDays) != ""
                )
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            //if(RecallTypes.List comboSpecial.SelectedIndex

            /*
             * if(listTriggers.Items.Count==0 && comboSpecial.SelectedIndex!=2) {//except child prophy
             *      if(!MsgBox.Show(this,true,"Warning! clearing all triggers for a recall type will cause all patient recalls of that type to be deleted, even those with notes.  Continue anyway?")){
             *              return;
             *      }
             * }*/
            bool changed = false;

            if (comboSpecial.SelectedIndex == 2)          //childProphy
            {
                if (textRecallAgeAdult.errorProvider1.GetError(textRecallAgeAdult) != "")
                {
                    MsgBox.Show(this, "Please fix data entry errors first.");
                    return;
                }
                if (Prefs.UpdateInt(PrefName.RecallAgeAdult, PIn.Int(textRecallAgeAdult.Text)))
                {
                    changed = true;
                }
                TriggerList.Clear(); //triggers for child prophy special type are handled by the prophy special type
            }
            else                     //for child prophy, interval will default to 0, since this special type uses the Prophy default interval
            {
                Interval interval = new Interval(
                    PIn.Int(textDays.Text),
                    PIn.Int(textWeeks.Text),
                    PIn.Int(textMonths.Text),
                    PIn.Int(textYears.Text));
                RecallTypeCur.DefaultInterval = interval;
            }
            RecallTypeCur.Description     = textDescription.Text;
            RecallTypeCur.TimePattern     = textPattern.Text;
            RecallTypeCur.AppendToSpecial = checkAppendToSpecial.Checked;
            if (listProcs.Items.Count == 0)
            {
                RecallTypeCur.Procedures = "";
            }
            //otherwise, already taken care of.
            try{
                if (RecallTypeCur.IsNew)
                {
                    RecallTypes.Insert(RecallTypeCur);
                    SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall type added '" + RecallTypeCur.Description + "'");
                }
                else
                {
                    SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall type having description '" + RecallTypeCur.Description + "' edited");
                    RecallTypes.Update(RecallTypeCur);
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            RecallTriggers.SetForType(RecallTypeCur.RecallTypeNum, TriggerList);
            //The combo for special type is allowed to be changed by user.  But since the field is in the pref table instead of in the RecallType table, there's extra work involved in saving the selection.
            if (comboSpecial.SelectedIndex == 0)                                                    //none:  If this recall type is now not any special type
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum) //and it used to be the special prophy type
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 1)                                                //Prophy: If this recall type is now the prophy type.
            {
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, RecallTypeCur.RecallTypeNum)) //and it was already the prophy type
                {
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)              //but it used to be the childprophy type.
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 2)          //ChildProphy
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, RecallTypeCur.RecallTypeNum))
                {
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 3)          //Perio
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, RecallTypeCur.RecallTypeNum))
                {
                    changed = true;
                }
            }
            DataValid.SetInvalid(InvalidType.RecallTypes);
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            //Ask user to update recalls for patients if they changed the DefaultInterval.
            if (!RecallTypeCur.IsNew && defaultIntervalOld != RecallTypeCur.DefaultInterval)
            {
                if (MsgBox.Show(this, MsgBoxButtons.YesNo, "Default interval has been changed.  Reset all current patient intervals of this type?"))
                {
                    Recalls.UpdateDefaultIntervalForPatients(RecallTypeCur.RecallTypeNum, defaultIntervalOld, RecallTypeCur.DefaultInterval);
                }
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 13
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescription.Text == "")
            {
                MsgBox.Show(this, "Description cannot be blank.");
                return;
            }
            if (textYears.errorProvider1.GetError(textYears) != "" ||
                textMonths.errorProvider1.GetError(textMonths) != "" ||
                textWeeks.errorProvider1.GetError(textWeeks) != "" ||
                textDays.errorProvider1.GetError(textDays) != ""
                )
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            //if(RecallTypes.List comboSpecial.SelectedIndex

            /*
             * if(listTriggers.Items.Count==0 && comboSpecial.SelectedIndex!=2) {//except child prophy
             *      if(!MsgBox.Show(this,true,"Warning! clearing all triggers for a recall type will cause all patient recalls of that type to be deleted, even those with notes.  Continue anyway?")){
             *              return;
             *      }
             * }*/
            RecallTypeCur.Description = textDescription.Text;
            Interval interval = new Interval(
                PIn.Int(textDays.Text),
                PIn.Int(textWeeks.Text),
                PIn.Int(textMonths.Text),
                PIn.Int(textYears.Text));

            RecallTypeCur.DefaultInterval = interval;
            RecallTypeCur.TimePattern     = textPattern.Text;
            if (listProcs.Items.Count == 0)
            {
                RecallTypeCur.Procedures = "";
            }
            //otherwise, already taken care of.
            try{
                if (RecallTypeCur.IsNew)
                {
                    RecallTypes.Insert(RecallTypeCur);
                }
                else
                {
                    RecallTypes.Update(RecallTypeCur);
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            RecallTriggers.SetForType(RecallTypeCur.RecallTypeNum, TriggerList);
            bool changed = false;

            if (comboSpecial.SelectedIndex == 0)          //none
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 1)          //Prophy
            {
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, RecallTypeCur.RecallTypeNum))
                {
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 2)          //ChildProphy
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, RecallTypeCur.RecallTypeNum))
                {
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 3)          //Perio
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, RecallTypeCur.RecallTypeNum))
                {
                    changed = true;
                }
            }
            DataValid.SetInvalid(InvalidType.RecallTypes);
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            //Ask user to update recalls for patients if they changed the DefaultInterval.
            if (!RecallTypeCur.IsNew && defaultIntervalOld != RecallTypeCur.DefaultInterval)
            {
                if (MsgBox.Show(this, MsgBoxButtons.YesNo, "Default interval has been changed.  Reset all current patient intervals of this type?"))
                {
                    Recalls.UpdateDefaultIntervalForPatients(RecallTypeCur.RecallTypeNum, defaultIntervalOld, RecallTypeCur.DefaultInterval);
                }
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 14
0
        private void butRun_Click(object sender, EventArgs e)
        {
            if (!checkTcodes.Checked && !checkNcodes.Checked && !checkDcodes.Checked && !checkAutocodes.Checked &&
                !checkProcButtons.Checked && !checkApptProcsQuickAdd.Checked && !checkRecallTypes.Checked)
            {
                MsgBox.Show(this, "Please select at least one tool first.");
                return;
            }
            Changed = false;
            int rowsInserted = 0;

            #region N Codes
            if (checkNcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", null, Properties.Resources.NoFeeProcCodes);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                Changed = true;
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
                //fees are included because they are grouped by defs.
            }
            #endregion
            #region D Codes
            if (checkDcodes.Checked)
            {
                try {
                    if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))                     //Canadian. en-CA or fr-CA
                    {
                        if (_codeList == null)
                        {
                            CanadaDownloadProcedureCodes();
                        }
                    }
                    rowsInserted += FormProcCodes.ImportProcCodes("", _codeList, "");
                    Changed       = true;
                    int descriptionsFixed = ProcedureCodes.ResetADAdescriptions();
                    MessageBox.Show("Procedure code descriptions updated: " + descriptionsFixed.ToString());
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
            }
            #endregion
            if (checkNcodes.Checked || checkDcodes.Checked)
            {
                MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            }
            #region Auto Codes
            if (checkAutocodes.Checked)
            {
                //checking for any AutoCodes and prompting the user if they exist
                if (AutoCodes.GetCount() > 0)
                {
                    string msgText = Lan.g(this, "This tool will delete all current autocodes and then add in the default autocodes.") + "\r\n";
                    //If the proc tool isn't going to put the procedure buttons back to default, warn them that they will need to reassociate them.
                    if (!checkProcButtons.Checked)
                    {
                        msgText += Lan.g(this, "Any procedure buttons associated with the current autocodes will be dissociated and will need to be reassociated manually.") + "\r\n";
                    }
                    msgText += Lan.g(this, "Continue?");
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, msgText))
                    {
                        AutoCodes.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.AutoCodes);
                    }
                    else
                    {
                        checkAutocodes.Checked = false;                       //if the user hits no on the popup, uncheck and continue
                    }
                }
                //If there are no autocodes then add the defaults
                else
                {
                    AutoCodes.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.AutoCodes);
                }
            }
            #endregion
            #region Proc Buttons
            if (checkProcButtons.Checked)
            {
                //checking for any custom proc button categories and prompting the user if they exist
                if (Defs.HasCustomCategories())
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will delete all current ProcButtons from the Chart Module and add in the defaults. Continue?"))
                    {
                        ProcButtons.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                    }
                    else
                    {
                        checkProcButtons.Checked = false;                      //continue and uncheck if user hits no on the popup
                    }
                }
                //no ProcButtons found, run normally
                else
                {
                    ProcButtons.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                }
            }
            #endregion
            #region Appt Procs Quick Add
            if (checkApptProcsQuickAdd.Checked)
            {
                //checking for any ApptProcsQuickAdd and prompting the user if they exist
                if (Defs.GetDefsForCategory(DefCat.ApptProcsQuickAdd).Count > 0)
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will reset the list of procedures in the appointment edit window to the defaults. Continue?"))
                    {
                        ProcedureCodes.ResetApptProcsQuickAdd();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.Defs);
                    }
                    else
                    {
                        checkApptProcsQuickAdd.Checked = false;                      //uncheck and continue if no is selected on the popup
                    }
                }
                //run normally if no customizations are found
                else
                {
                    ProcedureCodes.ResetApptProcsQuickAdd();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.Defs);
                }
            }
            #endregion
            #region Recall Types
            if (checkRecallTypes.Checked &&
                (!RecallTypes.IsUsingManuallyAddedTypes() ||                 //If they have any manually added types, ask them if they are sure they want to delete them.
                 MsgBox.Show(this, MsgBoxButtons.OKCancel, "This will delete all patient recalls for recall types which were manually added.  Continue?")))
            {
                RecallTypes.SetToDefault();
                Changed = true;
                DataValid.SetInvalid(InvalidType.RecallTypes, InvalidType.Prefs);
                SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall types set to default.");
            }
            #endregion
            #region T Codes
            if (checkTcodes.Checked)            //Even though this is first in the interface, we need to run it last, since other regions need the T codes above.
            {
                ProcedureCodes.TcodesClear();
                Changed = true;
                //yes, this really does refresh before moving on.
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
                SecurityLogs.MakeLogEntry(Permissions.ProcCodeEdit, 0, "T-Codes deleted.");
            }
            #endregion
            if (Changed)
            {
                MessageBox.Show(Lan.g(this, "Done."));
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "New Customer Procedure codes tool was run.");
            }
        }
Ejemplo n.º 15
0
        private void PortalActionsLoad(RecallTypes recall)
        {
            try
            {

                switch(recall)
                {
                    case RecallTypes.lifestone:
                        FoundryLoadPortalAction(1635);
                        break;

                    case RecallTypes.portal:
                        FoundryLoadPortalAction(2645);
                        break;

                    case RecallTypes.primaryporal:
                        FoundryLoadPortalAction(48);
                        break;

                    case RecallTypes.summonprimary:
                        FoundryLoadPortalAction(157);
                        break;

                    case RecallTypes.secondaryportal:
                        FoundryLoadPortalAction(2647);
                        break;

                    case RecallTypes.summonsecondary:
                        FoundryLoadPortalAction(2648);
                        break;

                    case RecallTypes.sanctuary:
                       FoundryLoadPortalAction(2023);
                        break;

                    case RecallTypes.bananaland:
                        FoundryLoadPortalAction(2931);
                        break;

                    case RecallTypes.col:
                        FoundryLoadPortalAction(4213);
                        break;

                    case RecallTypes.aerlinthe:
                        FoundryLoadPortalAction(2041);
                        break;

                    case RecallTypes.caul:
                        FoundryLoadPortalAction(2943);
                        break;

                    case RecallTypes.bur:
                        FoundryLoadPortalAction(4084);
                        break;

                    case RecallTypes.olthoi_north:
                        FoundryLoadPortalAction(4198);
                        break;

                    case RecallTypes.facilityhub:
                        FoundryLoadPortalAction(5175);
                        break;
                    case RecallTypes.gearknight:
                        FoundryLoadPortalAction(5330);
                        break;

                    case RecallTypes.neftet:
                        FoundryLoadPortalAction(5541);
                        break;

                    case RecallTypes.rynthid:
                        FoundryLoadPortalAction(6150);
                        break;

                    case RecallTypes.mhoire:
                        FoundryLoadPortalAction(4128);
                        break;

                    case RecallTypes.lifestonetie:
                        FoundryLoadPortalAction(2644);
                        break;

                    case RecallTypes.tieprimary:
                        FoundryLoadPortalAction(47);
                        break;

                    case RecallTypes.tiesecondary:
                        FoundryLoadPortalAction(2646);
                        break;

                    case RecallTypes.glendenwood:
                       FoundryLoadPortalAction(3865);
                        break;

                    case RecallTypes.lethe:
                        FoundryLoadPortalAction(2813);
                        break;

                    case RecallTypes.ulgrim:
                        FoundryLoadPortalAction(2941);
                        break;

                    case RecallTypes.candeth:
                        FoundryLoadPortalAction(4214);
                        break;
                }

            }catch(Exception ex){LogError(ex);}
        }
Ejemplo n.º 16
0
        private void butRun_Click(object sender, EventArgs e)
        {
            //The updating of CDT codes takes place towards the end of the year, while we typically do it in December, we have
            //done it as early as Novemeber before. This warning will inform users that using the new codes will cause rejection
            //on their claims if they try to use them before the first of the new year.
            DateTime datePromptStart = new DateTime(2019, 12, 20);
            DateTime datePromptEnd   = new DateTime(datePromptStart.Year, 12, 31);

            if (DateTime.Now.Between(datePromptStart, datePromptEnd) && checkDcodes.Checked) //Only validate if attempting to update D Codes
            {
                if (MessageBox.Show(                                                         //Still between datePromptStart and the first of the next year, prompt that these codes may cause problems.
                        Lan.g(this, "Updating D Codes at this time could result in acquiring codes which are not valid until ")
                        + datePromptEnd.AddDays(1).ToShortDateString() + Lan.g(this, ". Using these codes could cause claims to be rejected, continue?")
                        , Lan.g(this, "D Codes"), MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;                    //Early return if the user is between datePromptStart and the first of the next year and they've said no to updating D Codes.
                }
            }
            if (!checkTcodes.Checked && !checkNcodes.Checked && !checkDcodes.Checked && !checkAutocodes.Checked &&
                !checkProcButtons.Checked && !checkApptProcsQuickAdd.Checked && !checkRecallTypes.Checked)
            {
                MsgBox.Show(this, "Please select at least one tool first.");
                return;
            }
            Changed = false;
            int rowsInserted = 0;

            #region N Codes
            if (checkNcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", null, Properties.Resources.NoFeeProcCodes);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                Changed = true;
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes);
            }
            #endregion
            #region D Codes
            if (checkDcodes.Checked)
            {
                try {
                    if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))                     //Canadian. en-CA or fr-CA
                    {
                        if (_codeList == null)
                        {
                            CanadaDownloadProcedureCodes();
                        }
                    }
                    rowsInserted += FormProcCodes.ImportProcCodes("", _codeList, "");
                    Changed       = true;
                    int descriptionsFixed = ProcedureCodes.ResetADAdescriptions();
                    MessageBox.Show("Procedure code descriptions updated: " + descriptionsFixed.ToString());
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes);
            }
            #endregion
            if (checkNcodes.Checked || checkDcodes.Checked)
            {
                MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            }
            #region Auto Codes
            if (checkAutocodes.Checked)
            {
                //checking for any AutoCodes and prompting the user if they exist
                if (AutoCodes.GetCount() > 0)
                {
                    string msgText = Lan.g(this, "This tool will delete all current autocodes and then add in the default autocodes.") + "\r\n";
                    //If the proc tool isn't going to put the procedure buttons back to default, warn them that they will need to reassociate them.
                    if (!checkProcButtons.Checked)
                    {
                        msgText += Lan.g(this, "Any procedure buttons associated with the current autocodes will be dissociated and will need to be reassociated manually.") + "\r\n";
                    }
                    msgText += Lan.g(this, "Continue?");
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, msgText))
                    {
                        AutoCodes.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.AutoCodes);
                    }
                    else
                    {
                        checkAutocodes.Checked = false;                       //if the user hits no on the popup, uncheck and continue
                    }
                }
                //If there are no autocodes then add the defaults
                else
                {
                    AutoCodes.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.AutoCodes);
                }
            }
            #endregion
            #region Proc Buttons
            if (checkProcButtons.Checked)
            {
                //checking for any custom proc button categories and prompting the user if they exist
                if (Defs.HasCustomCategories())
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will delete all current ProcButtons from the Chart Module and add in the defaults. Continue?"))
                    {
                        ProcButtons.SetToDefault();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                    }
                    else
                    {
                        checkProcButtons.Checked = false;                      //continue and uncheck if user hits no on the popup
                    }
                }
                //no ProcButtons found, run normally
                else
                {
                    ProcButtons.SetToDefault();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
                }
            }
            #endregion
            #region Appt Procs Quick Add
            if (checkApptProcsQuickAdd.Checked)
            {
                //checking for any ApptProcsQuickAdd and prompting the user if they exist
                if (Defs.GetDefsForCategory(DefCat.ApptProcsQuickAdd).Count > 0)
                {
                    if (MsgBox.Show(this, MsgBoxButtons.YesNo, "This tool will reset the list of procedures in the appointment edit window to the defaults. Continue?"))
                    {
                        ProcedureCodes.ResetApptProcsQuickAdd();
                        Changed = true;
                        DataValid.SetInvalid(InvalidType.Defs);
                    }
                    else
                    {
                        checkApptProcsQuickAdd.Checked = false;                      //uncheck and continue if no is selected on the popup
                    }
                }
                //run normally if no customizations are found
                else
                {
                    ProcedureCodes.ResetApptProcsQuickAdd();
                    Changed = true;
                    DataValid.SetInvalid(InvalidType.Defs);
                }
            }
            #endregion
            #region Recall Types
            if (checkRecallTypes.Checked &&
                (!RecallTypes.IsUsingManuallyAddedTypes() ||                 //If they have any manually added types, ask them if they are sure they want to delete them.
                 MsgBox.Show(this, MsgBoxButtons.OKCancel, "This will delete all patient recalls for recall types which were manually added.  Continue?")))
            {
                RecallTypes.SetToDefault();
                Changed = true;
                DataValid.SetInvalid(InvalidType.RecallTypes, InvalidType.Prefs);
                SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall types set to default.");
            }
            #endregion
            #region T Codes
            if (checkTcodes.Checked)            //Even though this is first in the interface, we need to run it last, since other regions need the T codes above.
            {
                ProcedureCodes.TcodesClear();
                Changed = true;
                //yes, this really does refresh before moving on.
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes);
                SecurityLogs.MakeLogEntry(Permissions.ProcCodeEdit, 0, "T-Codes deleted.");
            }
            #endregion
            if (Changed)
            {
                MessageBox.Show(Lan.g(this, "Done."));
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "New Customer Procedure codes tool was run.");
            }
        }
Ejemplo n.º 17
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.º 18
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.º 19
0
        private void butRun_Click(object sender, EventArgs e)
        {
            if (!checkTcodes.Checked && !checkNcodes.Checked && !checkDcodes.Checked && !checkAutocodes.Checked &&
                !checkProcButtons.Checked && !checkApptProcsQuickAdd.Checked && !checkRecallTypes.Checked)
            {
                MsgBox.Show(this, "Please select at least one tool first.");
                return;
            }
            Changed = true;
            int rowsInserted = 0;

            if (checkTcodes.Checked)
            {
                ProcedureCodes.TcodesClear();
                //yes, this really does refresh before moving on.
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
            }
            if (checkNcodes.Checked)
            {
                try {
                    rowsInserted += FormProcCodes.ImportProcCodes("", null, Properties.Resources.NoFeeProcCodes);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
                //fees are included because they are grouped by defs.
            }
            if (checkDcodes.Checked)
            {
                try {
                    if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))                     //Canadian. en-CA or fr-CA
                    {
                        if (codeList == null)
                        {
                            CanadaDownloadProcedureCodes();                            //Fill codeList with Canadian codes
                        }
                    }
                    rowsInserted += FormProcCodes.ImportProcCodes("", codeList, "");
                    int descriptionsFixed = ProcedureCodes.ResetADAdescriptions();
                    MessageBox.Show("Procedure code descriptions updated: " + descriptionsFixed.ToString());
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
                DataValid.SetInvalid(InvalidType.Defs, InvalidType.ProcCodes, InvalidType.Fees);
            }
            if (checkNcodes.Checked || checkDcodes.Checked)
            {
                MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            }
            if (checkAutocodes.Checked)
            {
                AutoCodes.SetToDefault();
                DataValid.SetInvalid(InvalidType.AutoCodes);
            }
            if (checkProcButtons.Checked)
            {
                ProcButtons.SetToDefault();
                DataValid.SetInvalid(InvalidType.ProcButtons, InvalidType.Defs);
            }
            if (checkApptProcsQuickAdd.Checked)
            {
                ProcedureCodes.ResetApptProcsQuickAdd();
                DataValid.SetInvalid(InvalidType.Defs);
            }
            if (checkRecallTypes.Checked)
            {
                RecallTypes.SetToDefault();
                DataValid.SetInvalid(InvalidType.RecallTypes, InvalidType.Prefs);
            }
            MessageBox.Show(Lan.g(this, "Done."));
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "New Customer Procedure codes tool was run.");
        }
Ejemplo n.º 20
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);
        }
Ejemplo n.º 21
0
        private void PortalActionsLoad(RecallTypes recall)
        {
            try
            {
              		//Not holding a caster
                if(Core.WorldFilter.GetInventory().Where(x => x.Values(LongValueKey.EquippedSlots) == 0x1000000).Count() == 0)
                {
                    FoundryToggleAction(FoundryActionTypes.Peace);
                    FoundryToggleAction(FoundryActionTypes.EquipWand);
                }

                FoundryToggleAction(FoundryActionTypes.Magic);
                FoundryToggleAction(FoundryActionTypes.Portal);

                switch(recall)
                {
                    case RecallTypes.lifestone:
                        LoadPortalActionToFoundry(1635);
                        break;

                    case RecallTypes.portal:
                        LoadPortalActionToFoundry(2645);
                        break;

                    case RecallTypes.primaryporal:
                        LoadPortalActionToFoundry(48);
                        break;

                    case RecallTypes.summonprimary:
                        LoadPortalActionToFoundry(157);
                        break;

                    case RecallTypes.secondaryportal:
                        LoadPortalActionToFoundry(2647);
                        break;

                    case RecallTypes.summonsecondary:
                        LoadPortalActionToFoundry(2648);
                        break;

                    case RecallTypes.sanctuary:
                       LoadPortalActionToFoundry(2023);
                        break;

                    case RecallTypes.bananaland:
                        LoadPortalActionToFoundry(2931);
                        break;

                    case RecallTypes.col:
                        LoadPortalActionToFoundry(4213);
                        break;

                    case RecallTypes.aerlinthe:
                        LoadPortalActionToFoundry(2041);
                        break;

                    case RecallTypes.caul:
                        LoadPortalActionToFoundry(2943);
                        break;

                    case RecallTypes.bur:
                        LoadPortalActionToFoundry(4084);
                        break;

                    case RecallTypes.olthoi_north:
                        LoadPortalActionToFoundry(4198);
                        break;

                    case RecallTypes.facilityhub:
                        LoadPortalActionToFoundry(5175);
                        break;
                    case RecallTypes.gearknight:
                        LoadPortalActionToFoundry(5330);
                        break;

                    case RecallTypes.neftet:
                        LoadPortalActionToFoundry(5541);
                        break;

                    case RecallTypes.rynthid:
                        LoadPortalActionToFoundry(6150);
                        break;

                    case RecallTypes.mhoire:
                        LoadPortalActionToFoundry(4128);
                        break;

                    case RecallTypes.lifestonetie:
                        LoadPortalActionToFoundry(2644);
                        break;

                    case RecallTypes.tieprimary:
                        LoadPortalActionToFoundry(47);
                        break;

                    case RecallTypes.tiesecondary:
                        LoadPortalActionToFoundry(2646);
                        break;

                    case RecallTypes.glendenwood:
                       LoadPortalActionToFoundry(3865);
                        break;

                    case RecallTypes.lethe:
                        LoadPortalActionToFoundry(2813);
                        break;

                    case RecallTypes.ulgrim:
                        LoadPortalActionToFoundry(2941);
                        break;

                    case RecallTypes.candeth:
                        LoadPortalActionToFoundry(4214);
                        break;
                }

                InitiateFoundryActions();

            }catch(Exception ex){LogError(ex);}
        }