Esempio n. 1
0
        public List <Service> GetServices(Domain2.Cases.Case @case, Provider provider, DateTime refDate)
        {
            var insurance      = @case.GetActiveInsuranceAtDate(refDate)?.Insurance;
            var providerTypeID = provider.ProviderTypeID;

            return(GetServices(insurance, providerTypeID, refDate));
        }
Esempio n. 2
0
        private static Domain2.Cases.Case ReferralToCase(Referral r)
        {
            var c = new Domain2.Cases.Case
            {
                DateCreated          = DateTime.UtcNow,
                GeneratingReferralID = r.ID,
                StatusNotes          = r.StatusNotes,
                RequiredHoursNotes   = r.ReferrerNotes
            };

            return(c);
        }
        //[TestMethod]
        //public void AuthResolverRemovesExistingBreakdowns() {

        //}

        //[TestMethod]
        //public void AuthResolverNoAuthsIfNoInsurance() {

        //}

        //[TestMethod]
        //public void AuthResolveNoAuthsIfNoInsuranceAuthMatchRules() {

        //}

        //[TestMethod]
        //public void AuthResolverMatchesRulesOnServiceAndProviderType() {

        //}

        private static Mock<IResolutionServiceRepository> CreateMockResolutionServiceRepository()
        {
            var repoMock = new Mock<IResolutionServiceRepository>();
            var c = new Domain2.Cases.Case();
            var patient = new Domain2.Patients.Patient();
            var insurance = new Domain2.Insurances.Insurance();

            c.Patient = patient;
            patient.Insurance = insurance;

            repoMock.Setup(x => x.GetCase(It.IsAny<int>())).Returns(c);
            repoMock.Setup(x => x.GetActiveInsurance(It.IsAny<int>(), It.IsAny<DateTime>())).Returns(c.Patient.Insurance);
            return repoMock;
        }
Esempio n. 4
0
        public static Case MapCase(Domain2.Cases.Case source)
        {
            if (source == null)
            {
                return(null);
            }
            var result = new Case
            {
                ID      = source.ID,
                Patient = MapPatient(source.Patient),
                ActiveAuthorizations = source.GetActiveAuthorizations().Select(MapAuthorization),
                ActiveInsurance      = MapInsurance(source.GetActiveInsuranceAtDate(DateTime.Now)?.Insurance)
            };

            return(result);
        }
Esempio n. 5
0
        private Mock <Repositories.IResolutionServiceRepository> GetRepositoryMock(bool includeFinalized = false)
        {
            var mock = new Mock <Repositories.IResolutionServiceRepository>();

            var case1 = new Domain2.Cases.Case();
            var case2 = new Domain2.Cases.Case();

            case1.ID = 1;
            case2.ID = 1;

            case1.Hours = new List <Domain2.Hours.Hours>();
            case2.Hours = new List <Domain2.Hours.Hours>();

            case1.Hours.Add(new Domain2.Hours.Hours()
            {
                Status = Domain2.Hours.HoursStatus.ComittedByProvider, Date = new DateTime(2017, 1, 1)
            });
            case1.Hours.Add(new Domain2.Hours.Hours()
            {
                Status = Domain2.Hours.HoursStatus.ComittedByProvider, Date = new DateTime(2017, 1, 1)
            });
            case2.Hours.Add(new Domain2.Hours.Hours()
            {
                Status = Domain2.Hours.HoursStatus.ComittedByProvider, Date = new DateTime(2017, 1, 1)
            });
            case2.Hours.Add(new Domain2.Hours.Hours()
            {
                Status = Domain2.Hours.HoursStatus.ComittedByProvider, Date = new DateTime(2017, 1, 1)
            });

            if (includeFinalized)
            {
                case2.Hours.Add(new Domain2.Hours.Hours()
                {
                    Status = Domain2.Hours.HoursStatus.FinalizedByProvider, Date = new DateTime(2017, 1, 1)
                });
            }

            mock.Setup(x => x.GetSSGCases(It.IsAny <Domain2.Hours.Hours>())).Returns(() => new List <Domain2.Cases.Case>()
            {
                case1, case2
            });

            return(mock);
        }
Esempio n. 6
0
        public void CaseMappingsMapsFromDomain()
        {
            var domain = new Domain2.Cases.Case();
            var mapper = new CaseMapping();

            domain.ID = 101;

            domain.Patient           = new Domain2.Patients.Patient();
            domain.Patient.FirstName = "John";
            domain.Patient.LastName  = "Doe";

            var sut = mapper.FromDomain(domain);

            Assert.IsNotNull(sut);
            Assert.IsNotNull(sut.Patient);
            Assert.IsNotNull(sut.ActiveAuthorizations);
            // insurance can be null
            Assert.IsInstanceOfType(sut, typeof(SharedEntities.Entities.Case));
            Assert.AreEqual(101, sut.ID);
            Assert.AreEqual("John", sut.Patient.PatientFirstName);
            Assert.AreEqual("Doe", sut.Patient.PatientLastName);
        }
Esempio n. 7
0
 public List <Service> GetServices(Domain2.Cases.Case @case, Provider provider)
 {
     return(GetServices(@case, provider, DateTime.Now));
 }