Exemplo n.º 1
0
        private CaseProvider getBaseAide()
        {
            var subject = new CaseProvider();

            subject.Provider = new Providers.Provider();
            subject.Provider.ProviderType      = new Providers.ProviderType();
            subject.Provider.ProviderType.Code = "AIDE";
            return(subject);
        }
Exemplo n.º 2
0
        public void SupervisorRoleReturnsFalseIfNotBCBA()
        {
            CaseProvider subject = getBaseAide();

            subject.IsSupervisor = true;

            bool result = subject.VerifyRoles(DateTime.Now);

            Assert.IsFalse(result);
        }
Exemplo n.º 3
0
        public void AuthorizedBCBAReturnsFalseIfNotBCBA()
        {
            CaseProvider subject = getBaseAide();

            subject.IsAuthorizedBCBA = true;

            bool result = subject.VerifyRoles(DateTime.Now);

            Assert.IsFalse(result);
        }
Exemplo n.º 4
0
        public List <CaseAuthorizationHours> GetCaseHoursByCaseByProvider(int caseID, int providerID, DateTime?cutoffDate = null)
        {
            var context = new Models.CoreEntityModel();

            IQueryable <Models.CaseAuthHour> q;

            if (cutoffDate == null)
            {
                q =
                    (from auths in context.CaseAuthCodes
                     join hours in context.CaseAuthHours on auths.ID equals hours.CaseAuthID
                     where auths.CaseID == caseID && hours.CaseProviderID == providerID
                     select hours)
                    .Union(
                        from hours in context.CaseAuthHours
                        where hours.CaseID == caseID && hours.CaseProviderID == providerID
                        select hours
                        );
            }
            else
            {
                q =
                    (from auths in context.CaseAuthCodes
                     join hours in context.CaseAuthHours on auths.ID equals hours.CaseAuthID
                     where auths.CaseID == caseID && hours.CaseProviderID == providerID && hours.HoursDate >= cutoffDate.Value
                     select hours)
                    .Union(
                        from hours in context.CaseAuthHours
                        where hours.CaseID == caseID && hours.CaseProviderID == providerID && hours.HoursDate >= cutoffDate.Value
                        select hours
                        );
            }



            var providerHours = q.ToList();

            var list = Mappings.AuthorizationMappings.CaseAuthorizationHours(providerHours);

            var services = GetServices();

            var providerService = new ProviderService();

            foreach (var hours in list)
            {
                hours.Service = services.Where(x => x.ID == hours.Service.ID).FirstOrDefault();
                var provider = providerService.GetProvider(hours.ProviderID);
                Domain.Cases.CaseProvider cp = new CaseProvider();
                cp.FirstName   = provider.FirstName;
                cp.LastName    = provider.LastName;
                hours.Provider = cp;
            }

            return(list);
        }
Exemplo n.º 5
0
        public void AuthorizedBCBARoleFailsIfMoreThanOneAuthorizedBCBA()
        {
            CaseProvider subject = getBaseVerifyRoles();

            subject.Case.Providers.First().IsAuthorizedBCBA = true;
            subject.IsAuthorizedBCBA = true;

            bool results = subject.VerifyRoles(DateTime.Now);

            Assert.IsFalse(results);
        }
Exemplo n.º 6
0
        public void SupervisorRolesFailsIfMoreThanOneSupervisor()
        {
            CaseProvider subject = getBaseVerifyRoles();

            subject.Case.Providers.First().IsSupervisor = true;
            subject.IsSupervisor = true;

            bool results = subject.VerifyRoles(DateTime.Now);

            Assert.IsFalse(results);
        }