Ejemplo n.º 1
0
 public Claim AcceptClaim(ClaimId claimId, DateTime responseDate, string response)
 {
     using (var tr = new TransactionScope())
     {
         var claim  = claimRep.GetById(claimId);
         var period = periodRep.GetById(claim.PeriodId);
         claim.Accept(responseDate, response, period);
         tr.Complete();
         return(claim);
     }
 }
Ejemplo n.º 2
0
        public void Delete(int id)
        {
            var autho = _claimRepository.GetById(id);

            if (autho == null)
            {
                return;
            }
            var permissions = autho.Permissions.Select(p => p.PermissionId).ToArray();

            _claimRepository.Delete(id);
            _unitOfWork.Commit();
            _permissionRepository.checkPermissions(permissions);

            _unitOfWork.Commit();
        }
Ejemplo n.º 3
0
        public async Task Update(Claim claim, long claimId, string userName)
        {
            var claimDb = await claimRepository.GetById(claimId);

            if (claimDb == null)
            {
                return;
            }

            using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
            {
                var updatedClaim = await UpdateData(claimDb, claim);

                await claimRepository.Update(updatedClaim, claimId);
                await UpdateAssociatedEntities(claimDb, claim);

                await changeClaimStateService.ChangeState(claim, 0, userName);

                scope.Complete();
            }
        }
Ejemplo n.º 4
0
        public void Adjudicate(long claimId)
        {
            var claim = _claimRepository.GetById(claimId);

            Log.InfoFormat("Adjudicating claim. ClaimId={0}", claimId);

            claim.Alerts.Clear();
            claim.Status = ClaimStatus.Open;

            ISession session = _sessionFactory.CreateSession();

            session.Insert(claim);
            session.Insert(claim.Patient);
            session.Insert(claim.Insured);
            session.Fire();

            var alerts = session.Query <ClaimAlert>();

            foreach (var alert in alerts)
            {
                claim.Alerts.Add(alert);
            }
            _claimRepository.Save(claim);
        }
Ejemplo n.º 5
0
        public ClaimDTO GetClaim(long periodId, long claimId)
        {
            var claim = claimRep.GetById(new ClaimId(claimId));

            return(claimDTOMapper.MapToModel(claim));
        }
Ejemplo n.º 6
0
        public void GetClaimByIdTest()
        {
            var claim = _repository.GetById(1);

            Assert.IsNotNull(claim);
        }
Ejemplo n.º 7
0
        public ClaimDto GetById(long claimId)
        {
            var claim = _claimRepository.GetById(claimId);

            return(Mapper.Map <ClaimDto>(claim));
        }
Ejemplo n.º 8
0
        public async Task <Claim> GetById(long id)
        {
            var claim = await claimRepository.GetById(id);

            return(await setAlarmActivationService.Set(claim));
        }