Closed achafetz closed 4 months ago
Looks like a version change. The current "version":"2.40.2.2"
The temp solution will be to set hierarchyMeta
to false
,
grab the ou/country orgunits (datim_orgunits()
) as a reference data set,
and then join it to the results. See below:
url <- "final.datim.org/api/analytics.json?dimension=ou:l1KFEXKI4Dg;LEVEL-6&dimension=HWPJnUTMjEq:pxz2gGSIQhG&dimension=LxhLO68FcXm:MvszPTQrUhy&dimension=pe:2023Q4&displayProperty=SHORTNAME&skipMeta=false&hierarchyMeta=false"
df_results <- datim_process_query(url)
df_results <- df_results %>%
janitor::clean_names() %>%
rename(orgunit = organisation_unit,
indicator = technical_area,
standarddizeddisaggregate = disaggregation_type) %>%
relocate(indicator, .before = standarddizeddisaggregate)
df_orgs <- datim_orgunits(cntry = cntry, reshape=T)
df_results <- df_results %>%
left_join(df_orgs, by = c("orgunituid", "orgunit"))
Note: you can also get the same query datim_query() and not have to remember the uids
datim_query(
ou = cntry,
username = datim_user(),
password = datim_pwd(),
level = "facility",
pe = "2023Q4",
ta = "TX_CURR",
value = "MER Results",
disaggs = "Age/Sex/HIVStatus",
property = "SHORTNAME",
metadata = TRUE,
hierarchy = FALSE,
verbose = FALSE
)
Solution was provided - moving this to archive.
Not sure what happened, but when I run an API, the orgunit uid should be mapped to their names, but they aren't any more. I can't figure out why this changed...