Some mechanisms and partners are recorded in FACTSInfo with multiple names over different time period. This function replaces all partner and mechanism names the most recent name for each mechanism ID pulling from a DATIM SQL View. The `mech_code` variable is required in your dataset, and having `operatingunit` and `fiscal_year` or `period` are highly recommended as they will limit the size of the DATIM queries.With an DHIS2 update to DATIM in 2021, the DATIM mechanism tables requires a password to access. We would recommend using `glamr::set_datim()` to store your DATIM credentials securely on your local machine. If you don't have them stored, you will be prompted each time to enter your password to acces DATIM.

rename_official(df, datim_user, datim_pwd)

Arguments

df

identify the PEPFAR Structured Data Set to clean

datim_user

DATIM username; if missing will look for stored credentials first and then prompt for them if not found

datim_pwd

DATIM password; if missing will look for stored credentials first and then prompt for them if not found

Examples

if (FALSE) {
df_psnu_im <- read_psd(file) %>% filter(country == "Saturn")
df_psnu_im <- rename_official(df_psnu_im) }