Skip to contents

These functions simplify retrieving data from specific DHIS2 API endpoints using get_metadata().

Usage

get_categories(...)

get_category_combos(...)

get_category_option_combos(...)

get_category_option_group_sets(...)

get_category_option_groups(...)

get_category_options(...)

get_data_element_group_sets(...)

get_data_element_groups(...)

get_data_elements(...)

get_data_sets(...)

get_user_groups(...)

get_indicator_group_sets(...)

get_indicator_groups(...)

get_indicators(...)

get_option_group_sets(...)

get_option_groups(...)

get_option_sets(...)

get_options(...)

get_organisation_unit_groupsets(...)

get_organisation_unit_groups(...)

get_organisation_units(...)

get_organisation_unit_levels(...)

get_dimensions(...)

get_period_types(...)

get_user_profile()

Arguments

...

Arguments passed on to get_metadata

fields

The specific columns to be returned in the data frame.

retry

Number of times to retry the API call in case of failure (defaults to 2).

verbosity

Level of HTTP information to print during the call:

  • 0: No output

  • 1: Show headers

  • 2: Show headers and bodies

  • 3: Show headers, bodies, and CURL status message.

timeout

Maximum number of seconds to wait for the DHIS2 API response.

Value

A tibble containing the DHIS2 metadata response.

Examples


# Get all organisation units
get_organisation_units()
#> # A tibble: 29,694 × 2
#>    name                           id         
#>    <chr>                          <chr>      
#>  1 10 Engineer VCT                Vh676wb3d16
#>  2 12 Engineers                   gPEGZGkfDWa
#>  3 360 Health Care Centre         r96GaeVvrde
#>  4 360 Medicare  Clinic           VcJUbEkpml4
#>  5 3Keys Community Health Unit    sTf8DjAv3a1
#>  6 3KR Health Centre              CgMmkS9jWI6
#>  7 3rd Park Hospital Limited      a70eeTvT6tG
#>  8 48 Taqwa Community Health Unit lhMzjmZKQgt
#>  9 78 Tank Battalion Dispensary   MgMyK9aTJ2C
#> 10 7KR Mrs Health Centre          kMvyfZaFoq8
#> # ℹ 29,684 more rows

# Get all data elements
get_data_elements()
#> # A tibble: 14,259 × 2
#>    name                                                                    id   
#>    <chr>                                                                   <chr>
#>  1 ""                                                                      ioUh…
#>  2 "0000000 INCOME & EXPENDITURE STATEMENT"                                RvNJ…
#>  3 "1000000 Income/Revenue"                                                zo5v…
#>  4 "10.1 Residential"                                                      tZ3q…
#>  5 "10.1 The facility has a sound fnancial plan that is adequately funded" oYdx…
#>  6 "10.2 Commercial"                                                       PQNa…
#>  7 "10.2 Financial resources are provided and used towards Quality Manage… OnDA…
#>  8 "10.3 Availability of updated fee structure, strategically and promine… UXQg…
#>  9 "10.3 Institutional"                                                    FGHs…
#> 10 "10.4 Facility improvement/ Quality management funds are effciently us… y9ui…
#> # ℹ 14,249 more rows

# Get data elements by element ids
get_data_elements(id %.in% c('VR7vdS7P0Gb', 'gQro1y7Rsbq'))
#> # A tibble: 2 × 2
#>   name                                     id         
#>   <chr>                                    <chr>      
#> 1 Number of clients who received HPV Test  VR7vdS7P0Gb
#> 2 Number of clients who received Pap smear gQro1y7Rsbq

# Get datasets by name with the word 'MOH 705'
get_data_sets(name %.like% 'MOH 705')
#> # A tibble: 4 × 2
#>   name                                                id         
#>   <chr>                                               <chr>      
#> 1 MOH 705 A Outpatient summary < 5 years              oEfGJAQaARj
#> 2 MOH 705 A Outpatient summary < 5 years Revised 2020 EnZokILHOeN
#> 3 MOH 705 B Outpatient summary > 5 years              GVGt4o7VkHk
#> 4 MOH 705 B Outpatient summary > 5 years Revised 2020 Uylp8xlm2Lg