General Search

Performing a General Search with the search Method

Overview

The search method in the b.well SDK allows for a versatile and customizable search of providers based on various criteria. It is designed to cater to a range of search needs, from a broad general search to more specific queries.

Method Signature

suspend fun search(providerSearchRequest: ProviderSearchRequest): BWellResult<Provider>
  • providerSearchRequest: Encapsulates search parameters.
  • BWellResult<Provider>: Returns a collection of providers and connections, along with FHIR OperationOutcome and paging information.

Search Parameters

  1. Search Term:

    • The primary filter for searches, usable for organization names, locations, addresses, or phone numbers.
  2. Specialty Filters:

    • An array of strings for filtering by specialty. Best used for specific provider searches rather than general searches.
  3. Organization Type Filters:

    • Filters results by organization type, more suitable for targeted searches.
  4. Gender:

    • Filters providers based on gender (male, female, other, unknown). Used for more specific provider searches.
  5. Location:

    • Filters results by geographical location using latitude, longitude, and distance parameters.
  6. Sort By:

    • Offers various sorting options. The default is relevance. Other options include distance and content (for organizations).
  7. Pagination:

    • page: Specifies the page number for results.
    • pageSize: Determines the number of results per page.

Best Practices

  • General Searches: For a broad search, it's best to rely on the searchTerm without overly restrictive filters.
  • Specific Queries: Use filters like specialtyFilters, organizationTypeFilters, and gender for targeted searches.
  • Sorting: The default sort by relevance is typically the most effective, especially for general searches.
  • Pagination: Adjust page and pageSize to manage the volume of search results effectively.

Did this page help you?