View source: R/getMechanismView.R
getMechanismView | R Documentation |
Retrieves a view of mechanisms with partners and agencies The function will attempt to read from a cached file, if defined in the support_files_directory option has been set, and the mechs.rds file is available to be read. Otherwise, if the user is logged in, the view will be obtained from DATIM. Otherwise, an empty dataframe is returned.
Note that only country UIDs are accepted. If Regional Operating Unit uids are supplied, returns entire mechanism list, trimmed to user's DATIM permissions.
getMechanismView(
country_uids = NULL,
cop_year = NULL,
include_dedupe = FALSE,
include_MOH = FALSE,
d2_session = dynGet("d2_default_session", inherits = TRUE),
cached_mechs_path = paste0(Sys.getenv("support_files_directory"), "mechs.rds"),
update_stale_cache = FALSE,
include_default = TRUE
)
country_uids |
Unique IDs for countries to include in the Data Pack.
For full list of these IDs, see |
cop_year |
COP Year to use for tailoring functions. Remember, FY22 targets = COP21. |
include_dedupe |
Logical. If TRUE will include deduplication mechanisms. Default is FALSE. |
include_MOH |
Logical. If TRUE will include MOH mechanisms. Default is FALSE. |
d2_session |
DHIS2 Session id. R6 datimutils object which handles authentication with DATIM. |
cached_mechs_path |
Local file path to an RDS file containing a cached copy of the mechanisms SQL view. |
update_stale_cache |
If the cached_mechs_path file is outdated or unreadable, should a new cache be saved? |
include_default |
Should the default mechanism also be included? |
Mechs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.