/
Location Service

Location Service

The Location Service module adds methods for working with location data.

The Location Service module is dependent on Orbita Blaze being available and configured.

Dependencies

The Location Service module is dependent on the following modules:

Methods

renderDetails

Renders markup for the details overlay for a location card based on the provided location data.

Parameters:

  • rawLocation (object): The raw location record

Returns: A promise that will resolve with the rendered details markup for the provided location.

search

Searches for locations using Blaze based on a query

Parameters:

  • query (string): The search query

  • maximumResults (number, default = 10000): The maximum number of results to return.

  • sort (array, default = []): An array of sort properties, where each item in the array is an object where the key is the property to sort on, and the value is a sort order with “asc” for ascending or “desc” for descending, for example:

    [ { "facilityName": "desc" } ]
  • includeFilters (array, default = []): An array of filters to be included, where each item in the array is an object where the key is the property to filter on, and the value is an array of values to match for. For example:

    [ { "facilityName.keyword": ["Valley Health"] } ]

Root level location record string properties in includeFilters should have “.keyword” appended to the property name as shown above.

Returns: A promise that will resolve with an object containing the following properties:

  • locations (array): The results of the search, in raw Elastic format

  • aggregations (object): Aggregation information that can be used with some Orbita components (card list filters for example).

The promise will reject in the case of a Blaze lookup failure.

getByOrbitaId

Retrieves a location record by its Orbita ID

Parameters:

  • id (string): The Orbita ID of the location

  • formatted (boolean, default = true): Whether or not to return the data in the intermediary model. If false, the raw data will be returned.

Returns: A promise that will resolve with the location record.

format

format is a container for the following methods:

fromOrbita

Formats a raw Orbita record into the intermediary model.

Parameters:

  • raw (object): The raw Orbita record

Returns: The formatted location.

fromElastic

Formats a raw Elastic result into the intermediary model.

Parameters:

  • raw (object): The raw Elastic result

Returns: The formatted location.

Intermediary Model

Certain methods provide an option of returning data raw from Orbita or in the format of the intermediary model that serves as an interface for other modules using the Location Service module. The intermediary location model is:

  • id (string): The Orbita ID of the location record

  • name (string): facilityName from the Orbita record

Endpoints

POST: /[Project ID]/location-service/data/providers-by-location

Posting a payload such as:

{ "query": "Valley Health" }

Where query is a location name will return buckets of providers at that location grouped by specialty, which is used by the location details display to populate the providers tab.

Related content

Find Providers and Locations
Find Providers and Locations
More like this
Provider Service
Provider Service
More like this
3.2.15 Elastic Search
3.2.15 Elastic Search
More like this
Order Service
Order Service
More like this