public void returns_empty_collection_for_provider()
        {
            //setup
            var request = new ListProviderCertificationSpecialtyRequest();
            request.ProviderId = _idWith0CertificationSpecialties;
            var handler = CreateHandler();

            //act
            var response = HandleRequest<ListProviderCertificationSpecialtyResponse>(handler, request);

            //assert
            Assert.AreEqual(0, response.CertificationSpecialties.Count());
        }
Esempio n. 2
0
        public static List<Field> PopulateBoardCertificationsFieldData(ModuleInstanceView parent, ProviderSearchResultDto provider, Field templateField)
        {
            var boardCertificationsFields = new List<Field>();
            var request = new ListProviderCertificationSpecialtyRequest() { ProviderId = provider.Id };
            var response = parent.ProcessRequest<ListProviderCertificationSpecialtyResponse>(request);

            foreach (var certification in response.CertificationSpecialties)
            {
                var certificationField = (Field)templateField.Clone();

                foreach (var column in certificationField.FieldColumns)
                {
                    foreach (var field in column.Fields)
                    {
                        switch (field.FieldName)
                        {
                            case "CertificationAgency":
                                field.Value = certification.CertificationAgencyName;
                                break;
                            case "MemberBoard":
                                field.Value = certification.CertificationBoardName;
                                break;
                            case "Specialty":
                                field.Value = certification.CertificationSpecialtyName;
                                break;
                            case "YearofIssuance":
                                field.Value = certification.YearOfIssuance;
                                break;
                        }
                    }
                }

                boardCertificationsFields.Add(certificationField);
            }

            return boardCertificationsFields;
        }
Esempio n. 3
0
        private string GetProvider(ConvertServiceRequest request)
        {
            var providerId = 0;
            if (request.Parameters.ContainsKey("externalId"))
            {
                providerId = LookupDataEntityMapId(request.Parameters["externalId"], false);
            }
            else if (request.Parameters.ContainsKey("id"))
            {
                if (!int.TryParse(request.Parameters["id"], out providerId))
                    throw new BusinessException("Provider Id must be a valid integer");
            }

            // create the requests
            var profileRequest = new ReadProviderProfileRequest { ProviderId = providerId, BypassCache = true };
            var locationsRequest = new ListProviderOrgUnitsRequest { ProviderId = providerId, BypassCache = true, IncludeExternalIds = true };
            var educationRequest = new ListProviderEducationRequest { ProviderId = providerId, BypassCache = true, IncludeIncomplete = true };
            var languageRequst = new ListProviderLanguagesRequest { ProviderId = providerId, BypassCache = true };
            var clinicalRequest = new ListProviderClinicalInterestRequest { ProviderId = providerId, BypassCache = true };
            var certificationRequest = new ListProviderCertificationSpecialtyRequest { ProviderId = providerId, BypassCache = true };
            var orgUnitAffiliationRequest = new ListProviderOrgUnitAffiliationRequest { ProviderId = providerId, ShowAdminList = true, BypassCache = true };
            var providerTypesRequest = new ListProviderProviderTypeRequest { ProviderId = providerId, BypassCache = true };
            var providerSpecialtiesRequest = new ListProviderSpecialtiesRequest { ProviderId = providerId, BypassCache = true };

            // add the requests to the dispatcher
            var provider = ProcessRequest<ReadProviderProfileResponse>(profileRequest).Provider;
            var locations = ProcessRequest<ListProviderOrgUnitsResponse>(locationsRequest).OrgUnits;
            var educations = ProcessRequest<ListProviderEducationResponse>(educationRequest).Records;
            var languages = ProcessRequest<ListProviderLanguagesResponse>(languageRequst).Languages;
            var clinicalInterests = ProcessRequest<ListProviderClinicalInterestResponse>(clinicalRequest).ClinicalInterests;
            var certifications = ProcessRequest<ListProviderCertificationSpecialtyResponse>(certificationRequest).CertificationSpecialties;
            var orgUnitAffiliations = ProcessRequest<ListProviderOrgUnitAffiliationResponse>(orgUnitAffiliationRequest).Records;
            var providerTypes = ProcessRequest<ListProviderProviderTypeResponse>(providerTypesRequest).ProviderTypes;
            var providerSpecialties = ProcessRequest<ListProviderSpecialtiesResponse>(providerSpecialtiesRequest).ProviderSpecialties;

            var viewModel = new ProviderV2
            {
                ProviderId = provider.Id.ToString(CultureInfo.InvariantCulture),
                Npi = provider.Npi.HasValue ? provider.Npi.Value.ToString(CultureInfo.InvariantCulture) : null,
                NamePrefix = provider.NamePrefix,
                FirstName = provider.FirstName,
                MiddleName = provider.MiddleName,
                LastName = provider.LastName,
                NameSuffix = provider.NameSuffix,
                AdditionalSuffix = provider.AdditionalSuffix,
                Gender = provider.Gender,
                DateOfBirth = provider.DateOfBirth.HasValue ? provider.DateOfBirth.Value.ToString(CultureInfo.InvariantCulture) : string.Empty,
                Phone = provider.Phone,
                Fax = provider.Fax,
                Email = provider.Email,
                Website = provider.Website,
                PhilosophyOfCare = provider.PhilosophyOfCare,
                AdditionalInformation = provider.AdditionalInformation,
                InPracticeSince = provider.InPracticeSince.HasValue ? provider.InPracticeSince.Value.ToString(CultureInfo.InvariantCulture) : string.Empty,
                ProviderGroup = provider.ProviderGroupName,
                PictureId = provider.PictureId == 0 ? null : provider.PictureId.ToString(CultureInfo.InvariantCulture),
                ImageUrl = provider.ImageUrl,
                VideoContent = provider.VideoContent,
                AboutMe = provider.AboutMe,
                IsEnabled = provider.IsEnabled.ToString(CultureInfo.InvariantCulture),
                ProviderExternalId = provider.ProviderExternalId,
                Keywords = provider.Keywords,
                CustomKeywords = provider.CustomKeywords,
                ExcludedKeywords = provider.ExcludedKeywords,
                Custom1 = provider.Custom1,
                Custom2 = provider.Custom2,
                Custom3 = provider.Custom3,
                DynamicColumns = provider.DynamicColumns,

                Specialties = providerSpecialties.Select(s => new ProviderSpecialtyV2
                {
                    SpecialtyName = s.SpecialtyName,
                    IsPrimary = s.IsPrimary.ToString(CultureInfo.InvariantCulture),
                    IsBoardCertified = s.IsBoardCertified.ToString(CultureInfo.InvariantCulture),
                    SpecialtyType = s.SpecialtyType
                }).ToList(),

                Languages = languages.Select(l => new ProviderLanguageV2
                {
                    LanguageName = l.LanguageName,
                    IsFluent = l.IsFluent.ToString(CultureInfo.InvariantCulture),
                    IsPrimary = l.IsPrimary.ToString(CultureInfo.InvariantCulture)
                }).ToList(),

                EducationTypes = educations.Select(e => new ProviderEducationV2
                {
                    EducationTypeName = e.EducationTypeName,
                    YearCompleted = e.YearCompleted,
                    InstitutionName = e.InstitutionName,
                    IsComplete = e.IsCompleted.ToString(CultureInfo.InvariantCulture)
                }).ToList(),

                ClinicalInterests = clinicalInterests.Select(c => new ProviderClinicalInterestV2
                {
                    Name = c.ClinicalInterestName
                }).ToList(),

                OrgUnits = locations.Select(o => new ProviderOrgUnitV2
                {
                    OrgUnitId = o.OrgUnitId.ToString(CultureInfo.InvariantCulture),
                    OrgUnitExternalId = o.OrgUnitExternalId,
                    Phone = o.DisplayPhone,
                    Fax = o.DisplayFax,
                    IsPrimary = o.IsPrimary.ToString(CultureInfo.InvariantCulture),
                    IsAcceptingNewPatients = o.IsAcceptingNewPatients.ToString(CultureInfo.InvariantCulture),
                    ProviderOrgUnitId = o.Id.ToString(CultureInfo.InvariantCulture),
                    Insurances = o.Insurance.Where(i => !i.IsInheritedDisabled).Select(i => new ProviderOrgUnitInsuranceV2
                    {
                        Name = i.InsuranceName
                    }).ToList(),
                    Services = o.Service.Select(s => new ProviderOrgUnitServiceV2
                    {
                        Name = s.ServiceName
                    }).ToList(),
                    Schedules = o.Schedule.Select(s => new ProviderOrgUnitScheduleV2
                    {
                        OpenTime = s.Open,
                        CloseTime = s.Close,
                        DayOfWeek = s.Day
                    }).ToList(),
                    DisabledInheritedInsurances = o.Insurance.Where(i => i.IsInherited && i.IsInheritedDisabled).Select(i => new DisabledInheritedInsuranceV2
                    {
                        Name = i.InsuranceName
                    }).ToList()
                }).ToList(),

                CertificationAgencies = certifications.Select(c => new CertificationAgencyV2
                {
                    AgencyName = c.CertificationAgencyName,
                    CertificationBoards = new CertificationBoardV2[1]{new CertificationBoardV2
                {
                    BoardName = c.CertificationBoardName,
                    CertificationSpecialties = new CertificationSpecialtyV2[1]{new CertificationSpecialtyV2
                    {
                        Name = c.CertificationSpecialtyName,
                        YearOfIssuance = c.YearOfIssuance
                    }}.ToList()
                }}.ToList()
                }).ToList(),

                OrgUnitAffiliations = orgUnitAffiliations.Select(a => new ProviderOrgUnitAffiliationV2
                {
                    OrgUnitId = a.OrgUnitId.ToString(CultureInfo.InvariantCulture),
                    OrgUnitTypeId = a.OrgUnitTypeId.ToString(CultureInfo.InvariantCulture),
                    Service = a.ServiceName
                }).ToList(),

                ProviderTypes = providerTypes.Select(t => new ProviderTypeV2
                {
                    Name = t.ProviderTypeName
                }).ToList()
            };

            return CommonUtils.XmlSerialize(viewModel);
        }
 private static IEnumerable<ProviderCertificationSpecialtyDto> GetProviderCertificationSpecialties(ProviderAdminDetailView parent, int providerId)
 {
     var request = new ListProviderCertificationSpecialtyRequest() { ProviderId = providerId };
     return parent.ProcessRequest<ListProviderCertificationSpecialtyResponse>(request).CertificationSpecialties;
 }