Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
colourGreen
titleGET
/
Status
colourYellow
titlePOST

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

Attribute

description

Description

coordinates

(String)
User

location or

's location in the format of Latitude, Longitude

near to which we want to find the organization Units.

comma separate value

points

array of coordinates / decimal
(only available for POST method)

latitude

longitude

. This is used to find nearby organization units.

Format: "latitude,longitude"

points

(Array of Decimals)
An array of coordinates. Available only for the

Status
colourYellow
titlePOST
method.

latitude

(Decimal)
Latitude component of the user's location.

longitude

(Decimal)
Longitude component of the user's location.

Info

Either of the above attributes is required

Organization Unit

uid

Status
titlecore
| OrgUnit UID

(String)

Unique identifier (UID) generated by DHIS2 for

a

an organization unit.

code

Status
titlecore
| Org Unit Code

(String)

Code assigned to the organization unit.

shortName

Status
titlecore
| Org Unit shortName

(String)

Short name of the organization unit.

Ancestor (Organization Unit)

ancestor.uid

Status
titlecore
| OrgUnit UID for ancestor

(String)

When

OrgUnit UID / code for

the

ancestor

is

. When provided,

then

all

the locator

locators/facilities under it are populated. Represents the DHIS2 parent just above the Organization Unit.

ancestor.code

Status
titlecore
| OrgUnit code for ancestor

Optional parameters

Parameter

Option Value

Default Option

Description

paging

boolean

Boolean

true

Defines if

Specifies whether pagination is required.

page

number

Number

1

Defines which

Determines the page number to

return

be returned.

pageSize

number

Number

10

Defines

Sets the total

PageSize for the response

number of items per page.

distance

number

Number

10

Defines radius

Specifies the radius (in unit specified) within which

you need

to generate the organization

Units

units.

unit

Options:
m

| km | mi

(meters),
km (kilometers), mi (miles)

km

Define

Defines the unit of measurement for

the

distance.

level

number

Number

7

Defines

Indicates the hierarchy level of the

orgUnit

organization unit.

phoneNumber

text

Text (

phone

Phone Number)

N/A

DHIS2 core element

| Defines

that defines the phone number of the location.

DHIS2 custom ou attribute

type

text

Text

Defines

Specifies the type of the location.

tags

text

Text (

separated

Separated by ',' or '|')

N/A

Defines the tags the locations are associated with.
Returns all the organization which has at least one of the tags provided.

text

Text
(separated by &)

NA

Returns all the organization which has all of the tags provided.

services

text

Text (

separated

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

Text
(separated by &)

Returns all the organization which has all of the services provided.

area

text

Text

N/A

Defines the broader area where the

locations

location is

located

situated.

subArea

text

Text

N/A

Defines

Specifies the

subArea where the locations is located

subarea of the location.

whatsapp

text

Text (phone Number)

N/A

Defines

Indicates the

whatsapp

WhatsApp number of the location.

facebook

text | url

Text or URL

N/A

Defines

Provides the

fb url

Facebook URL for the location.

responseFhir

boolean

Boolean

No

Defines

Determines if the response

would

should be in FHIR or DHIS2 format.

URL (for

Status
colourGreen
titleGET
request):

https://{{host}}/api/v2/locator?paging=false&coordinates=lat,lng&distance=5&unit=km

Payload (for

Status
colourYellow
titlePOST
request):

Code Block
languagejson
{
  "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
}

...