Example #1
0
public Loop2200D(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){
ClaimStatusTrackingNumber = new TrnCollection(this, nameof(ClaimStatusTrackingNumber));
SegmentCollections.Add(ClaimStatusTrackingNumber);
ClaimLevelStatusInformation = new StcCollection(this, nameof(ClaimLevelStatusInformation));
SegmentCollections.Add(ClaimLevelStatusInformation);
PayerClaimControlNumber = new RefCollection(this, nameof(PayerClaimControlNumber));
SegmentCollections.Add(PayerClaimControlNumber);
InstitutionalBillTypeIdentification = new RefCollection(this, nameof(InstitutionalBillTypeIdentification));
SegmentCollections.Add(InstitutionalBillTypeIdentification);
PatientControlNumber = new RefCollection(this, nameof(PatientControlNumber));
SegmentCollections.Add(PatientControlNumber);
PharmacyPrescriptionNumber = new RefCollection(this, nameof(PharmacyPrescriptionNumber));
SegmentCollections.Add(PharmacyPrescriptionNumber);
VoucherIdentifier = new RefCollection(this, nameof(VoucherIdentifier));
SegmentCollections.Add(VoucherIdentifier);
ClaimIdentificationNumberForClearinghousesAnd = new RefCollection(this, nameof(ClaimIdentificationNumberForClearinghousesAnd));
SegmentCollections.Add(ClaimIdentificationNumberForClearinghousesAnd);
ClaimServiceDate = new DtpCollection(this, nameof(ClaimServiceDate));
SegmentCollections.Add(ClaimServiceDate);
 
ServiceLineInformationLoop = new Loop2220DCollection("Loop2220D", nameof(ServiceLineInformationLoop), OwningDoc, parent, parent);
ChildLoopCollections.Add(ServiceLineInformationLoop);
DependentLevelLoop = new Loop2000ECollection("Loop2000E", nameof(DependentLevelLoop), OwningDoc, parent, parent);
ChildLoopCollections.Add(DependentLevelLoop);
DependentNameLoop = new Loop2100ECollection("Loop2100E", nameof(DependentNameLoop), OwningDoc, parent, parent);
ChildLoopCollections.Add(DependentNameLoop);
ClaimStatusTrackingNumberLoop = new Loop2200ECollection("Loop2200E", nameof(ClaimStatusTrackingNumberLoop), OwningDoc, parent, parent);
ChildLoopCollections.Add(ClaimStatusTrackingNumberLoop);
}
Example #2
0
 public Loop2200C(LoopCollectionBase parent) : base(parent)
 {
     ProviderOfServiceTraceIdentifier = new TrnCollection(this, nameof(ProviderOfServiceTraceIdentifier));
     SegmentCollections.Add(ProviderOfServiceTraceIdentifier);
     ProviderStatusInformation = new StcCollection(this, nameof(ProviderStatusInformation));
     SegmentCollections.Add(ProviderStatusInformation);
 }
Example #3
0
        public Loop2200E(LoopCollectionBase parent) : base(parent)
        {
            ClaimStatusTrackingNumber = new TrnCollection(this, nameof(ClaimStatusTrackingNumber));
            SegmentCollections.Add(ClaimStatusTrackingNumber);
            ClaimLevelStatusInformation = new StcCollection(this, nameof(ClaimLevelStatusInformation));
            SegmentCollections.Add(ClaimLevelStatusInformation);
            PayerClaimControlNumber = new RefCollection(this, nameof(PayerClaimControlNumber));
            SegmentCollections.Add(PayerClaimControlNumber);
            InstitutionalBillTypeIdentification = new RefCollection(this, nameof(InstitutionalBillTypeIdentification));
            SegmentCollections.Add(InstitutionalBillTypeIdentification);
            PatientControlNumber = new RefCollection(this, nameof(PatientControlNumber));
            SegmentCollections.Add(PatientControlNumber);
            PharmacyPrescriptionNumber = new RefCollection(this, nameof(PharmacyPrescriptionNumber));
            SegmentCollections.Add(PharmacyPrescriptionNumber);
            VoucherIdentifier = new RefCollection(this, nameof(VoucherIdentifier));
            SegmentCollections.Add(VoucherIdentifier);
            ClaimIdentificationNumberForClearinghousesAnd =
                new RefCollection(this, nameof(ClaimIdentificationNumberForClearinghousesAnd));
            SegmentCollections.Add(ClaimIdentificationNumberForClearinghousesAnd);
            ClaimServiceDate = new DtpCollection(this, nameof(ClaimServiceDate));
            SegmentCollections.Add(ClaimServiceDate);

            ServiceLineInformationLoop = new Loop2220ECollection("Loop2220E", nameof(ServiceLineInformationLoop), parent.OwningX12Doc, parent);
            ChildLoopCollections.Add(ServiceLineInformationLoop);
        }
Example #4
0
        public JsonResult Tender(TrnCollection content)
        {
            var repos  = new Repository.TrnCollection();
            var result = repos.Save(content);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
    public Loop2200E(X12Doc owningDoc, LoopEntity prev, LoopCollection parent) : base(owningDoc, prev, parent)
    {
        ClaimStatusTrackingNumber = new TrnCollection(this, nameof(ClaimStatusTrackingNumber));
        SegmentCollections.Add(ClaimStatusTrackingNumber);
        PayerClaimControlNumber = new RefCollection(this, nameof(PayerClaimControlNumber));
        SegmentCollections.Add(PayerClaimControlNumber);
        InstitutionalBillTypeIdentification = new RefCollection(this, nameof(InstitutionalBillTypeIdentification));
        SegmentCollections.Add(InstitutionalBillTypeIdentification);
        ApplicationOrLocationSystemIdentifier = new RefCollection(this, nameof(ApplicationOrLocationSystemIdentifier));
        SegmentCollections.Add(ApplicationOrLocationSystemIdentifier);
        GroupNumber = new RefCollection(this, nameof(GroupNumber));
        SegmentCollections.Add(GroupNumber);
        PatientControlNumber = new RefCollection(this, nameof(PatientControlNumber));
        SegmentCollections.Add(PatientControlNumber);
        PharmacyPrescriptionNumber = new RefCollection(this, nameof(PharmacyPrescriptionNumber));
        SegmentCollections.Add(PharmacyPrescriptionNumber);
        ClaimIdentificationNumberForClearinghousesAnd = new RefCollection(this, nameof(ClaimIdentificationNumberForClearinghousesAnd));
        SegmentCollections.Add(ClaimIdentificationNumberForClearinghousesAnd);
        ClaimSubmittedCharges = new AmtCollection(this, nameof(ClaimSubmittedCharges));
        SegmentCollections.Add(ClaimSubmittedCharges);
        ClaimServiceDate = new DtpCollection(this, nameof(ClaimServiceDate));
        SegmentCollections.Add(ClaimServiceDate);

        ServiceLineInformationLoop = new Loop2210ECollection("Loop2210E", nameof(ServiceLineInformationLoop), OwningDoc, parent, parent);
        ChildLoopCollections.Add(ServiceLineInformationLoop);
    }
Example #6
0
 public Loop2200B(LoopCollectionBase parent) : base(parent)
 {
     InformationReceiverTraceIdentifier = new TrnCollection(this, nameof(InformationReceiverTraceIdentifier));
     SegmentCollections.Add(InformationReceiverTraceIdentifier);
     InformationReceiverStatusInformation =
         new StcCollection(this, nameof(InformationReceiverStatusInformation));
     SegmentCollections.Add(InformationReceiverStatusInformation);
 }
Example #7
0
public Loop2200C(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){
ProviderOfServiceTraceIdentifier = new TrnCollection(this, nameof(ProviderOfServiceTraceIdentifier));
SegmentCollections.Add(ProviderOfServiceTraceIdentifier);
ProviderStatusInformation = new StcCollection(this, nameof(ProviderStatusInformation));
SegmentCollections.Add(ProviderStatusInformation);
 
SubscriberLevelLoop = new Loop2000DCollection("Loop2000D", nameof(SubscriberLevelLoop), OwningDoc, parent, parent);
ChildLoopCollections.Add(SubscriberLevelLoop);
SubscriberNameLoop = new Loop2100DCollection("Loop2100D", nameof(SubscriberNameLoop), OwningDoc, parent, parent);
ChildLoopCollections.Add(SubscriberNameLoop);
}
        public HttpResponseMessage SaveCollection(TrnCollection collection)
        {
            try
            {
                var currentUser = from d in db.MstUsers
                                  where d.AspNetId == User.Identity.GetUserId()
                                  select d;

                if (currentUser.Any())
                {
                    var currentCollection = from d in db.TrnCollections where d.Id == Convert.ToInt32(collection.Id) select d;

                    if (currentCollection.Any())
                    {
                        if (currentCollection.FirstOrDefault().IsLocked == false)
                        {
                            var UpdateTrnCollection = currentCollection.FirstOrDefault();

                            UpdateTrnCollection.CollectionDate  = Convert.ToDateTime(collection.CollectionDate);
                            UpdateTrnCollection.ManualNumber    = collection.ManualNumber;
                            UpdateTrnCollection.CustomerId      = collection.CustomerId;
                            UpdateTrnCollection.Particulars     = collection.Particulars;
                            UpdateTrnCollection.PreparedBy      = collection.PreparedBy;
                            UpdateTrnCollection.CheckedBy       = collection.CheckedBy;
                            UpdateTrnCollection.ApprovedBy      = collection.ApprovedBy;
                            UpdateTrnCollection.CreatedBy       = collection.CheckedBy;
                            UpdateTrnCollection.UpdatedBy       = collection.UpdatedBy;
                            UpdateTrnCollection.UpdatedDateTime = DateTime.Today;

                            db.SubmitChanges();

                            return(Request.CreateResponse(HttpStatusCode.OK));
                        }
                        else
                        {
                            return(Request.CreateResponse(HttpStatusCode.BadRequest, "Collection is Saved!"));
                        }
                    }
                    else
                    {
                        return(Request.CreateResponse(HttpStatusCode.BadRequest, "Collection not exist!"));
                    }
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest));
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
        public HttpResponseMessage unCollection(TrnCollection collection)
        {
            try
            {
                var currentUser = from d in db.MstUsers
                                  where d.AspNetId == User.Identity.GetUserId()
                                  select d;
                if (currentUser.Any())
                {
                    var trnCollection = from d in db.TrnCollections where d.Id == Convert.ToInt32(collection.Id) select d;

                    if (trnCollection.Any())
                    {
                        var UnLockTrnCollection = trnCollection.FirstOrDefault();
                        UnLockTrnCollection.IsLocked        = false;
                        UnLockTrnCollection.UpdatedBy       = currentUser.FirstOrDefault().Id;
                        UnLockTrnCollection.UpdatedDateTime = DateTime.Now;
                        db.SubmitChanges();

                        var collectionPayments = from d in db.TrnCollectionPayments
                                                 where d.CollectionId == Convert.ToInt32(collection.Id)
                                                 group d by new { d.SoldUnitId } into g
                        select g.Key;

                        if (collectionPayments.ToList().Any())
                        {
                            foreach (var collectionPayment in collectionPayments)
                            {
                                UpdateAccountsReceivable(collectionPayment.SoldUnitId);
                            }
                        }

                        return(Request.CreateResponse(HttpStatusCode.OK));
                    }
                    else
                    {
                        return(Request.CreateResponse(HttpStatusCode.OK));
                    }
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest));
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
        public HttpResponseMessage LockCollection(TrnCollection collection)
        {
            try
            {
                var currentUser = from d in db.MstUsers
                                  where d.AspNetId == User.Identity.GetUserId()
                                  select d;

                if (currentUser.Any())
                {
                    var currentCollection = from d in db.TrnCollections where d.Id == Convert.ToInt32(collection.Id) select d;

                    if (currentCollection.Any())
                    {
                        if (currentCollection.FirstOrDefault().IsLocked == false)
                        {
                            var UpdateTrnCollection = currentCollection.FirstOrDefault();
                            UpdateTrnCollection.CollectionDate  = Convert.ToDateTime(collection.CollectionDate);
                            UpdateTrnCollection.ManualNumber    = collection.ManualNumber;
                            UpdateTrnCollection.CustomerId      = collection.CustomerId;
                            UpdateTrnCollection.Particulars     = collection.Particulars;
                            UpdateTrnCollection.PreparedBy      = collection.PreparedBy;
                            UpdateTrnCollection.CheckedBy       = collection.CheckedBy;
                            UpdateTrnCollection.ApprovedBy      = collection.ApprovedBy;
                            UpdateTrnCollection.IsLocked        = true;
                            UpdateTrnCollection.CreatedBy       = collection.CheckedBy;
                            UpdateTrnCollection.UpdatedBy       = collection.UpdatedBy;
                            UpdateTrnCollection.UpdatedDateTime = DateTime.Today;
                            db.SubmitChanges();

                            var collectionPayments = from d in db.TrnCollectionPayments
                                                     where d.CollectionId == Convert.ToInt32(collection.Id)
                                                     group d by new { d.SoldUnitId } into g
                            select g.Key;

                            if (collectionPayments.ToList().Any())
                            {
                                foreach (var collectionPayment in collectionPayments)
                                {
                                    UpdateAccountsReceivable(collectionPayment.SoldUnitId);
                                }
                            }

                            return(Request.CreateResponse(HttpStatusCode.OK));
                        }
                        else
                        {
                            return(Request.CreateResponse(HttpStatusCode.BadRequest, "Collection is Locked!"));
                        }
                    }
                    else
                    {
                        return(Request.CreateResponse(HttpStatusCode.BadRequest, "Collection not exist!"));
                    }
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest));
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }