Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 8 Next »

Locators / Organization Units near me

This endpoint provides list of organization units around the provided coordinates.

url : api/v1/locator

method: GET/POST

authorization: as setup in the Spring.Framework.Security [Link]

Mandatory parameters - you must provide at least one of the following parameters

Parameter

dhis2 attribute

description

coordinates

User location or Latitude,Longitude near to which we want to find the organization Units.

Organization Unit

code

core | Org Unit Code

Code assigned to the organization unit

uid

core | OrgUnit UID

UID generated by DHIS2 for a organization unit

Ancestor (Organization Unit)

ancestor.uid

core | OrgUnit UID for ancestor

When UID / code for the ancestor is provided, then all the locator / facilities under it are populated

ancestor.code

core | OrgUnit code for ancestor

Optional parameters

Parameter

Option Value

Default Option

Description

pageSize

number

1

Defines which page number to return.

distance

number

5

Defines radius within which you need to generate the organization Units

unit

m | km | mi

km

Define the unit for the distance

phoneNumber

text (phone Number)

N/A

DHIS2 core element | Defines the phone number of the location

DHIS2 custom ou attribute

type

text

Defines the type of the location.

tags

text (csv)

N/A

Defines the tags the locations are associated with.

services

text (csv)

N/A

Defines the services offered by the locations.

contraception

text (csv)

N/A

Defines the contraceptives services offered by the locations. (implementation pending)

area

text

N/A

Defines the area where the locations is located.

subArea

text

N/A

Defines the subArea where the locations is located.

whatsapp

text (phone Number)

N/A

Defines the whatsapp number of the location

facebook

text | url

N/A

Defines the fb url for the location

URL (for GET request):

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

Payload (for POST request):

{
  "pageSize": 10,
  "distance": 5,
  "unit": "km",
  "coordinates": "lat,lng",
  "ancestor.code": "KE",
  "services": "service1,service2",
  "uid": 'q13we2452wsd',
  "code": "CODE-123",
  "contraception": "iud,imp",
  "tags": "tag1,tag2",
  "type": "Public",
  "area": "Managua",
  "subArea": "Ciudad Sandino",
  "phonenumber": "180999093107",
  "wap": "977984123145",
  "facebook": "https://fb.me/facility1"
}

Response:

{
    "status": 200,
    "pager": {...}
    "outlets": [
        {
            "dhisCode": "KE-CODE-123",
            "dhisId": "xkcEJARvo2O",
            "servicesStandard": "CCS,CNT,ANC,STI,HVS,HVT",
            "outletType": "Public",
            "ouShowContactInfo": "TLF",
            "path": "",
            "outletName": "Facility Clinic",
            "phoneNumber": "+254541483334",
            "postgresId": "1511345870",
            "locatorType": "OUT",
            "location": {
                "area": "Nairobi",
                "areaSub": "Starehe",
                "address": "street1, city, subarea, area",
                "latitude": "-1.28575",
                "longitude": "39.81234"
            },
            "dhisName": "Facility Clinic (KE-CODE-123)",
            "openingHours": "Mon-Fri,8:00,17:00;Sat,9:00,14:00;Public Holiday,9:00,14:00;Sun,Closed",
            "openingDate": "2023-02-11",
            "ouTags": "MSI",
            "providers": [],
            "ouContraceptives": "IMP,OCP,IUD,INJ,STL,EMC"
        }
    ]
}
  • No labels