Locators / Organization Units near me
This endpoint provides retrieves a list of organization units around in proximity to the provided geographic coordinates.
url URL : api/v2/locator
method: GET/POST
authorization: as setup in the Spring.Framework.Security
[Link]
Mandatory parameters - you Method:
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Authorization: Managed via Spring Framework Security (See: Link)
Info |
---|
Note: For PSI implementation, authorization is handled by OpenHIM, and Spring Boot security is disabled by default. |
Request Parameters
Required Parameters
You must provide at least one of the following parameters
Parameter | dhis2 |
---|
Attribute |
---|
Description | ||
---|---|---|
coordinates | (String) |
's location in the format of Latitude, Longitude |
comma separate value
points
array of coordinates / decimal
(only available for POST method)
latitude
. This is used to find nearby organization units. Format: "latitude,longitude" | ||||||||
points | (Array of Decimals)
| |||||||
latitude | (Decimal) | |||||||
longitude | (Decimal) | |||||||
| ||||||||
Organization Unit | ||||||||
uid |
| (String) Unique identifier (UID) generated by DHIS2 for |
an organization unit. | ||||||
code |
| (String) Code assigned to the organization unit. | ||||
shortName |
| (String) Short name of the organization unit. | ||||
Ancestor (Organization Unit) | ||||||
ancestor.uid |
| (String) |
OrgUnit UID / code for |
ancestor |
. When provided, |
all |
locators/facilities under it are populated. Represents the DHIS2 parent just above the Organization Unit. | |||||
ancestor.code |
|
Optional parameters
Parameter | Option Value | Default Option | Description |
---|---|---|---|
paging |
Boolean | true |
Specifies whether pagination is required. |
page |
Number | 1 |
Determines the page number to |
be returned. |
pageSize |
Number | 10 |
Sets the total |
number of items per page. |
distance |
Number | 10 |
Specifies the radius (in unit specified) within which |
to generate the organization |
units. | |
unit | Options: |
(meters), | km |
Defines the unit of measurement for |
distance. |
level |
Number | 7 |
Indicates the hierarchy level of the |
organization unit. |
phoneNumber |
Text ( |
Phone Number) | N/A | DHIS2 core element |
that defines the phone number of the location. | |||
DHIS2 custom ou attribute | |||
type |
Text |
Specifies the type of the location. | |
tags |
Text ( |
Separated by ',' or '|') | N/A | Defines the tags the locations are associated with. |
Text | NA | Returns all the organization which has all of the tags provided. |
services |
Text ( |
Separated by ',' or '|') | N/A | Defines the services offered by the locations. Returns all the organization which has at least one of the service provided. |
Text | Returns all the organization which has all of the services provided. | |
area |
Text | N/A | Defines the broader area where the |
location is |
situated. |
subArea |
Text | N/A |
Specifies the |
subarea of the location. |
Text (phone Number) | N/A |
Indicates the |
WhatsApp number of the location. |
Text or URL | N/A |
Provides the |
Facebook URL for the location. |
responseFhir |
Boolean | No |
Determines if the response |
should be in FHIR or DHIS2 format. |
URL (for
Status | ||||
---|---|---|---|---|
|
https://{{host}}/api/v2/locator?paging=false&coordinates=lat,lng&distance=5&unit=km
Payload (for
Status | ||||
---|---|---|---|---|
|
Code Block | ||
---|---|---|
| ||
{ "paging": true, "page": 1, "pageSize": 10, "ancestor": { "id": "a23acb2452xyz", "code": "KE" }, "organisationunit": { "id", "q13we2452wsd", "shortName": "Sub Hospital" }, "coordinates": lat,lng, "points": [lat,lng], "distance": 5, "unit": "km", "level": 7, "phoneNumber": "180999093107", "area": "Managua", "subArea": "Ciudad Sandino", "type": "Public", "tags": "tag1,tag2", "services": "service1,service2", "whatsapp": "977984123145", "facebook": "https://fb.me/facility1", "latitude": lat, "longitude": lon, "responseFhir": false } |
...