Ejemplo n.º 1
0
 /// <summary>
 /// Adds the claim line item.
 /// </summary>
 /// <param name="claimLineItem">The claim line item.</param>
 public virtual void AddClaimLineItem(ClaimLineItem claimLineItem)
 {
     Check.IsNotNull(claimLineItem, "Claim Line Item is required.");
     claimLineItem.ReviseClaim(this);
     _claimLineItems.Add(claimLineItem);
     NotifyItemAdded(() => ClaimLineItems, claimLineItem);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes the claim line item.
 /// </summary>
 /// <param name="claimLineItem">The claim line item.</param>
 public virtual void RemoveClaimLineItem(ClaimLineItem claimLineItem)
 {
     Check.IsNotNull(claimLineItem, "Claim Line Item is required.");
     _claimLineItems.Remove(claimLineItem);
     NotifyItemRemoved(() => ClaimLineItems, claimLineItem);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds the claim line item.
 /// </summary>
 /// <param name="claimLineItem">The claim line item.</param>
 public virtual void AddClaimLineItem(ClaimLineItem claimLineItem)
 {
     Check.IsNotNull(claimLineItem, "Claim Line Item is required.");
     claimLineItem.ReviseClaim ( this );
     _claimLineItems.Add ( claimLineItem );
     NotifyItemAdded ( () => ClaimLineItems, claimLineItem );
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Removes the claim line item.
 /// </summary>
 /// <param name="claimLineItem">The claim line item.</param>
 public virtual void RemoveClaimLineItem(ClaimLineItem claimLineItem)
 {
     Check.IsNotNull(claimLineItem, "Claim Line Item is required.");
     _claimLineItems.Remove ( claimLineItem );
     NotifyItemRemoved ( () => ClaimLineItems, claimLineItem );
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Generates the claim.
        /// </summary>
        /// <returns>A claim object.</returns>
        public virtual Claim GenerateClaim()
        {
            var claimFactory = IoC.CurrentContainer.Resolve<IClaimFactory> ();

            var patientAccount = PatientAccount;
            var payor = (from payorCoverage in patientAccount.PayorCoverages
                         where payorCoverage.PayorCoverageType.WellKnownName == WellKnownNames.PatientAccountModule.PayorCoverageType.Primary &&
                         (payorCoverage.EffectiveCoverageDateRange.StartDate <= ServiceDate && payorCoverage.EffectiveCoverageDateRange.EndDate >= ServiceDate) //TODO: make sure the endDate is not null
                         select payorCoverage.Payor).FirstOrDefault();

            if (payor == null)
            {
                throw new InvalidOperationException(string.Format("{0} does not have primary payor coverage.", patientAccount.Name));
            }

            // Only get the active primary payor coverage in the  1st round
            // TODO: implement claims for 2nd or 3rd payor coverage
            var claim = claimFactory.CreateClaim(
                this, payor, ChargeAmount, PatientAccount, ServiceLocation, ServiceDate);

            //Create Claim line item
            foreach (var service in Services)
            {
                var claimLineItem = new ClaimLineItem(
                    service.BillingUnitCount, service.ChargeAmount, service.Diagnosis, service.MedicalProcedure.ProcedureCode);

                claim.AddClaimLineItem(claimLineItem);
            }

            return claim;
        }