DHIS2 Locator API
Background
PSI, as well as many other organisation use DHIS2 as their de facto Master List of Facilities. DHIS2 provides various API endpoints to perform 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’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 for the user. This search 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 support the retrieval or Org Units based on alternative, non-native DHIS2 API calls, in particular:
Request for closest org units based on a given 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.
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