Skip to contents

get_colorectal_fobt() retrieves data for colorectal screening using FOBT within a specified period from the KHIS API server.

Usage

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

Arguments

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.

Value

A tibble containing data for colorectal screening with the following columns:

  • country - Name of the country.

  • county - Name of the county. Optional if the level is county, subcounty, ward or facility.

  • subcounty - Name of the subcounty. Optional if the level is subcounty, ward or facility.

  • ward - Name of the ward. Optional if the level is ward or facility.

  • facility - Name of the health facility. Optional if the level facility.

  • period - The month and year of the data.

  • fiscal_year- The financial year of the report(July-June Cycle).

  • year - The calendar year of the report.

  • month - The month name of the report.

  • category - The age group category of the report (45-54, 55-64, or 65-75).

  • category2 - Additional category if available.

  • element - The data element.

  • value - The number reported.

Examples


# Download data from February 2023 to current date
data <- get_colorectal_fobt(start_date = '2023-02-01')
data
#> # A tibble: 96 × 10
#>    value country element  age_group period     month    year quarter fiscal_year
#>    <dbl> <chr>   <fct>    <fct>     <date>     <ord>   <dbl> <fct>   <fct>      
#>  1    21 Kenya   Negative 65-75     2023-03-01 March    2023 Q3      2022/2023  
#>  2     6 Kenya   Positive 65-75     2024-05-01 May      2024 Q4      2023/2024  
#>  3    39 Kenya   Positive 65-75     2024-04-01 April    2024 Q4      2023/2024  
#>  4     8 Kenya   Positive 65-75     2024-03-01 March    2024 Q3      2023/2024  
#>  5     9 Kenya   Negative 65-75     2023-02-01 Februa…  2023 Q3      2022/2023  
#>  6    18 Kenya   Negative 65-75     2023-06-01 June     2023 Q4      2022/2023  
#>  7    12 Kenya   Positive 55-64     2024-01-01 January  2024 Q3      2023/2024  
#>  8    23 Kenya   Positive 55-64     2023-09-01 Septem…  2023 Q1      2023/2024  
#>  9    37 Kenya   Positive 55-64     2024-04-01 April    2024 Q4      2023/2024  
#> 10    25 Kenya   Negative 55-64     2023-03-01 March    2023 Q3      2022/2023  
#> # ℹ 86 more rows
#> # ℹ 1 more variable: source <chr>