get_breast_mammogram()
retrieves data for mammograms conducted within a
specified period from the KHIS API server.
Usage
get_breast_mammogram(
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 mammograms conducted with the following columns:
country - Name of the country.
county - Name of the county. Optional if the level is
county
,subcounty
,ward
orfacility
.subcounty - Name of the subcounty. Optional if the level is
subcounty
,ward
orfacility
.ward - Name of the ward. Optional if the level is
ward
orfacility
.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 (25-34, 35-39, 40-55, 56-74, or 75+).
category2 - Additional category if available.
element - The data element.
value - The number reported.
Examples
# Download data from February 2023 to current date
mammogram_data <- get_breast_mammogram(start_date = '2023-02-01')
mammogram_data
#> # A tibble: 177 × 11
#> value country element age_group period month year quarter fiscal_year
#> <dbl> <chr> <fct> <fct> <date> <ord> <dbl> <fct> <fct>
#> 1 1 Kenya BIRADS 6 40-55 2023-09-01 Septem… 2023 Q1 2023/2024
#> 2 5 Kenya BIRADS 4 40-55 2024-04-01 April 2024 Q4 2023/2024
#> 3 1 Kenya BIRADS 6 40-55 2023-07-01 July 2023 Q1 2023/2024
#> 4 5 Kenya BIRADS 4 40-55 2024-03-01 March 2024 Q3 2023/2024
#> 5 1 Kenya BIRADS 6 56-74 2024-03-01 March 2024 Q3 2023/2024
#> 6 10 Kenya BIRADS 4 35-39 2024-01-01 January 2024 Q3 2023/2024
#> 7 1 Kenya BIRADS 6 40-55 2023-05-01 May 2023 Q4 2022/2023
#> 8 13 Kenya BIRADS 4 40-55 2024-02-01 Februa… 2024 Q3 2023/2024
#> 9 1 Kenya BIRADS 6 40-55 2023-06-01 June 2023 Q4 2022/2023
#> 10 3 Kenya BIRADS 4 40-55 2024-01-01 January 2024 Q3 2023/2024
#> # ℹ 167 more rows
#> # ℹ 2 more variables: source <chr>, category <fct>