Пример #1
0
        public string GetHealthCareProviderData(ProviderFilter filter)
        {
            try
            {
                var query = new Query();

                if (filter.Latitude != 0 && filter.Longitude != 0)
                {
                    query.WithIn(new Circle(filter.Latitude, filter.Longitude, filter.Meters));
                }

                if (!string.IsNullOrWhiteSpace(filter.Category))
                {
                    query.Field("category").Search(filter.Category);
                }

                if (!string.IsNullOrWhiteSpace(filter.Npi))
                {
                    query.Field("npi_id").Search(filter.Npi);
                }

                if (!string.IsNullOrWhiteSpace(filter.Insurances))
                {
                    query.Field("insurances").Search(filter.Insurances);
                }

                if (!string.IsNullOrWhiteSpace(filter.Locality))
                {
                    query.Field("locality").Search(filter.Locality);
                }

                if (!string.IsNullOrWhiteSpace(filter.Region))
                {
                    query.Field("region").Search(filter.Region);
                }

                query.Field("offset").Equals(0);

                return(_factual.Fetch("health-care-providers-us", query));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public string GetHealthCareProviderData(ProviderFilter filter)
        {
            try
            {
                var query = new Query();

                if (filter.Latitude != 0 && filter.Longitude != 0)
                {
                    query.WithIn(new Circle(filter.Latitude, filter.Longitude, filter.Meters));
                }

                if (!string.IsNullOrWhiteSpace(filter.Category))
                {
                    query.Field("category").Search(filter.Category);
                }

                if (!string.IsNullOrWhiteSpace(filter.Npi))
                {
                    query.Field("npi_id").Search(filter.Npi);
                }

                if (!string.IsNullOrWhiteSpace(filter.Insurances))
                {
                    query.Field("insurances").Search(filter.Insurances);
                }

                if (!string.IsNullOrWhiteSpace(filter.Locality))
                {
                    query.Field("locality").Search(filter.Locality);
                }

                if (!string.IsNullOrWhiteSpace(filter.Region))
                {
                    query.Field("region").Search(filter.Region);
                }

                query.Field("offset").Equals(0);

                return _factual.Fetch("health-care-providers-us", query);
            }
            catch (Exception ex)
            {
                throw;
            }
        }