public void returns_empty_collection_for_provider() { //setup var request = new ListProviderEducationRequest(); request.ProviderId = _idWith0Education; var handler = CreateHandler(); //act var response = HandleRequest<ListProviderEducationResponse>(handler, request); //assert Assert.AreEqual(0, response.Records.Count()); }
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 List<Field> PopulateEducationsFieldData(ModuleInstanceView parent, ProviderProfileDto provider, Field templateField) { var educationFields = new List<Field>(); var request = new ListProviderEducationRequest() { ProviderId = provider.Id }; var response = parent.ProcessRequest<ListProviderEducationResponse>(request); foreach (var education in response.Records) { var locationField = (Field)templateField.Clone(); foreach (var column in locationField.FieldColumns) { foreach (var field in column.Fields) { switch (field.FieldName) { case "EducationType": field.Value = education.EducationTypeName; break; case "InstitutionName": field.Value = education.InstitutionName; break; case "IsCompleted": field.Value = education.IsCompleted; break; case "YearCompleted": field.Value = education.YearCompleted; break; } } } educationFields.Add(locationField); } return educationFields; }
private static IEnumerable<ProviderEducationDto> GetProviderEducations(ProviderAdminDetailView parent, int providerId) { var request = new ListProviderEducationRequest() { ProviderId = providerId, IncludeIncomplete = true }; return parent.ProcessRequest<ListProviderEducationResponse>(request).Records; }