Example #1
0
        /// <summary>
        /// Gets the claim batch.
        /// </summary>
        /// <param name="claimBatchStatus">The claim batch status.</param>
        /// <param name="payorType">Type of the payor.</param>
        /// <returns>
        /// A ClaimBatch.
        /// </returns>
        public ClaimBatch GetClaimBatch(ClaimBatchStatus claimBatchStatus, PayorType payorType)
        {
            var claimBatch = Session.QueryOver <ClaimBatch> ()
                             .Where(c => c.PayorType == payorType && c.ClaimBatchStatus == claimBatchStatus)
                             .List()
                             .FirstOrDefault();

            return(claimBatch);
        }
Example #2
0
        public IList <Entities.ClaimBatch> QueryAllClaimBatch(out int totalRecord, out int totalcountinresult, string search, int start, int lenght, string sortColumn, string sortOrder, int scrProvider, int month, int year, Utility.ClaimBatch Batch, string zone, int otherFilters, ClaimBatchStatus status, out int noofprovider, out decimal totalamountcaptured, out decimal totalproccessed, int remoteonly, int batchid)
        {
            IQueryOver <Entities.ClaimBatch, Entities.ClaimBatch> query = _session.QueryOver <Entities.ClaimBatch>().Where(x => x.IsDeleted == false);



            if (batchid > 0)
            {
                query.Where(x => x.Id == batchid);
            }
            else
            {
                if (Batch != Utility.ClaimBatch.All)
                {
                    query.Where(x => x.Batch == Batch);
                }
                if (status == ClaimBatchStatus.Default)
                {
                    query.Where(x => x.status == status || x.status == ClaimBatchStatus.Capturing);
                }
                else
                {
                    if (status == ClaimBatchStatus.Vetting)
                    {
                        //get the capturing
                        query.Where(x => x.status == status);
                    }
                    else if (status == ClaimBatchStatus.ReviewingANDAwaitingApproval)
                    {
                        query.Where(x => x.status == ClaimBatchStatus.AwaitingApproval || status == ClaimBatchStatus.Reviewing);
                    }
                    else if (status == ClaimBatchStatus.All)
                    {
                        //dont add this shit if its all

                        //do nothing bro.
                    }
                    else
                    {
                        query.Where(x => x.status == status);
                    }
                }
                if (month > -1)
                {
                    query.Where(x => x.month == month);
                }


                if (year > -1)
                {
                    query.Where(x => x.year == year);
                }

                if (scrProvider > -1)
                {
                    query.Where(x => x.ProviderId == scrProvider);
                }
                //query.Where(x=>x.)


                if (remoteonly == 2)
                {
                    if (status == ClaimBatchStatus.Vetting)
                    {
                        query.Where(x => x.isremote);
                    }
                }
                else if (remoteonly == 3)
                {
                    if (status == ClaimBatchStatus.Vetting)
                    {
                        query.Where(x => x.isremote == false);
                    }
                }



                if (!string.IsNullOrEmpty(zone))
                {
                    List <int> splitted = new List <int>();

                    foreach (string item in zone.Split(','))
                    {
                        int intt = -1;
                        int.TryParse(item, out intt);

                        if (intt > -1)
                        {
                            splitted.Add(intt);
                        }
                        //added else
                        else
                        {
                        }
                    }


                    if (splitted.Any())
                    {
                        List <int> states = (List <int>)_session.QueryOver <State>().WhereRestrictionOn(x => x.Zone).IsIn(splitted).SelectList(a => a.Select(p => p.Id)).List <int>();


                        //var ids = new List<int> { 1, 2, 5, 7 };
                        //var query2 = _session.QueryOver<Provider>().Where(x => x.IsDeleted == false && x.AuthorizationStatus == 2 );
                        List <int> providers = (List <int>)_session.QueryOver <Provider>().WhereRestrictionOn(w => w.State).IsIn(states).SelectList(a => a.Select(p => p.Id)).List <int>();
                        query
                        .WhereRestrictionOn(w => w.ProviderId).IsIn(providers);
                    }
                    //added else
                    else
                    {
                    }
                }
            }



            totalRecord  = query.RowCount();
            noofprovider = totalRecord;


            totalamountcaptured = 0m;
            totalproccessed     = 0m;



            IList <Entities.ClaimBatch> buffer = query.List();

            foreach (Entities.ClaimBatch item in buffer)
            {
                foreach (Claim claim in item.Claims)
                {
                    totalamountcaptured = totalamountcaptured + Convert.ToDecimal(claim.DrugList.Sum(x => x.InitialAmount) + claim.ServiceList.Sum(x => x.InitialAmount));
                    totalproccessed     = totalproccessed + Convert.ToDecimal(claim.DrugList.Sum(x => x.VettedAmount) + claim.ServiceList.Sum(x => x.VettedAmount));
                }
            }



            totalcountinresult = totalRecord;
            //var list = new List<Entities.ClaimBatch>();


            if (status == ClaimBatchStatus.Vetting)
            {
                return(query.OrderBy(x => x.VetDate).Asc.Skip(start).Take(lenght).List());
            }
            else
            {
                return(query.OrderBy(x => x.CreatedOn).Desc.Skip(start).Take(lenght).List());
            }


            //return list;
        }
Example #3
0
 public IList <Entities.ClaimBatch> QueryAllClaimBatch(out int toltareccount, out int totalinresult, string empty, bool v1, bool v2, string sortColumnnumber, string sortOrder, int v3, int v4, int v5, Utility.ClaimBatch claimBatch, string zone, int v6, ClaimBatchStatus vetting, out int providercount, out decimal totalamount, out decimal totalprocessed, int channelint, int clambatchiddd)
 {
     throw new NotImplementedException();
 }
Example #4
0
 /// <summary>
 /// Revises the claim batch status.
 /// </summary>
 /// <param name="claimBatchStatus">The claim batch status.</param>
 public virtual void ReviseClaimBatchStatus( ClaimBatchStatus claimBatchStatus)
 {
     ClaimBatchStatus = claimBatchStatus;
 }
Example #5
0
 /// <summary>
 /// Revises the claim batch status.
 /// </summary>
 /// <param name="claimBatchStatus">The claim batch status.</param>
 public virtual void ReviseClaimBatchStatus(ClaimBatchStatus claimBatchStatus)
 {
     ClaimBatchStatus = claimBatchStatus;
 }