Ejemplo n.º 1
0
        ///<summary>Gets most of the data needed to load the active treatment plan.</summary>
        ///<param name="doFillHistList">If false, then LoadActiveTPData.HistList will be null.</param>
        public static LoadActiveTPData GetLoadActiveTpData(Patient pat, long treatPlanNum, List <Benefit> listBenefits, List <PatPlan> listPatPlans,
                                                           List <InsPlan> listInsPlans, DateTime dateTimeTP, List <InsSub> listInsSubs, bool doFillHistList, bool isTreatPlanSortByTooth,
                                                           List <SubstitutionLink> listSubstLinks)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)           //Remoting role check here to reduce round-trips to the server.
            {
                return(Meth.GetObject <LoadActiveTPData>(MethodBase.GetCurrentMethod(), pat, treatPlanNum, listBenefits, listPatPlans, listInsPlans, dateTimeTP,
                                                         listInsSubs, doFillHistList, isTreatPlanSortByTooth, listSubstLinks));
            }
            LoadActiveTPData data = new LoadActiveTPData();

            data.ListTreatPlanAttaches = TreatPlanAttaches.GetAllForTreatPlan(treatPlanNum);
            List <Procedure> listProcs = Procedures.GetManyProc(data.ListTreatPlanAttaches.Select(x => x.ProcNum).ToList(), false);

            data.listProcForTP = Procedures.SortListByTreatPlanPriority(listProcs.FindAll(x => x.ProcStatus == ProcStat.TP || x.ProcStatus == ProcStat.TPi)
                                                                        , isTreatPlanSortByTooth, data.ListTreatPlanAttaches).ToList();
            //One thing to watch out for here is that we must be absolutely sure to include all claimprocs for the procedures listed,
            //regardless of status.  Needed for Procedures.ComputeEstimates.  This should be fine.
            data.ClaimProcList = ClaimProcs.RefreshForTP(pat.PatNum);
            if (doFillHistList)
            {
                data.HistList = ClaimProcs.GetHistList(pat.PatNum, listBenefits, listPatPlans, listInsPlans, -1, dateTimeTP, listInsSubs);
            }
            List <ProcedureCode> listProcedureCodes = new List <ProcedureCode>();

            foreach (Procedure procedure in listProcs)
            {
                listProcedureCodes.Add(ProcedureCodes.GetProcCode(procedure.CodeNum));
            }
            data.ListFees = Fees.GetListFromObjects(listProcedureCodes, listProcs.Select(x => x.MedicalCode).ToList(), listProcs.Select(x => x.ProvNum).ToList(),
                                                    pat.PriProv, pat.SecProv, pat.FeeSched, listInsPlans, listProcs.Select(x => x.ClinicNum).ToList(), null,//appts can be null because provs already set
                                                    listSubstLinks, pat.DiscountPlanNum);
            return(data);
        }
Ejemplo n.º 2
0
        ///<summary>Gets most of the data needed to load the active treatment plan.</summary>
        ///<param name="doFillHistList">If false, then LoadActiveTPData.HistList will be null.</param>
        public static LoadActiveTPData GetLoadActiveTpData(long patNum, long treatPlanNum, List <Benefit> listBenefits, List <PatPlan> listPatPlans,
                                                           List <InsPlan> listInsPlans, DateTime dateTimeTP, List <InsSub> listInsSubs, bool doFillHistList)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)           //Remoting role check here to reduce round-trips to the server.
            {
                return(Meth.GetObject <LoadActiveTPData>(MethodBase.GetCurrentMethod(), patNum, treatPlanNum, listBenefits, listPatPlans, listInsPlans, dateTimeTP,
                                                         listInsSubs, doFillHistList));
            }
            LoadActiveTPData data = new LoadActiveTPData();

            data.ListTreatPlanAttaches = TreatPlanAttaches.GetAllForTreatPlan(treatPlanNum);
            data.listProcForTP         = Procedures.GetListTPandTPi(Procedures.GetManyProc(data.ListTreatPlanAttaches.Select(x => x.ProcNum).ToList(), false),
                                                                    data.ListTreatPlanAttaches).ToList();
            //One thing to watch out for here is that we must be absolutely sure to include all claimprocs for the procedures listed,
            //regardless of status.  Needed for Procedures.ComputeEstimates.  This should be fine.
            data.ClaimProcList = ClaimProcs.RefreshForTP(patNum);
            if (doFillHistList)
            {
                data.HistList = ClaimProcs.GetHistList(patNum, listBenefits, listPatPlans, listInsPlans, -1, dateTimeTP, listInsSubs);
            }
            data.ListSubLinks = SubstitutionLinks.GetAllForPlans(listInsPlans);
            return(data);
        }