Retrieves the Tissue Histology Laboratory Data
Source:R/get_lab_tissue_histology.R
get_lab_tissue_histology.Rd
get_lab_tissue_histology()
retrieves tissue histology lab data for a specified period
from the KHIS API server.
Usage
get_lab_tissue_histology(
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 tissue histology lab data 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
element - The data element.
value - The number reported.
Examples
# Download data from February 2023 to current date
data <- get_lab_tissue_histology(start_date = '2023-02-01')
data
#> # A tibble: 459 × 10
#> value country element category period month year quarter fiscal_year
#> <dbl> <chr> <fct> <fct> <date> <ord> <dbl> <fct> <fct>
#> 1 88 Kenya Hepatobili… Total E… 2023-09-01 Sept… 2023 Q1 2023/2024
#> 2 4 Kenya Colorectal Maligna… 2023-10-01 Octo… 2023 Q2 2023/2024
#> 3 92 Kenya Esophagus Total E… 2023-02-01 Febr… 2023 Q3 2022/2023
#> 4 101 Kenya Esophagus Total E… 2023-05-01 May 2023 Q4 2022/2023
#> 5 31 Kenya Hepatobili… Total E… 2023-06-01 June 2023 Q4 2022/2023
#> 6 10 Kenya Colorectal Maligna… 2023-12-01 Dece… 2023 Q2 2023/2024
#> 7 50 Kenya Esophagus Total E… 2023-03-01 March 2023 Q3 2022/2023
#> 8 61 Kenya Hepatobili… Total E… 2023-08-01 Augu… 2023 Q1 2023/2024
#> 9 57 Kenya Hepatobili… Total E… 2023-07-01 July 2023 Q1 2023/2024
#> 10 78 Kenya Esophagus Total E… 2023-04-01 April 2023 Q4 2022/2023
#> # ℹ 449 more rows
#> # ℹ 1 more variable: source <chr>