Exemple #1
0
        ///<summary>Deletes the patplan with the specified patPlanNum.  Rearranges the other patplans for the patient to keep the ordinal sequence contiguous.  Then, recomputes all estimates for this patient because their coverage is now different.  Also sets patient.HasIns to the correct value.</summary>
        public static void Delete(long patPlanNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patPlanNum);
                return;
            }
            string    command = "SELECT PatNum FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);
            DataTable table   = Db.GetTable(command);

            if (table.Rows.Count == 0)
            {
                return;
            }
            long           patNum      = PIn.Long(table.Rows[0][0].ToString());
            List <PatPlan> patPlans    = PatPlans.Refresh(patNum);
            bool           doDecrement = false;

            for (int i = 0; i < patPlans.Count; i++)
            {
                if (doDecrement)                 //patPlan has already been deleted, so decrement the rest.
                {
                    command = "UPDATE patplan SET Ordinal=" + POut.Long(patPlans[i].Ordinal - 1)
                              + " WHERE PatPlanNum=" + POut.Long(patPlans[i].PatPlanNum);
                    Db.NonQ(command);
                    continue;
                }
                if (patPlans[i].PatPlanNum == patPlanNum)
                {
                    RemoveAssignedUser(patPlans[i]);
                    command = "DELETE FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);
                    Db.NonQ(command);
                    command = "DELETE FROM benefit WHERE PatPlanNum=" + POut.Long(patPlanNum);
                    Db.NonQ(command);
                    doDecrement = true;
                    InsVerifies.DeleteByFKey(patPlanNum, VerifyTypes.PatientEnrollment);
                }
            }
            Family           fam                = Patients.GetFamily(patNum);
            Patient          pat                = fam.GetPatient(patNum);
            List <ClaimProc> claimProcs         = ClaimProcs.Refresh(patNum);
            List <ClaimProc> listClaimProcsEsts = claimProcs.Where(x => x.Status.In(ClaimProcStatus.Estimate, ClaimProcStatus.CapEstimate)).ToList();
            List <Procedure> procs              = Procedures.Refresh(patNum);

            patPlans = PatPlans.Refresh(patNum);
            List <InsSub>  subList  = InsSubs.RefreshForFam(fam);
            List <InsPlan> planList = InsPlans.RefreshForSubList(subList);
            List <Benefit> benList  = Benefits.Refresh(patPlans, subList);

            Procedures.ComputeEstimatesForAll(patNum, listClaimProcsEsts, procs, planList, patPlans, benList, pat.Age, subList, claimProcs);
            Patients.SetHasIns(patNum);
//Cameron_ Possibly create outbound ADT message to update insurance info
        }
Exemple #2
0
        ///<summary>Deletes the patplan and benefits with the specified patPlanNum.  Does not rearrange the other patplans for the patient.  A patplan must be inserted after this function is called to take the place of the patplan being deleted.</summary>
        public static void DeleteNonContiguous(long patPlanNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patPlanNum);
                return;
            }
            string command = "DELETE FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);

            Db.NonQ(command);
            command = "DELETE FROM benefit WHERE PatPlanNum=" + POut.Long(patPlanNum);
            Db.NonQ(command);
            InsVerifies.DeleteByFKey(patPlanNum, VerifyTypes.PatientEnrollment);
        }
Exemple #3
0
        ///<summary>Deletes the patplan with the specified patPlanNum.  Rearranges the other patplans for the patient to keep the ordinal sequence contiguous.  Then, recomputes all estimates for this patient because their coverage is now different.  Also sets patient.HasIns to the correct value.</summary>
        public static void Delete(long patPlanNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patPlanNum);
                return;
            }
            string    command = "SELECT PatNum FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);
            DataTable table   = Db.GetTable(command);

            if (table.Rows.Count == 0)
            {
                return;
            }
            long           patNum      = PIn.Long(table.Rows[0][0].ToString());
            List <PatPlan> patPlans    = PatPlans.Refresh(patNum);
            bool           doDecrement = false;

            for (int i = 0; i < patPlans.Count; i++)
            {
                if (doDecrement)                 //patPlan has already been deleted, so decrement the rest.
                {
                    command = "UPDATE patplan SET Ordinal=" + POut.Long(patPlans[i].Ordinal - 1)
                              + " WHERE PatPlanNum=" + POut.Long(patPlans[i].PatPlanNum);
                    Db.NonQ(command);
                    continue;
                }
                if (patPlans[i].PatPlanNum == patPlanNum)
                {
                    RemoveAssignedUser(patPlans[i]);
                    command = "DELETE FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);
                    Db.NonQ(command);
                    command = "DELETE FROM benefit WHERE PatPlanNum=" + POut.Long(patPlanNum);
                    Db.NonQ(command);
                    doDecrement = true;
                    InsVerifies.DeleteByFKey(patPlanNum, VerifyTypes.PatientEnrollment);
                }
            }
            InsPlans.ComputeEstimatesForPatNums(new List <long> {
                patNum
            });
//Cameron_ Possibly create outbound ADT message to update insurance info
        }