Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        private List<Field> PopulateLocationsFieldData(ModuleInstanceView parent, ProviderProfileDto provider, Field templateField)
        {
            var locationsFields = new List<Field>();
            var request = new ListProviderOrgUnitsRequest() { ProviderId = provider.Id };
            var response = parent.ProcessRequest<ListProviderOrgUnitsResponse>(request);

            foreach (var location in response.OrgUnits)
            {
                var locationField = (Field)templateField.Clone();

                foreach (var column in locationField.FieldColumns)
                {
                    foreach (var field in column.Fields)
                    {
                        switch (field.FieldName)
                        {
                            case "LocationName":
                                field.Value = location.Name;
                                break;
                            case "LocationAddress":
                                var sb = new StringBuilder();
                                sb.Append(location.Address1 + "<br />");
                                if (!string.IsNullOrEmpty(location.Address2))
                                    sb.Append(location.Address2 + "<br />");
                                sb.AppendFormat("{0}, {1} {2}", location.City, location.State, location.PostalCode);
                                field.Value = sb.ToString();
                                break;
                            case "Phone":
                                field.Value = location.DisplayPhone;
                                break;
                            case "Fax":
                                field.Value = location.DisplayFax;
                                break;
                            case "AcceptingNewPatients":
                                if (location.IsAcceptingNewPatients)
                                    field.Value = field.TrueValue;
                                else
                                    field.Value = field.FalseValue;
                                break;
                            case "Insurances":
                                field.Values.Clear();
                                foreach (var insurance in location.Insurance)
                                    field.Values.Add(insurance.InsuranceName);
                                break;
                            case "Services":
                                field.Values.Clear();
                                foreach (var service in location.Service)
                                    field.Values.Add(service.ServiceName);
                                break;
                            case "Hours":
                                field.Values.Clear();
                                foreach (var schedule in location.Schedule)
                                    field.Values.Add(string.Format("{0} {1}-{2}", schedule.Day, schedule.Open, schedule.Close));
                                break;
                            case "Map":
                                field.Value = "mapDiv_" + location.OrgUnitId;
                                field.MappingProvider = _mappingSettings.MappingProvider.ToString().ToUpperInvariant();
                                field.MapItem = new MapItem()
                                {
                                    Title = location.Name,
                                    Latitude = location.Latitude.HasValue ? location.Latitude.ToString() : string.Empty,
                                    Longitude = location.Longitude.HasValue ? location.Longitude.ToString() : string.Empty,
                                    LocationAddress = string.Format("{0}, {1}, {2} {3}", location.Address1, location.City, location.State, location.PostalCode),
                                    LocationPhoneNum = location.DisplayPhone
                                };
                                break;
                            case "AppointmentRequestLink":
                                if (location.AllowAppointmentRequests)
                                {
                                    field.Value = ProviderUtils.GetAppointmentRequestLinkText(field);
                                    field.URL = ProviderUtils.GetAppointmentRequestLinkUrl(field, provider.Id, location.Id);
                                }
                                else
                                {
                                    field.URL = string.Empty;
                                    field.Value = string.Empty;
                                }
                                break;
                        }
                    }
                }

                locationsFields.Add(locationField);
            }

            return locationsFields;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        private List<Field> PopulateOccurrencesFieldData(ModuleInstanceView parent, EventDetailDto eventDetail, Field templateField, IDictionary<string, string> parameters)
        {
            var locationsFields = new List<Field>();
            var request = new ListAvailableEventOccurrencesRequest() { EventId = int.Parse(eventDetail.Id) };
            var response = parent.ProcessRequest<ListAvailableEventOccurrencesResponse>(request);
            var seoHelper = new SeoHelper(parent, parameters);

            foreach (var occurrence in response.EventOccurrences)
            {
                var occurrenceField = (Field)templateField.Clone();

                if (string.IsNullOrEmpty(_viewSettings.SeoSchema))
                    _viewSettings.SeoSchema = seoHelper.BuildSeoSchemaField(occurrence);

                foreach (var column in occurrenceField.FieldColumns)
                {
                    foreach (var field in column.Fields)
                    {
                        switch (field.FieldName)
                        {
                            case "LocationName":
                                field.Value = occurrence.EffectiveLocationName;
                                break;
                            case "LocationAddress":
                                field.Value = occurrence.EffectiveCompleteAddress;
                                break;
                            case "Presenter":
                                field.Value = occurrence.Presenter;
                                break;
                            case "ContactName":
                                field.Value = occurrence.EffectiveContactName;
                                break;
                            case "ContactPhone":
                                var sb = new StringBuilder();
                                sb.Append(occurrence.EffectiveContactPhone);
                                if (!string.IsNullOrEmpty(occurrence.EffectiveContactPhoneExtension))
                                    sb.Append(" ext. " + occurrence.EffectiveContactPhoneExtension);
                                field.Value = sb.ToString();
                                break;
                            case "ContactEmail":
                                field.Value = occurrence.EffectiveContactEmail;
                                break;
                            case "MaxAttendees":
                                field.Value = occurrence.EffectiveMaximumAttendees;
                                break;
                            case "Cost":
                                field.Value = string.Format("{0:C}", occurrence.EffectiveCost);
                                break;
                            case "AvailableSeats":
                                field.Value = occurrence.Availability;
                                break;
                            case "SpecialInstructions":
                                field.Value = occurrence.SpecialInstructions;
                                break;
                            case "Map":
                                field.Value = "mapDiv_" + occurrence.Id;
                                field.MappingProvider = _mappingSettings.MappingProvider.ToString().ToUpperInvariant();
                                field.MapItem = new MapItem()
                                {
                                    Title = occurrence.EventTitle,
                                    Latitude = occurrence.Latitude.HasValue ? occurrence.Latitude.ToString() : string.Empty,
                                    Longitude = occurrence.Longitude.HasValue ? occurrence.Longitude.ToString() : string.Empty,
                                    LocationAddress = occurrence.EffectiveCompleteAddress,
                                    LocationPhoneNum = occurrence.EffectiveContactPhone
                                };
                                break;
                            case "RegisterButton":
                                if (occurrence.IsRegistrationEnabled)
                                    field.Value = "<input type='button' class='btn btn-primary' value='Register' data-ng-click='Register(" + occurrence.Id + ")' />";
                                else
                                    field.Value = null;
                                break;
                            case "AddToCartButton":
                                if (occurrence.IsRegistrationEnabled)
                                    field.Value = "<input type='button' class='btn btn-primary' value='Add To Cart' data-ng-click='AddToCart(" + occurrence.Id + ")' />";
                                else
                                    field.Value = null;
                                break;
                            case "DateAndTime":
                                var dtBuilder = new StringBuilder();
                                var formatStr = "{0} - {1} until {2}";
                                foreach(var d in occurrence.Dates)
                                {
                                    if (d.StartDate.HasValue && d.EndDate.HasValue)
                                    {
                                        if (dtBuilder.Length > 0)
                                            dtBuilder.Append("<br/>");

                                        var dateStr = d.StartDate.Value.ToString("MMM. d, yyyy");
                                        var startTime = d.StartDate.Value.ToShortTimeString();
                                        var endTime = d.EndDate.Value.ToShortTimeString();
                                        dtBuilder.AppendFormat(formatStr, dateStr, startTime, endTime);
                                    }
                                }
                                field.Value = dtBuilder.ToString();
                                break;
                        }
                    }
                }

                locationsFields.Add(occurrenceField);
            }

            return locationsFields;
        }
Exemplo n.º 5
0
        private List<Field> PopulateLocationsFieldData(ModuleInstanceView parent, MEDSEEK.eHealth.ecoSystemSP.Common.Services.ServiceDto service, Field templateField, IDictionary<string, string> parameters)
        {
            var locationsFields = new List<Field>();
            var request = new ReadServiceByIdRequest() { ServiceId = service.Id };
            var response = parent.ProcessRequest<ReadServiceByIdResponse>(request);
            var seoHelper = new SeoHelper(parent, parameters);

            foreach (var location in response.Service.Serviceorgunits)
            {
                var locationField = (Field)templateField.Clone();

                if(string.IsNullOrEmpty(_viewSettings.SeoSchema))
                    _viewSettings.SeoSchema = seoHelper.BuildSeoSchemaField(location);

                foreach (var column in locationField.FieldColumns)
                {
                    foreach (var field in column.Fields)
                    {
                        switch (field.FieldName)
                        {
                            case "LocationName":
                                field.Value = location.Name;
                                break;
                            case "LocationAddress":
                                var sb = new StringBuilder();
                                sb.Append(location.Address1 + "<br />");
                                if (!string.IsNullOrEmpty(location.Address2))
                                    sb.Append(location.Address2 + "<br />");
                                sb.AppendFormat("{0}, {1} {2}", location.City, location.State, location.Zip);
                                field.Value = sb.ToString();
                                break;
                            case "Phone":
                                field.Value = location.PhoneNumber;
                                break;
                            case "Fax":
                                field.Value = location.Fax;
                                break;
                            case "Hours":
                                field.Values.Clear();
                                foreach (var schedule in location.Schedule)
                                    field.Values.Add(string.Format("{0} {1}-{2}", schedule.Day, schedule.Open, schedule.Close));
                                break;
                            case "Map":
                                field.Value = "mapDiv_" + location.Id;
                                field.MappingProvider = _mappingSettings.MappingProvider.ToString().ToUpperInvariant();
                                field.MapItem = new MapItem()
                                {
                                    Title = location.Name,
                                    Latitude = location.Latitude.ToString(),
                                    Longitude = location.Longitude.ToString(),
                                    LocationAddress = location.MappingAddress,
                                    LocationPhoneNum = location.PhoneNumber
                                };
                                break;
                        }
                    }
                }

                locationsFields.Add(locationField);
            }

            return locationsFields;
        }
        private List<Field> PopulateFieldData(ModuleInstanceView parent, ReadRegistrationResponse registration, Field templateField)
        {
            var occurrencesFields = new List<Field>();

            foreach (var occurrence in registration.Registration.EventOccurrences)
            {
                var occurrenceField = (Field)templateField.Clone();

                foreach (var column in occurrenceField.FieldColumns)
                {
                    foreach (var field in column.Fields)
                    {
                        switch (field.FieldName)
                        {
                            case "EventTitle": field.Value = occurrence.EventTitle; break;
                            case "EventImage": field.URL = occurrence.EventImagePath; break;
                            case "Description": field.Value = occurrence.EventSummaryDescription; break;
                            case "DateTime": field.Value = occurrence.StartDate.HasValue ? occurrence.StartDate.Value.ToString("M/d/yy h:mm tt") : "Open"; break;
                            case "Registrants":
                                foreach (var attendee in occurrence.Attendees)
                                    field.Values.Add(string.Format("{0} {1}", attendee.FirstName, attendee.LastName));
                                break;
                        }
                    }
                }

                occurrencesFields.Add(occurrenceField);
            }

            return occurrencesFields;
        }