Skip to contents

Generate a API URL

Usage

gen_url(
  ou_uid,
  org_lvl,
  org_type = "facility",
  value_type = "results",
  is_hts = FALSE,
  fy_pd = NULL,
  baseurl = "https://final.datim.org/"
)

Arguments

ou_uid

UID for the country, recommend using `identify_ouuids()`

org_lvl

org hierarchy level, eg facility is level 7 in country X, recommend using `identify_levels()`

org_type

organization type, either facility (default) or community

value_type

results (default) or targets

is_hts

is the API for HTS indicators (HTS_TST or HTS_TST_POS), default = FALSE

fy_pd

fiscal year(s) to cover, default will be current FY if not provided

baseurl

API base url, default = https://final.datim.org/

Examples

if (FALSE) { # \dontrun{
 #get OU UID
  ouuid <- identify_ouuids() %>% dplyr::filter(ou == "Ghana")
 #get facility level
  faclvl <- identify_levels("facility",
                            username = myuser, password = mypwd()) %>%
                            dplyr::filter(ou == "Ghana")
 #gen url
  myurl <- gen_url(ouuid, faclvl, org_type = facility) } # }