Background
PSI and , as well as many other organisation use DHIS2 as their de facto Master List of Facilities. DHIS2 provides various API endpoints to perform numerous CRUD various operation across Org Units. DHIS API has a comprehensive documentation on how to execute DHIS2 Org Unit API operations.
When creating consumer services, PSI requires to list facilites PSI’s solutions require in many instances produce a list of facilities based on the current location of the user - this means listing facilities that are closest to the provided Latitude and Longitude of for the user. This search option operation is not present in DHIS2 API, at least in the reviewed versions (2.38, 2.39 and 2.40 dev version - reviewed in February 2023).
Additionally, when performing a search by custom attributes, it is currently no possible to specify what attribute you are doing the search on - instead it searches all of them. This is a major issue for location searching.
Last, users may want to make use of custom attributes to store an array of value (perhaps as comma delimited values). A search operation by the individual value is not supported by DHIS2 API.
Locator API - Introduction
Locator API is a self-contained API that provides new ways to retrieve organisation unitsupport the retrieval or Org Units based on alternative, non-native DHIS2 API calls, in particular:
Request for closest org units based on a specific coordinatesgiven geo-coordinate, with the possibility to define a boundary as a ratio in Kms.
Return an enumeration of Custom Org Unit Attributes values - implemented for Area and SubArea, two of the suggested custom attributes that we recommend to install as part of the Org Units.
Filtering by specific Org Units custom attribute is severely limited
You cannot specify that attribute to search - it searches all of them
Multiple values are not supported. This affect the way that we use ‘comma separated’ values.Enhance (by making precise) the search by custom attributes.*
Search by single values for an specific attributes (instead of all attributes, as it currently happens)
Search of a value on an array of values