Exemplo n.º 1
0
        public JsonResult getDoctorByID(long serviceProviderID, long typeId, long itemid)
        {
            // long typid = 56; // retturn only doctor

            ServiceProvider serviceProviders = null;
            ServiceProvidedWithReferrerFee onlyserviceProviders = new ServiceProvidedWithReferrerFee();

            using (ServiceProviderRepository repository = new ServiceProviderRepository())
            {
                serviceProviders = repository.GetById(serviceProviderID);



                ServiceProvidedWithReferrerFee serviceProvider = new ServiceProvidedWithReferrerFee();
                Contact contact = new Contact();
                serviceProvider.Contact = contact;

                serviceProvider.Contact.FirstName = serviceProviders.Contact.FirstName;
                serviceProvider.Contact.LastName  = serviceProviders.Contact.LastName;
                serviceProvider.Id         = serviceProviders.Id;
                serviceProvider.Speciality = serviceProviders.Speciality;

                Referral referral = new Referral();

                using (ReferralRepository referrerrepository = new ReferralRepository())
                {
                    referral = referrerrepository.GetReferrer(serviceProvider.Id, itemid);
                    serviceProvider.ReferralFee = referral.ReferralFee;
                }

                onlyserviceProviders = serviceProvider;
            }

            return(Json(onlyserviceProviders, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public JsonResult GetServiceProviderPartialName(string name, long itemid)
        {
            //List<ServiceProvider> serviceProviders = null;
            //List<ServiceProvider> onlyserviceProviders = new List<ServiceProvider>();
            //Contact contact = new Contact();

            //using (ServiceProviderRepository repository = new ServiceProviderRepository())
            //{
            //    serviceProviders = repository.GetServiceProviderPartialName(name,itemid).ToList();

            //    ServiceProvider serviceProvider = new ServiceProvider();
            //    serviceProvider.Contact = contact;

            //    foreach (ServiceProvider item in serviceProviders)
            //    {
            //        serviceProvider.Id = item.Id;
            //        serviceProvider.ContactId = item.ContactId;

            //        serviceProvider.Contact.FirstName = item.Contact.FirstName;
            //        serviceProvider.Contact.LastName = item.Contact.LastName;
            //        onlyserviceProviders.Add(serviceProvider);
            //    }

            //    return Json(onlyserviceProviders, JsonRequestBehavior.AllowGet);
            //    //serviceProviders.ForEach(c => onlyserviceProviders.Add(new ServiceProvider()
            //    //{
            //    //    Id = c.Id,
            //    //    Contact.FirstName = c.Contact.FirstName
            //    //}));
            //}

            List <Referral> referrals     = null;
            List <Referral> onlyReferrals = new List <Referral>();

            using (ReferralRepository repository = new ReferralRepository())
            {
                referrals = repository.GetServiceProviderPartialName(name, itemid).ToList();

                foreach (Referral item in referrals)
                {
                    Referral        referral        = new Referral();
                    ServiceProvider serviceProvider = new ServiceProvider();
                    Contact         contact         = new Contact();
                    serviceProvider.Contact  = contact;
                    referral.ServiceProvider = serviceProvider;

                    referral.Id                = item.Id;
                    referral.ItemId            = item.ItemId;
                    referral.ReferralFee       = item.ReferralFee;
                    referral.ServiceProviderId = item.ServiceProviderId;
                    referral.ServiceProvider.Contact.FirstName = item.ServiceProvider.Contact.FirstName;
                    referral.ServiceProvider.Contact.LastName  = item.ServiceProvider.Contact.LastName;
                    referral.ServiceProvider.Speciality        = item.ServiceProvider.Speciality;
                    onlyReferrals.Add(referral);
                }
                return(Json(onlyReferrals, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 3
0
        public ExperienceData(IContactProfileProvider contactProfileProvider, IProfileProvider profileProvider)
        {
            this.contactProfileProvider = contactProfileProvider;
            this.profileProvider        = profileProvider;

            Visits         = new VisitsRepository(contactProfileProvider).Get();
            PersonalInfo   = new PersonalInfoRepository(contactProfileProvider).Get();
            OnsiteBehavior = new OnsiteBehaviorRepository(profileProvider).Get();
            Referral       = new ReferralRepository().Get();
        }
        public ReferralRepositoryTests()
        {
            var contextFixture = new ReferralRepositoryFixture();

            var bonusEngineContext = contextFixture.ReferralContext;

            var msSqlContextFactory = new SqlContextFactoryFake <ReferralContext>(c => bonusEngineContext);

            _referralRepository = new ReferralRepository(msSqlContextFactory, MapperHelper.CreateAutoMapper());
        }
Exemplo n.º 5
0
        public Examination AppendExamination(Examination examination, MedicalRecord medicalRecord)
        {
            foreach (Prescription p in examination.Prescription)
            {
                DrugStateChange oldState = p.drug.drugStateChange;
                DrugStateChange newState = new DrugStateChange(DateTime.Now, oldState.TotalNumber - (int)p.Number, oldState.Threshold, oldState.DrugId);
                DrugStateChangeRepository.GetInstance().Create(newState);
                p.drug.drugStateChange = newState;
                DrugRepository.GetInstance().Update(p.drug);
                PrescriptionRepository.GetInstance().Create(p);
            }

            foreach (Referral r in examination.Referral)
            {
                ReferralRepository.GetInstance().Create(r);
            }
            examination = ExaminationRepository.GetInstance().Create(examination);

            medicalRecord.AddExamination(examination);
            MedicalRecordRepository.GetInstance().Update(medicalRecord);
            return(examination);
        }
Exemplo n.º 6
0
        public JsonResult getdoctorpartialname(string name, long typeId, long itemid)
        {
            // long typid = 56; // retturn only doctor

            List <ServiceProvider> serviceProviders = null;
            List <ServiceProvidedWithReferrerFee> onlyserviceProviders = new List <ServiceProvidedWithReferrerFee>();

            using (ServiceProviderRepository repository = new ServiceProviderRepository())
            {
                serviceProviders = repository.GetServiceProviderPartialName(name, typeId).ToList();

                foreach (ServiceProvider item in serviceProviders)
                {
                    ServiceProvidedWithReferrerFee serviceProvider = new ServiceProvidedWithReferrerFee();
                    Contact contact = new Contact();
                    serviceProvider.Contact = contact;

                    serviceProvider.Contact.FirstName = item.Contact.FirstName;
                    serviceProvider.Contact.LastName  = item.Contact.LastName;
                    serviceProvider.Id         = item.Id;
                    serviceProvider.Speciality = item.Speciality;

                    Referral referral = new Referral();

                    using (ReferralRepository referrerrepository = new ReferralRepository())
                    {
                        referral = referrerrepository.GetReferrer(serviceProvider.Id, itemid);
                        serviceProvider.ReferralFee = referral.ReferralFee;
                    }

                    onlyserviceProviders.Add(serviceProvider);
                }
            }

            return(Json(onlyserviceProviders, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
        public void Get_Call_ShouldCombineActiveAndHistoricCampaigns(string site, CurrentInteraction currentInteraction, ITracker tracker, [Frozen] ICampaignRepository campaignRepository, [Greedy] ReferralRepository referralRepository)
        {
            //Arrange
            tracker.Interaction.Returns(currentInteraction);
            tracker.Interaction.ReferringSite.Returns(site);

            campaignRepository.GetCurrent().Returns(new Campaign()
            {
                Title = "camp1"
            });
            campaignRepository.GetHistoric().Returns(new[] { new Campaign()
                                                             {
                                                                 Title = "camp2"
                                                             }, new Campaign()
                                                             {
                                                                 Title = "camp3"
                                                             } });

            using (new TrackerSwitcher(tracker))
            {
                //Act
                var referral = referralRepository.Get();
                //Assert
                referral.TotalNoOfCampaigns.Should().Be(3);
                referral.Campaigns.Select(x => x.Title).Should().Contain(new[] { "camp1", "camp2", "camp3", });
            }
        }
Exemplo n.º 8
0
        public void Get_Call_ShouldReturnReferringSite(string site, CurrentInteraction currentInteraction, ITracker tracker, ICampaignRepository campaignRepository, [Greedy] ReferralRepository referralRepository)
        {
            //Arrange
            tracker.Interaction.Returns(currentInteraction);
            tracker.Interaction.ReferringSite.Returns(site);

            using (new TrackerSwitcher(tracker))
            {
                //Act
                var referral = referralRepository.Get();
                //Assert
                referral.ReferringSite.Should().Be(site);
            }
        }
Exemplo n.º 9
0
 public ExperienceData(VisitsRepository visitsRepository, PersonalInfoRepository personalInfoRepository, OnsiteBehaviorRepository onsiteBehaviorRepository, ReferralRepository referralRepository, ITrackerService trackerService)
 {
     this.Visits         = visitsRepository.Get();
     this.PersonalInfo   = personalInfoRepository.Get();
     this.OnsiteBehavior = onsiteBehaviorRepository.Get();
     this.Referral       = referralRepository.Get();
     this.IsActive       = trackerService.IsActive;
 }
Exemplo n.º 10
0
        internal static BaseEntityRepo GetRepo <T>(MIDASGBXEntities context)
        {
            BaseEntityRepo repo = null;

            if (typeof(T) == typeof(BO.Company))
            {
                repo = new CompanyRepository(context);
            }
            else if (typeof(T) == typeof(BO.Signup))
            {
                repo = new CompanyRepository(context);
            }
            else if (typeof(T) == typeof(BO.User))
            {
                repo = new UserRepository(context);
            }
            else if (typeof(T) == typeof(BO.OTP))
            {
                repo = new OTPRepository(context);
            }
            else if (typeof(T) == typeof(BO.PasswordToken))
            {
                repo = new PasswordTokenRepository(context);
            }
            else if (typeof(T) == typeof(BO.Location))
            {
                repo = new LocationRepository(context);
            }
            else if (typeof(T) == typeof(BO.Invitation))
            {
                repo = new InvitationRepository(context);
            }
            else if (typeof(T) == typeof(BO.SaveLocation))
            {
                repo = new LocationRepository(context);
            }
            else if (typeof(T) == typeof(BO.AddUser))
            {
                repo = new UserRepository(context);
            }
            else if (typeof(T) == typeof(BO.ValidateOTP))
            {
                repo = new OTPRepository(context);
            }
            else if (typeof(T) == typeof(BO.Specialty))
            {
                repo = new SpecialityRepository(context);
            }
            else if (typeof(T) == typeof(BO.SpecialtyDetails))
            {
                repo = new SpecialityDetailsRepository(context);
            }
            else if (typeof(T) == typeof(BO.CompanySpecialtyDetails))
            {
                repo = new CompanySpecialityDetailsRepository(context);
            }
            else if (typeof(T) == typeof(BO.Doctor))
            {
                repo = new DoctorRepository(context);
            }
            else if (typeof(T) == typeof(BO.DoctorSpeciality))
            {
                repo = new DoctorSpecialityRepository(context);
            }
            else if (typeof(T) == typeof(BO.RoomTest))
            {
                repo = new RoomTestRepository(context);
            }
            else if (typeof(T) == typeof(BO.Room))
            {
                repo = new RoomRepository(context);
            }
            else if (typeof(T) == typeof(BO.Schedule))
            {
                repo = new ScheduleRepository(context);
            }
            else if (typeof(T) == typeof(BO.UserCompany))
            {
                repo = new UserCompanyRepository(context);
            }
            else if (typeof(T) == typeof(BO.DoctorLocationSchedule))
            {
                repo = new DoctorLocationScheduleRepository(context);
            }
            else if (typeof(T) == typeof(List <BO.DoctorLocationSchedule>))
            {
                repo = new DoctorLocationScheduleRepository(context);
            }
            //else if (typeof(T) == typeof(BO.Patient))
            //{
            //    repo = new PatientRepository(context);
            //}
            else if (typeof(T) == typeof(BO.Log))
            {
                repo = new LogRepository(context);
            }
            else if (typeof(T) == typeof(BO.UserCompany))
            {
                repo = new UserCompanyRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.State))
            {
                repo = new StateRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.City))
            {
                repo = new CityRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.MaritalStatus))
            {
                repo = new MaritalStatusRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.Gender))
            {
                repo = new GenderRepository(context);
            }
            else if (typeof(T) == typeof(BO.Patient))
            {
                repo = new PatientRepository(context);
            }
            else if (typeof(T) == typeof(BO.Case))
            {
                repo = new CaseRepository(context);
            }
            else if (typeof(T) == typeof(BO.PatientInsuranceInfo))
            {
                repo = new PatientInsuranceInfoRepository(context);
            }
            else if (typeof(T) == typeof(BO.PatientEmpInfo))
            {
                repo = new PatientEmpInfoRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.PolicyOwner))
            {
                repo = new PolicyOwnerRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.InsuranceType))
            {
                repo = new InsuranceTypeRepository(context);
            }
            else if (typeof(T) == typeof(BO.PatientAccidentInfo))
            {
                repo = new PatientAccidentInfoRepository(context);
            }
            else if (typeof(T) == typeof(BO.PatientFamilyMember))
            {
                repo = new PatientFamilyMemberRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.PatientType))
            {
                repo = new PatientTypeRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.Relation))
            {
                repo = new RelationRepository(context);
            }
            else if (typeof(T) == typeof(BO.RefferingOffice))
            {
                repo = new RefferingOfficeRepository(context);
            }
            else if (typeof(T) == typeof(BO.AttorneyMaster))
            {
                repo = new AttorneyMasterRepository(context);
            }
            else if (typeof(T) == typeof(BO.CaseInsuranceMapping))
            {
                repo = new CaseInsuranceMappingRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.CaseType))
            {
                repo = new CaseTypeRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.CaseStatus))
            {
                repo = new CaseStatusRepository(context);
            }
            else if (typeof(T) == typeof(BO.AdjusterMaster))
            {
                repo = new AdjusterMasterRepository(context);
            }
            else if (typeof(T) == typeof(BO.InsuranceMaster))
            {
                repo = new InsuranceMasterRepository(context);
            }
            //else if (typeof(T) == typeof(BO.PatientVisit))
            //{
            //    repo = new PatientVisitRepository(context);
            //}
            //else if (typeof(T) == typeof(BO.PatientVisitEvent))
            //{
            //    repo = new PatientVisitEventRepository(context);
            //}
            else if (typeof(T) == typeof(BO.PatientVisit))
            {
                repo = new PatientVisitRepository(context);
            }
            else if (typeof(T) == typeof(BO.CalendarEvent))
            {
                repo = new CalendarEventRepository(context);
            }
            else if (typeof(T) == typeof(BO.CaseCompanyMapping))
            {
                repo = new CaseCompanyMappingRepository(context);
            }
            else if (typeof(T) == typeof(BO.CompanyCaseConsentApproval))
            {
                repo = new CompanyCaseConsentApprovalRepository(context);
            }
            //else if (typeof(T) == typeof(BO.Referral))
            //{
            //    repo = new ReferralRepository(context);
            //}
            else if (typeof(T) == typeof(BO.Document))
            {
                repo = new FileUploadRepository(context);
            }
            else if (typeof(T) == typeof(BO.Notification))
            {
                repo = new NotificationRepository(context);
            }
            else if (typeof(T) == typeof(BO.AddPatient))
            {
                repo = new PatientRepository(context);
            }
            else if (typeof(T) == typeof(BO.DiagnosisType))
            {
                repo = new DiagnosisTypeRepository(context);
            }
            else if (typeof(T) == typeof(BO.DiagnosisCode))
            {
                repo = new DiagnosisCodeRepository(context);
            }
            else if (typeof(T) == typeof(BO.ProcedureCode))
            {
                repo = new ProcedureCodeRepository(context);
            }
            else if (typeof(T) == typeof(BO.CompanyCaseConsentBase64))
            {
                repo = new CompanyCaseConsentApprovalRepository(context);
            }
            else if (typeof(T) == typeof(BO.DocumentNodeObjectMapping))
            {
                repo = new DocumentNodeObjectMappingRepository(context);
            }
            else if (typeof(T) == typeof(BO.PreferredMedicalProviderSignUp))
            {
                repo = new PreferredMedicalProviderRepository(context);
            }
            else if (typeof(T) == typeof(BO.PreferredAttorneyProviderSignUp))
            {
                repo = new PreferredAttorneyProviderRepository(context);
            }
            else if (typeof(T) == typeof(BO.UserPersonalSetting))
            {
                repo = new UserPersonalSettingRepository(context);
            }
            else if (typeof(T) == typeof(BO.PendingReferral))
            {
                repo = new PendingReferralRepository(context);
            }
            else if (typeof(T) == typeof(BO.VisitReports))
            {
                repo = new ReportsRepository(context);
            }
            else if (typeof(T) == typeof(BO.Referral))
            {
                repo = new ReferralRepository(context);
            }
            else if (typeof(T) == typeof(BO.MergePDF) || typeof(T) == typeof(BO.Document) || typeof(T) == typeof(BO.Common.UploadInfo))
            {
                repo = new DocumentManagerRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.TemplateType))
            {
                repo = new TemplateTypeRepository(context);
            }
            else if (typeof(T) == typeof(BO.GeneralSetting))
            {
                repo = new GeneralSettingRepository(context);
            }
            else if (typeof(T) == typeof(BO.PreferredAncillarProviderSignUp))
            {
                repo = new PreferredAncillaryProviderRepository(context);
            }
            else if (typeof(T) == typeof(BO.ProcedureCodeCompanyMapping))
            {
                repo = new ProcedureCodeCompanyMappingRepository(context);
            }
            else if (typeof(T) == typeof(BO.CompanyICDTypeCode))
            {
                repo = new ICDTypeCodeRepository(context);
            }
            else if (typeof(T) == typeof(BO.IMEVisit))
            {
                repo = new IMEvisitRepository(context);
            }
            else if (typeof(T) == typeof(BO.EOVisit))
            {
                repo = new EOVisitRepository(context);
            }
            else if (typeof(T) == typeof(BO.AttorneyVisit))
            {
                repo = new AttorneyVisitRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.LanguagePreference))
            {
                repo = new LanguagePreferenceRepository(context);
            }
            else if (typeof(T) == typeof(BO.Common.SocialMedia))
            {
                repo = new SocialMediaRepository(context);
            }
            else if (typeof(T) == typeof(BO.PatientVisitUnscheduled))
            {
                repo = new PatientVisitUnscheduledRepository(context);
            }
            else if (typeof(T) == typeof(BO.SchoolInformation))
            {
                repo = new SchoolInformationRepository(context);
            }
            else if (typeof(T) == typeof(BO.PlaintiffVehicle))
            {
                repo = new PlaintiffVehicleRepository(context);
            }
            else if (typeof(T) == typeof(BO.DefendantVehicle))
            {
                repo = new DefendantVehicleRepository(context);
            }
            else if (typeof(T) == typeof(BO.PatientPriorAccidentInjury))
            {
                repo = new PatientPriorAccidentInjuryRepository(context);
            }
            else if (typeof(T) == typeof(BO.OTPCompanyMapping))
            {
                repo = new OTPCompanyMappingRepository(context);
            }
            else if (typeof(T) == typeof(BO.ReferralVisitUnscheduled))
            {
                repo = new PatientVisitUnscheduledRepository(context);
            }

            return(repo);
        }