Exemple #1
0
 public void appends_suffix()
 {
     var provider = new Provider();
     provider.SetName("", "Test", "", "Provider", "III","");
     var result = GenerateDirectUrl(provider);
     Assert.AreEqual("test-provider-iii", result.ToString());
 }
Exemple #2
0
 public void appends_prefix()
 {
     var provider = new Provider();
     provider.SetName("Mrs.", "Test", "", "Provider", "","");
     var result = GenerateDirectUrl(provider);
     Assert.AreEqual("mrs-test-provider", result.ToString());
 }
Exemple #3
0
 public void appends_first_last_middle_name()
 {
     var provider = new Provider();
     provider.SetName("", "Test", "joe", "Provider", "","");
     var result = GenerateDirectUrl(provider);
     Assert.AreEqual("test-joe-provider", result.ToString());
 }
Exemple #4
0
 public void appends_full_name()
 {
     var provider = new Provider();
     provider.SetName("Mr", "Test", "T", "Provider", "Jr","PhD");
     var result = GenerateDirectUrl(provider);
     Assert.IsTrue(result.Equals("mr-test-t-provider-jr-phd"));
 }
        public static void CapturePropertiesForUpdate(ProviderV2 source, Provider existingProvider)
        {
            existingProvider.Npi = (string.IsNullOrEmpty(source.Npi) ? null : (long?)long.Parse(source.Npi, CultureInfo.InvariantCulture)) ?? existingProvider.Npi;

            existingProvider.SetName(
                source.NamePrefix ?? existingProvider.NamePrefix,
                source.FirstName ?? existingProvider.FirstName,
                source.MiddleName ?? existingProvider.MiddleName,
                source.LastName ?? existingProvider.LastName,
                source.NameSuffix ?? existingProvider.NameSuffix,
                source.AdditionalSuffix ?? existingProvider.AdditionalSuffix);

            existingProvider.AdditionalInformation = source.AdditionalInformation ?? existingProvider.AdditionalInformation;
            existingProvider.SetDateOfBirth(source.DateOfBirth != null ? ConvertToNullibleDateTime(source.DateOfBirth, null, "DateOfBirth", existingProvider.FullName) : existingProvider.DateOfBirth);
            existingProvider.SetEmail(source.Email ?? existingProvider.Email);
            existingProvider.SetFax(source.Fax ?? existingProvider.Fax);
            existingProvider.SetInPracticeSince(source.InPracticeSince != null ? ConvertToNullibleDateTime(source.InPracticeSince, null, "InPracticeSince", existingProvider.FullName) : existingProvider.InPracticeSince);
            existingProvider.IsEnabled = source.IsEnabled != null ? ConvertToBool(source.IsEnabled, true, "IsEnabled", existingProvider.FullName) : existingProvider.IsEnabled;
            existingProvider.PhilosophyOfCare = source.PhilosophyOfCare ?? existingProvider.PhilosophyOfCare;
            existingProvider.SetPhone(source.Phone ?? existingProvider.Phone);
            existingProvider.SetWebsite(source.Website ?? existingProvider.Website);
            existingProvider.SetAboutMe(source.AboutMe ?? existingProvider.AboutMe);
            existingProvider.VideoContent = source.VideoContent ?? existingProvider.VideoContent;
            existingProvider.UpdatedDate = DateTime.UtcNow;
            existingProvider.Keywords = source.Keywords ?? existingProvider.Keywords;
            existingProvider.CustomKeywords = source.CustomKeywords ?? existingProvider.CustomKeywords;
            existingProvider.ExcludedKeywords = source.ExcludedKeywords ?? existingProvider.ExcludedKeywords;
            existingProvider.ImageUrl = source.ImageUrl ?? existingProvider.ImageUrl;
            existingProvider.PictureId = source.PictureId == null ? existingProvider.PictureId : ConvertToNullibleInt(source.PictureId, "PictureId", existingProvider.FullName);

            existingProvider.Custom1 = source.Custom1 ?? existingProvider.Custom1;
            existingProvider.Custom2 = source.Custom2 ?? existingProvider.Custom2;
            existingProvider.Custom3 = source.Custom3 ?? existingProvider.Custom3;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderMapper"/> class.
 /// </summary>
 /// <param name="provider">The provider.</param>
 public ProviderMapper(Provider provider)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     _provider = provider;
 }
Exemple #7
0
 public void appends_primary_specialty()
 {
     var provider = new Provider();
     provider.SetName("", "Test", "", "Provider", "","");
     provider.AddSpecialty(new Specialty() { Name = "Cardiology" });
     var result = GenerateDirectUrl(provider);
     Assert.AreEqual("test-provider-cardiology", result.ToString());
 }
Exemple #8
0
 public void can_add_language()
 {
     var subject = new Provider() {Id = 1};
     var language = new Language(false, 1, "English", true);
     var providerLanguage = subject.AddLanguage(language);
     Assert.IsNotNull(providerLanguage);
     Assert.AreSame(language, providerLanguage.Language);
     Assert.AreSame(subject, providerLanguage.Provider);
 }
Exemple #9
0
 public void can_add_specialty()
 {
     var subject = new Provider() { Id = 1 };
     var specialty = new Specialty() { Id = 1 };
     var providerSpecialty = subject.AddSpecialty(specialty);
     Assert.IsNotNull(providerSpecialty);
     Assert.AreSame(specialty, providerSpecialty.Specialty);
     Assert.AreSame(subject, providerSpecialty.Provider);
 }
Exemple #10
0
 public void can_add_location()
 {
     var subject = new Provider() { Id = 1 };
     var orgUnit = new OrgUnit() { Id = 1 };
     var providerOrgUnit = subject.AddOrgUnit(orgUnit);
     Assert.IsNotNull(providerOrgUnit);
     Assert.AreSame(orgUnit, providerOrgUnit.OrgUnit);
     Assert.AreSame(subject, providerOrgUnit.Provider);
 }
 public ProviderEducation(Provider provider, EducationType educationType, string institutionName)
     : this()
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     Provider = provider;
     SetEducationType(educationType);
     SetInstitutionName(institutionName);
 }
        public ProviderCertificationSpecialty(Provider provider, CertificationSpecialty certificationSpecialty, string yearOfIssuance)
            : this()
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            Provider = provider;
            SetCertificationSpecialty(certificationSpecialty);
            SetYearOfIssuance(yearOfIssuance);
        }
 public ProviderProviderType(Provider provider, ProviderType providerType)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (providerType == null)
     {
         throw new ArgumentNullException("ProviderType");
     }
     Provider = provider;
     ProviderType = providerType;
 }
 public ProviderClinicalInterest(Provider provider, ClinicalInterest clinicalInterest)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (clinicalInterest == null)
     {
         throw new ArgumentNullException("clinicalInterest");
     }
     Provider = provider;
     ClinicalInterest = clinicalInterest;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderPageTitle"/> class.
 /// </summary>
 /// <param name="provider">The provider.</param>
 /// <param name="seoSettings">The seo settings.</param>
 public ProviderPageTitle(Provider provider, SeoSettings seoSettings)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (seoSettings == null)
     {
         throw new ArgumentNullException("seoSettings");
     }
     _provider = provider;
     _seoSettings = seoSettings;
 }
Exemple #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DirectUrl"/> class.
 /// </summary>
 /// <param name="objectContext">The existing providers.</param>
 /// <param name="provider">The provider.</param>
 /// <param name="SettingsManager">The settings manager</param>
 public DirectUrl(ObjectContext objectContext, Provider provider, ISettingsManager SettingsManager)
 {
     if (objectContext == null)
     {
         throw new ArgumentNullException("objectContext");
     }
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     _objectContext = objectContext;
     _provider = provider;
     _settingsManager = SettingsManager;
 }
Exemple #17
0
        public void can_change_primary_location()
        {
            var subject = new Provider() { Id = 1 };
            var locationA = new OrgUnit() { Id = 1 };
            var providerLocationA = subject.AddOrgUnit(locationA);

            var locationB = new OrgUnit() { Id = 2 };
            var providerLocationB = subject.AddOrgUnit(locationB);

            subject.SetPrimaryOrgUnit(providerLocationB);

            Assert.IsFalse(providerLocationA.IsPrimary.Value);
            Assert.IsTrue(providerLocationB.IsPrimary.Value);
        }
 public ProviderSpecialty(Provider provider, Specialty specialty)
     : this()
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (specialty == null)
     {
         throw new ArgumentNullException("specialty");
     }
     Provider = provider;
     Specialty = specialty;
 }
 public ProviderOrgUnit(Provider provider, OrgUnit orgUnit)
     : this()
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (orgUnit == null)
     {
         throw new ArgumentNullException("orgUnit");
     }
     Provider = provider;
     OrgUnit = orgUnit;
 }
 public ProviderLanguage(Provider provider, Language language, bool isPrimary)
     : this()
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (language == null)
     {
         throw new ArgumentNullException("language");
     }
     Provider = provider;
     Language = language;
     IsPrimary = isPrimary;
 }
Exemple #21
0
        public void maps_providerOrgUnit()
        {
            var provider = new Provider
            {
                Id = 123
            };

            var orgUnit = new OrgUnit
            {
                Id = 1,
                Description = "test desc",
                Name = "test",
                IsEnabled = true
            };

            var providerOrgUnit = new ProviderOrgUnit(provider, orgUnit);

            var providerOrgUnitDto = Mapper.Map<ProviderOrgUnit, ProviderOrgUnitDto>(providerOrgUnit);

            Assert.IsNotNull(providerOrgUnitDto);
        }
Exemple #22
0
        public void maps_education()
        {
            var provider = new Provider
            {
                Id = 123
            };

            var educationType = new EducationType(Guid.NewGuid().ToString(), true);
            //var educationType = new EducationType();
            educationType.Id = 567;
            var providerEducation = new ProviderEducation(provider, educationType, Guid.NewGuid().ToString());
            providerEducation.SetYearCompleted(null);

            var education = Mapper.Map<ProviderEducation, ProviderEducationDto>(providerEducation);

            Assert.IsNotNull(education);
            Assert.AreEqual(providerEducation.Id, education.Id);
            Assert.AreEqual(providerEducation.EducationType.Name, education.EducationTypeName);
            Assert.AreEqual(providerEducation.InstitutionName, education.InstitutionName);
            Assert.AreEqual(providerEducation.IsCompleted, education.IsCompleted);
            Assert.AreEqual(providerEducation.YearCompleted, education.YearCompleted);
        }
        public static void AddExternalIdMapping(ObjectContext context, ProviderV2 source, Provider provider)
        {
            if (!string.IsNullOrEmpty(source.ProviderExternalId))
            {
                var existingMappings = context.CreateObjectSet<DataImportEntityIdMap>()
                    .Where(m => m.EntityName == "Provider" && m.InternalId == provider.Id)
                    .ToList();

                if (existingMappings.Count == 1)
                {
                    if (existingMappings[0].ExternalId != source.ProviderExternalId)
                    {
                        // Update ExternalId on existing mapping
                        existingMappings[0].ExternalId = source.ProviderExternalId;
                    }
                }
                else
                {
                    // Remove ambiguous mappings (if any)
                    if (existingMappings.Count > 1)
                    {
                        foreach (var mapping in existingMappings)
                        {
                            context.DeleteObject(mapping);
                        }
                    }

                    // Create new mapping
                    context.AddObject("DataImportEntityIdMaps", new DataImportEntityIdMap
                    {
                        EntityName = "Provider",
                        DataImportId = 2,
                        InternalId = provider.Id,
                        ExternalId = source.ProviderExternalId
                    });
                }
            }
        }
 private void AssertIsCorrectProviderName(Provider provider, string title)
 {
     var firstPart = title.Split(',')[0].Trim();
     Assert.AreEqual(provider.FullName, firstPart);
 }
 private void AssertIsCorrectSpecialties(Provider provider, string title)
 {
     foreach (var specialtyName in provider.ProviderSpecialties
         .OrderByDescending(ps => ps.IsPrimary)
         .ThenBy(ps => ps.Specialty.Name)
         .Take(3)
         .Select(ps => ps.Specialty.Name))
     {
         Assert.IsTrue(title.Contains(specialtyName));
     }
 }
 private Provider CreateProvider()
 {
     var provider = new Provider() { Id = _providerId };
     return provider;
 }
Exemple #27
0
        public void throws_exception_when_setting_primary_language_to_fluent()
        {
            var subject = new Provider() { Id = 1 };
            var english = new Language(false, 1, "English", true);
            var spanish = new Language(false, 2, "Spanish", true);

            var englishAdded = subject.AddLanguage(english);
            var spanishAdded = subject.AddLanguage(spanish);

            Provider.SetFluentLanguage(englishAdded, true);
        }
Exemple #28
0
        public void can_change_primary_specialty()
        {
            var subject = new Provider() { Id = 1 };
            var specialtyA = new Specialty() { Id = 1 };
            var providerSpecialtyA = subject.AddSpecialty(specialtyA);

            var specialtyB = new Specialty() { Id = 2 };
            var providerSpecialtyB = subject.AddSpecialty(specialtyB);

            subject.SetPrimarySpecialty(providerSpecialtyB);

            Assert.IsFalse(providerSpecialtyA.IsPrimary);
            Assert.IsTrue(providerSpecialtyB.IsPrimary);
        }
 private ProviderOrgUnit CreateProviderOrgUnit()
 {
     var provider = new Provider() { Id = 1 };
     var orgUnit = new OrgUnit() { Id = 1 };
     orgUnit.OrgUnitPublished = new OrgUnitPublished
                                 {
                                     InsurancesOrgUnit = orgUnit,
                                     SchedulesOrgUnit = orgUnit
                                 };
     return provider.AddOrgUnit(orgUnit);
 }
        private static void BuildKeywordsWithInternalSynonymGenerator(Provider provider, ISettingsManager settingsManager)
        {
            var combinedExcludedKeywords = KeywordUtils.AddSanitizedKeywordsToArray(_globalExcludedKeywords, provider.ExcludedKeywords);
            var excludedWords = string.Join(",", combinedExcludedKeywords);

            var newKeywords = BuildKeywordsWithSynonyms(settingsManager, provider.Keywords, excludedWords);
            provider.Keywords = newKeywords;
        }