get_analytics_formatted {cancerscreening}R Documentation

Retrieves Analytics Table Data from KHIS

Description

get_analytics_formatted() fetches data from the KHIS analytics data tables for a given period and data element(s), without performing any aggregation.

Usage

get_analytics_formatted(
  element_ids,
  start_date,
  end_date = NULL,
  level = c("country", "county", "subcounty", "ward", "facility"),
  organisations = NULL,
  ...
)

Arguments

element_ids

A vector of data element IDs for which to retrieve data. Required.

start_date

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

end_date

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

level

The desired data granularity: "country" (the default), "county", "subcounty", "ward", or "facility".

organisations

A list of organization units ids to be filtered.

...

Other options that can be passed onto KHIS API.

Details

Value

A tibble with detailed information, including:

Examples


# Clinical Breast Examination data elements
# XEX93uLsAm2 = CBE Abnormal
# cXe64Yk0QMY = CBE Normal
element_id = c('cXe64Yk0QMY', 'XEX93uLsAm2')

# Download data from February 2023 to current date
data <- get_analytics_formatted(element_ids = element_id,
                                start_date = '2023-02-01')
data


[Package cancerscreening version 1.1.1 Index]