Generate a API URL

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) {
 #get OU UID
  ouuid <- identify_ouuids() %>% dplyr::filter(ou == "Ghana")
 #get facility level
  faclvl <- identify_levels("Ghana", "facility", username = myuser, password = mypwd())
 #gen url
  myurl <- gen_url(ouuid, faclvl, org_type = facility) }