Open d-hergott opened 1 month ago
The goal of this task is to determine which indicators from the old_dhis map to the new dhis. There are a few tools/previous work to help with this. Putting here to keep all in one place:
categoryOptionCombo
names of many of the elements. These are the "children" of the parent DataElements (displayName) in the list Austin created. We need to get the id's for these elements when dhis2 is back online. ## Set up
library(httr); library(jsonlite); library(data.table); library(ggplot2)
cred <- jsonlite::read_json("dhis2_credentials.json")
options(dhis2_username = cred$old$username)
options(dhis2_password = cred$old$password)
options(dhis2_base = cred$old$base)
url <- paste0(getOption("dhis2_base"), "dataElements?paging=false")
get <- GET(url, authenticate(getOption("dhis2_username"), getOption("dhis2_password")))
get_text <- content(get, "text")
get_json <- fromJSON(get_text, flatten = T)
dhis_names <- unique(get_json$dataElements$displayName)
old_dhis <- get_json$dataElements
write.csv(old_dhis, "~/Downloads/old_dhis_data_elements.csv", row.names = F)
When possible, make the code_names for weekly match with monthly (and ensure the same across versions).
As a first step, will pull in all the codes, and not use age divisions (can use the age_sex_table for this and figure that out later).
If not sure two elements are the same, will flag for team discussion
Add in indicators for malaria testing variables, using old_dhis_data_elements.csv shared by Austin.