Skip to contents

[Experimental] get_data_sets_by_level() fetches the data set reporting metrics. The metric can be REPORTING_RATE, REPORTING_RATE_ON_TIME, ACTUAL_REPORTS, ACTUAL_REPORTS_ON_TIME, EXPECTED_REPORTS.

Usage

get_data_sets_by_level(
  dataset_ids,
  start_date,
  end_date = NULL,
  level = 1,
  org_ids = NULL,
  ...,
  call = caller_env()
)

Arguments

dataset_ids

Required vector of data sets IDs for which to retrieve data. Required.

start_date

Optional start date to retrieve data. It is required and in the format YYYY-MM-dd.

end_date

Optional ending date for data retrieval (default is the current date).

level

Required desired organisation level of data (default: level 1) .

org_ids

Optional list of organization units IDs to be filtered.

...

Other options that can be passed onto DHIS2 API.

call

The caller environment.

Value

A tibble with detailed information, including:

  • Geographical identifiers (country, subnational, district, facility, depending on level)

  • Reporting period (month, year, fiscal year)

  • The reporting metric can be REPORTING_RATE, REPORTING_RATE_ON_TIME, ACTUAL_REPORTS, ACTUAL_REPORTS_ON_TIME, EXPECTED_REPORTS.

See also

Examples

# The MoH 745 Cancer Screening Program Monthly Summary Form
dataset_id = c('WWh5hbCmvND')

# Download data from February 2023 to current date
data <- get_data_sets_by_level(dataset_ids = dataset_id,
                               start_date = '2023-02-01')
data
#> # A tibble: 21 × 10
#>    kenya dataset    period     month  year reporting_rate reporting_rate_on_time
#>    <chr> <chr>      <date>     <ord> <dbl>          <dbl>                  <dbl>
#>  1 Kenya MoH 745 C… 2024-10-01 Octo…  2024            0                      0  
#>  2 Kenya MoH 745 C… 2023-06-01 June   2023           64.6                   60.4
#>  3 Kenya MoH 745 C… 2023-05-01 May    2023           62.6                   58.9
#>  4 Kenya MoH 745 C… 2023-03-01 March  2023           64.0                   57.1
#>  5 Kenya MoH 745 C… 2024-05-01 May    2024           64.0                   59.7
#>  6 Kenya MoH 745 C… 2024-06-01 June   2024           65.1                   62.8
#>  7 Kenya MoH 745 C… 2023-02-01 Febr…  2023           64.6                   54.5
#>  8 Kenya MoH 745 C… 2023-04-01 April  2023           60.3                   53.9
#>  9 Kenya MoH 745 C… 2024-03-01 March  2024           63.4                   60.2
#> 10 Kenya MoH 745 C… 2024-04-01 April  2024           63.1                   59.0
#> # ℹ 11 more rows
#> # ℹ 3 more variables: actual_reports <dbl>, actual_reports_on_time <dbl>,
#> #   expected_reports <dbl>