Ejemplo n.º 1
0
        private void butOK_Click(object sender, EventArgs e)
        {
            if (!_insPlan.CodeSubstNone && gridInsPlanSubstInc.Rows.Count == 0 && gridInsPlanSubstExc.Rows.Count > 0)
            {
                if (MsgBox.Show(this, MsgBoxButtons.YesNo, "You have chosen to exclude all substituion codes.  "
                                + "The checkbox option named 'Don't Substitute Codes (e.g. posterior composites)' "
                                + "in the Other Ins Info tab of the Edit Insurance Plan window can be used to exclude all substitution codes.\r\n"
                                + "Would you like to enable this option instead of excluding specific codes?"))
                {
                    _insPlan.CodeSubstNone = true;
                    DialogResult           = DialogResult.OK;
                    return;
                }
            }
            List <SubstitutionLink> listSubstLinks = new List <SubstitutionLink>();

            foreach (UI.ODGridRow row in gridInsPlanSubstExc.Rows)
            {
                ProcedureCode    procCode = (ProcedureCode)row.Tag;
                SubstitutionLink subLink  = _listDbSubstLinks.FirstOrDefault(x => x.CodeNum == procCode.CodeNum);
                if (subLink == null)
                {
                    subLink         = new SubstitutionLink();
                    subLink.PlanNum = _insPlan.PlanNum;
                    subLink.CodeNum = procCode.CodeNum;
                }
                listSubstLinks.Add(subLink);
            }
            SubstitutionLinks.Sync(listSubstLinks, _listDbSubstLinks);
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 2
0
 private void FormInsPlanSubstitution_Load(object sender, EventArgs e)
 {
     _listAllProcCodes   = ProcedureCodes.GetAllCodes();
     _listSubstProcCodes = _listAllProcCodes.FindAll(x => !String.IsNullOrEmpty(x.SubstitutionCode));
     _listDbSubstLinks   = SubstitutionLinks.GetAllForPlans(_insPlan.PlanNum);
     FillGridSubstituionInclude();
     FillGridSubstituionExclude();
 }
Ejemplo n.º 3
0
        public static SubstitutionLink CreateSubstitutionLink(long codeNum, string subCode, SubstitutionCondition substOnlyIf, long planNum)
        {
            SubstitutionLink subLink = new SubstitutionLink();

            subLink.CodeNum          = codeNum;
            subLink.SubstitutionCode = subCode;
            subLink.SubstOnlyIf      = substOnlyIf;
            subLink.PlanNum          = planNum;
            SubstitutionLinks.Insert(subLink);
            return(subLink);
        }
 private void FormInsPlanSubstitution_Load(object sender, EventArgs e)
 {
     _listAllProcCodes   = ProcedureCodes.GetAllCodes();
     _listSubstProcCodes = _listAllProcCodes.FindAll(x => !String.IsNullOrEmpty(x.SubstitutionCode));
     _listSubstLinks     = SubstitutionLinks.GetAllForPlans(_insPlan.PlanNum);
     _listSubstLinksOld  = _listSubstLinks.DeepCopyList <SubstitutionLink, SubstitutionLink>();
     _listSubConditions  = new List <string>();
     for (int i = 0; i < Enum.GetNames(typeof(SubstitutionCondition)).Length; i++)
     {
         _listSubConditions.Add(Lan.g("enumSubstitutionCondition", Enum.GetNames(typeof(SubstitutionCondition))[i]));
     }
     FillGridMain();
 }
        ///<summary>Syncs _listDbSubstLinks and _listDbSubstLinksOld. Does not modify any of the procedure level SubstitutionCodes.</summary>
        private void butOK_Click(object sender, EventArgs e)
        {
            string msgText = Lan.g(this, "You have chosen to exclude all substitution codes.  "
                                   + "The checkbox option named 'Don't Substitute Codes (e.g. posterior composites)' "
                                   + "in the Other Ins Info tab of the Edit Insurance Plan window can be used to exclude all substitution codes.\r\n"
                                   + "Would you like to enable this option instead of excluding specific codes?");

            if (!_insPlan.CodeSubstNone &&
                _listSubstProcCodes.Select(x => x.CodeNum).All(x => _listSubstLinks.Find(y => y.CodeNum == x)?.SubstOnlyIf == SubstitutionCondition.Never) &&
                MessageBox.Show(this, msgText, null, MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                _insPlan.CodeSubstNone = true;
            }
            //No need to make changes to the substitution codes at the procedure level.
            //Only syncing insurance level substitution links.  Changes made to the _listSubstLinks have been made already.
            //All we need to do know is sync the changes made with _listSubstLinksOld.
            SubstitutionLinks.Sync(_listSubstLinks, _listSubstLinksOld);
            DialogResult = DialogResult.OK;
        }