Ejemplo n.º 1
0
        ///<summary>Gets the fee schedule from the priinsplan, the patient, or the provider in that order.  Either returns a fee schedule (fk to definition.DefNum) or 0.</summary>
        public static int GetFeeSched(Patient pat, InsPlan[] PlanList, PatPlan[] patPlans)
        {
            //there's not really a good place to put this function, so it's here.
            int retVal = 0;

            if (PatPlans.GetPlanNum(patPlans, 1) != 0)
            {
                InsPlan PlanCur = InsPlans.GetPlan(PatPlans.GetPlanNum(patPlans, 1), PlanList);
                if (PlanCur == null)
                {
                    retVal = 0;
                }
                else
                {
                    retVal = PlanCur.FeeSched;
                }
            }
            if (retVal == 0)
            {
                if (pat.FeeSched != 0)
                {
                    retVal = pat.FeeSched;
                }
                else
                {
                    if (pat.PriProv == 0)
                    {
                        retVal = Providers.List[0].FeeSched;
                    }
                    else
                    {
                        //MessageBox.Show(Providers.GetIndex(Patients.Cur.PriProv).ToString());
                        retVal = Providers.ListLong[Providers.GetIndexLong(pat.PriProv)].FeeSched;
                    }
                }
            }
            return(retVal);
        }