*
*
checkMechanisms
to handle shifts in rationalization as it relates to 23 OPU's*
*
*
checkanalytics
and their associated tests. Relating to PMTCT & TB_STAT columns being based on COP Year. writePSNUxIM
getCurrentCOPYear
to 2024, and started development on sunsetting this function.createPAWExport
to prepare data to be exported to PAWcreateDATIMExport
to prepare data to be exported only to DATIMpackForDATIM
to feed both of the aforementioned export functionscreatePAWExport
,createDATIMExport
, and packForDATIM
packForDATIM
to include only certain pop indicators for COP24 in createDATIMExport
.update_de_coc_co_map
to allow for certain data elements to be included even though they were left off the data entry formsgetCOPDataFromDATIM
, as it relates to imports, to work with COP24getMemoIndicators
to allow for COP24memoStructure
to allow for COP24packForDATIM
to included pop indicators for COP24 in createDATIMExport
.checkMechanisms
handles dedupe mechs.checkAnalytics
to analyze 2024 psnu datawritePSNUxIM
to be able to write 2024 PSNUxIM tabsunPackYear2Sheet
regular expression to better capture data.packDataPack
to hide rows in Year 2 and AGYW sheetsgetValidOrgUnits
extractDuplicateRows
*
createKycahinInfo
to reflect new fiscal year syntaxgetPSNUs
into its own filedatapackVSDatim
to be more representative.getRDA
for unit testsgetHTSModality
unPackSchema
in how it handles multi uid patterns.update_de_coc_co_map
for year 2024compareData_DatapackVsDatim
updated to no longer include a dedupe data frame. This is more in line with the current operations of datim, and will assist with imports.*
season
as a parameter in most unpacking and packing functions to better
align with new workflows — PSNUxIM tools separate, and both PSNUxIM tool & Data
Pack valid for both COP & OPU. This is in preparation for the deprecation of the
concept of a separate "OPU Tool", as this is now functionally identical to the
PSNUxIM tool used during main COP.unPackToolSet
to handle multiple toolsextractRawColumnData
which can retrieve raw data from a sheetgetValidOrgunits(cop_year)
to obtain
a list of valid organisation units for a given COP year.unPackSNUxIM
function operates.packDataPack
that was already in packTool
packDataPack
mergeDatapack
function for use in merging multiple datapacks along
with related unit test.getFY22Prioritizations
in favor of clearer, more stable, internal functions.getPSNUs
with with more versatile (and appropriately named)
getDataPackOrgUnits
. Many of the org units used in Data Packs are actually not
PSNUs (e.g., DREAMS SNUs, or Military SNUs), making many of the columns created
previously less than sensible. This function now also produces a tibble instead
of a data frame. In some cases, column names in this output have also slightly
changed.add_dp_psnu
with add_dp_label
.adorn_import_file
can now correctly assign prioritizations to org units below
PSNU (e.g., for DREAMS SNUs in Rwanda & Eswatini).cache_is_fresh
and fresh_cache_part
for use in
anticipated functions allowing the caching of metadata objects retrieved from
the DATIM API, allowing faster processing for repeat requests.checkToolEmptySheets
to allow checking and unpacking
processes to detect sheets with either no rows of data, or no text in key header
columns (e.g., PSNU, Age, Sex, KeyPop). In these cases, unpacking and checking
functions cannot accurately assess data, so these sheets should be skipped. This
function results in updates in unPackingChecks
, unPackSheets
, and
unPackDataPackSheet
.checkComments
checkDuplicateRows
checkExternalLinks
checkMissingMetadata
checkNumericValues
checkStructure
compareTemplateToSchema
defunctDisaggs
exportSubnatToDATIM
getDataValueSets
packForDATIM_MER
packForDATIM_OPU
packForDATIM_UndistributedMER
packDataPack
and packOPUDataPack
to work with new packTool
wrapper function.packTool
to remove duplication.packDataPack
function now only takes in d
and d2_session
as arguments.packOPUDataPack
function now takes in a d
object, an undistributed_mer_data
dataframe, and a d2_session
object as arguments. When an undistributed_mer_data
object is provided, it will use these target values for distributing rather than taking target values from DATIM.loadSheets
readSheet
checkFormulas
checkDisaggs
(instead of defunctDisaggs
)checkInvalidPrioritizations
checkInvalidOrgUnits
checkNegativeValues
checkDecimalValues
checkMissingMetadata
checkNonNumeric
(instead of checkNumericValues
)checkDupeRows
(instead of checkDuplicateRows
)checkColumnStructure
(instead of checkColStructure
)checkToolStructure
(instead of checkStructure
)checkToolConnections
(instead of checkExternalLinks
)checkToolComments
(instead of checkComments
)checkSheets
extract_uid
extract_uid_all
packTool
around packDataPack
and packOPUDataPack
checkOutputFolder
function to check_params
set that validates that an output folder has been provided, that the directory exists, and can be written to.unPackDataPackSheet
to reduce cyclomatic complexity and make it functional over multiple sheets at once.unPackDataPack
to use new check functions (see above).unPackTool
to use loadDataPack
instead of createKeychainInfo
.unPackDataPackSheet
.separateDataSets
checkMissingMetadata
in unPackSNUxIM
for now.createKeychainInfo
to be more accurate in deducing metadata from submitted Data Packs.loadDataPack
to be production ready.packForDATIM
to streamline all related functions into one and removes packForDATIM_MER
, packForDATIM_OPU
, and packForDATIM_UndistributedMER
. Updates related functions accordingly.exportSubnatToDatim
function.compareTemplateToSchema
function after removing last instance of usage in packDataPack
.data-raw/COP21OPU_PSNUxIM_generation_from_Data_Pack.R
which allows the generation of a COP21 OPU tool that includes the target values from a COP21 Data Pack tool and the % distributions from DATIM.listWorkbookContents
packForDATIM
separateDataSets
unPackSheets
prepareMemoData
createAnalytics
pullDATIMCodeList
and pullFullCodeList
functions in favor of getCodeList
api_sql_call
function (DP-603)getCodeList
which utilizes datimutils
API utilities and replaces pullDATIMCodeList
and pullFullCodeList
(DP-599)getCodeList
uses cop_year
as a parameter rather than the FY
parameter previously used by pullDATIMCodeList
and pullFullCodeList
get_Map_DataPack_DATIM_DEs_COCs
and checkPSNUData
(DP-272)datimutils
API utilities:getHTSModality
(DP-597)map_Cs_to_COs
(DP-605)stringi
, glue
, data.table
, and readr
packages (DP-670, DP-671, DP-687, DP-693)cop_year
over fiscal_year
and FY
for parameters (DP-691)pick_schema
across functions (DP-294)packSNUxIM
to reduce cyclomatic complexity (DP-662)checkPSNUData
and prepareMemoData
to stop crashes on Windows by avoiding paralellization if Windows OS detectedmessageQueue
to avoid potential mismatches of message level and message textgetMechanismViewFromDATIM
into getMechanismView
tool
and cop_year
against one another. Adds datapackrSupports
, supportedCOPYears
, & supportedTools
.datimutils
instead of datapackr
API functions:getMechanismView
map_COCs_to_COs
getDataSetUids
, writePSNUxIM
, and packPSNUxIM
to reduce cyclomatic complexity of both functionsgetDataSetUids
to use cop_year
instead of FY
in parameterspullFullCodeList
getCurrentCOPYear
paste_oxford
to accommodate length = 2checkInvalidIndicatorCodes
to utilize pick_schema
instead of hard coded schemaR6
(DP-694), plyr
(DP-672), and rlist
(DP-684)full.name
to full.names
in list.files
call in extractWorkbook
functiondatapackr.R
to add missing global variablescanReadFile
checkDuplicateRows
checkInvalidIndicatorCodes
checkMechanisms
defuntDisaggs
fetchPrioritizationTable
getHTSModality
getOPUDataFromDATIM
memoStructure
and prepareMemoData
pullFullCodeList
test for FY2022getCurrentCOPYear
incrementingplay-spectrum test
. Also increments cop_year
within this test.gitignore
and .Rbuildignore
prepareMemoData
and prepareMemoDataByPSNU
to avoid parallelization on CI environmentsREADME.md
packOPUDataPack
by reverting changes to parameter names in exportPackr
calls that were accidentally made during release v5.2.0.R/packSNUxIM_2020.R
R/packSNUxIM_OPU.R
R/unPackOPU_PSNUxIM.R
data/cop20_data_pack_schema.rda
data/cop20_map_DataPack_DATIM_DEs_COCs.rda
data/cop20OPU_data_pack_schema.rda
data/data_pack_schema.rda
data/updated_indicator_codes.rda
data/valid_category_options.rda
data-raw/cop20_validation_rules.json
data-raw/COP20OPU_Data_Pack_generation_script.R
data-raw/COP20OPU_Data_Pack_processing_script.R
data-raw/COP20OPU_Data_Pack_validation_script.R
data-raw/cop21_datapack_indicator_code_updates.csv
data-raw/GetDataForGlobalFund.R
data-raw/TEST_COP20_OPU_Data_Pack_Template.xlsx
data-raw/update_cop20_datapack_template.R
data-raw/update_cop20OPU_datapack_schema.R
data-raw/update_cached_valid_COs.R
data-raw/valid_COCs_COs.rda
inst/extdata/COP20_Data_Pack_Template_Final.xlsx
inst/extdata/COP20_OPU_Data_Pack_Template.xlsx
data/data_pack_schema.rda
data-raw/checkTX_CURR.R
data-raw/produceConfigFile.R
adorn_import_file
check_cop_year
check_tool
checkMechanisms
createAnalytics
createKeychainInfo
createTestDataset
compareData_OpuDatapackVsDatim
getCOPDataFromDATIM
getDataSetUids
getHTSModality
getMapDataPack_DATIM_DEs_COCs
getMemoIndicators
getOPUDataFromDATIM
headerRow
memoStructure
packDataPack
packForDATIM_OPU
pick_schema
pick_template_path
skip_tabs
unPackOPUDataPack
unPackSNUxIM
unPackSchema_datapack
writePSNUxIM
adornMechanisms
adornPSNUs
deriveTargets
getCountries
getIMPATTLevels
getNumeratorDenominator
getTechArea
getValidCategoryOptions
getValidCOs
packForPAW
pull_COPindicators
.testInvalidIndicatorCodes
to checkInvalidIndicatorCodes
updateExistingPrioritization
that was preventing tools from being unpacked or memos from being generated in the appsdata_pack_schema
to pick_schema()
for the following functions:packDataPackSheet
packSheets
prepareSheetData
lazyeval
and datapackcommons
as required packages as neither are used in the package anywherePrEP_CT >= PrEP_NEW
validation rule from checks. (DP-552)DIAGNOSED_SUBNAT (N, SUBNAT, HIVStatus) TARGET >= DIAGNOSED_SUBNAT (N, SUBNAT, Age/Sex/HIV) TARGET + DIAGNOSED_SUBNAT (N, SUBNAT, HIV/Sex) TARGET
validation rule from checks. (DP-554)checkMechanisms
.default/unallocated
data is included in COP Approval Memo tables.unPackSNUxIM
in R/unPackSNUxIM.R
back to 5.1.5.formatSetStrings
to assist in the checkFormulas
function. Formats a vector of numbers into a string of ranges.swapColumns
function located in R/utilities.R
: (DP-547)mutate_
with base R fix to remove deprecation warning when writing PSNUXIM tab.swapColumns
in tests/testthat/test-utilities.R
R/utilities.R
tests/testthat/test-GetDatasetUids.R
data-raw/update_cop22_de_coc_co_map.R
data/cop22_map_DataPack_DATIM_DEs_COCs.rda
data/cop22_map_adorn_import_file.rda
data-raw
and tests
folders now in addition to R
folder. (DP-578)datastreams
parameter to consolidate parameter names across functions (DP-579)datastream
parameter for pullFullCodeList
to datastreams
streams
parameter for getCOPDataFromDATIM
to datastreams
datastreams
parameter to datapackr_params
getCOPDataFromDATIM
and inherits them from datapackr_params
insteadd2_session
parameter to getCountries
function in R/utilities.R
(DP-580)output_folder
as parameter for all functions that export files (DP-581)output_path
parameter in exportPackr
to output_folder
exportPackr
in all relevant locationsoutput_folder
definition in datapackr_params
to remove outdated reference to defaulting to working directory.datapackr_params
type
argument from deriveTargets
.country_names
argument from getOPUDataFromDATIM
.getOPUDataFromDATIM
and inherits definitions from datapackr_params
.generateMemoTemplate
.MAX_CORES
which will limit the number of cores to be used in parallel processing. This environment variable is detected by the new function getMaxCores
.append
to writePSNUxIM
. This parameter is TRUE
by default and will append new rows to the existing PSNUxIM tab. If FALSE
, a new PSNUxIM tab will be output only containing the new rows needed in the validated tool.include_default
to getMechanismView
and adorn_import_file
that will include the default mechanism to the dataframe that is returned.checkHasPSNUxIM
to detect whether a COP Data Pack has a PSNUxIM tab.checkFormulas
to clarify that users may edit formulas in Green columns without permission, but need to receive clearance from DUIT prior to editing formulas in Grey columns. (DP-241)checkColStructure
more robust.stringi
dependency due to new use of stringi::stri_replace_all
. This will be replaced with a stringr
function in a later version to reduce dependencies.evaluateIndicators
fetchPrioritizationTable
generateComparisonTable
getMemoIndicators
memoStructure
prepareExistingDataAnalytics
prepareMemoData
prepareMemoDataByAgency
prepareMemoDataByPSNU
prepareMemoDataByPartner
prepareMemoDataByPrio
prepareMemoMetadata
updateExistingPrioritization
getMemoTemplate
selects whether to supply a watermarked "Draft Memo" Word document or a blank document for final memo tables.renderAgencyTable
, renderPartnerTable
, and renderPrioTable
each generate formatted tables for their respective sections of the memo.generateApprovalMemo
compiles all target tables together in a single document.default_memo_font
, default_memo_style_header
, and default_memo_style_para
contain information on standard memo formatting.zeros_to_dashes
is a utility function used in formatting memos appropriately.cop_validation_rules
as new dataset object within packagedata-raw
file to create and update cop_validation_rules
objectdraft_memo_template.docx
under inst/extdata
folder for use in draft memo generationtest-get-memo-indicators
to test getMemoIndicators
test-indicators
to test evaluateIndicators
test-memo-structure
to test memoStructure
datapackr-app
into the package (DP-504)checkMechanisms
and checkPSNUData
to replace validateMechanisms
and validatePSNUData
from the datapackr-app
, respectively. These functions are used in validating and analyzing Data Pack targets.sane_name
, source_user
, and operating_unit
as new variables under d$info
in keychaingetSaneName
and getOUFromCountryUIDs
as new functionscreateKeychainInfo
to create new variables under d$info
packDataPack
to create new variables under d$info
d2_session
argument to createKeychainInfo
getCOPDataFromDATIM
(DP-536)parallel
, gdtools
, flextable
, and officer
as suggested packagesopenxslx
to version 4.2.3 to prevent error with PSNUxIM packing.HTS Modality (USE ONLY for FY22 Results/FY23 Targets)
.compareData_OpuDatapackVsDatim
to NOT compare AGYW data which are not part of OPU data packs.unPackSchema_datapack
and validateSchema
to use standard argument names. Replaces filepath
with template_path
and replaces their usage in all relevant locations.%<>%
function.interactive_warning
.getPass
since this code is commented out and functionality has been replaced by datimutils
.data.R
file and allows for creation of documentation for all datasets..Rbuildignore
to include all appropriate files and folder.datimutils
.methods
.waldo
package.scales
and stringi
as dependencies as they are not used.assertthat
from Imports
to Suggests
since it is only used in data-raw
files.data-raw
files to environment variables. Users can add these to an .Rprofile
to streamline their workflow:SECRETS_FOLDER
OUTPUT_FOLDER
MODEL_DATA_PATH
SNUXIM_MODEL_DATA_PATH
unPackCountryUIDs
that was introduced in v5.0.1 due to linting. This bug preventing the processing of COP and OPU tools in datapackr-app
as well as broke the createAnalytics
function for regional tools.packForDATIM_UndistributedMER
now takes in arguments for MER data and COP year instead of an entire d
object and returns a table of undistributed MER data rather than return a d
object with data nested under d$data$UndistributedMER
.d
object for unallocated IMs nested under d$info$unallocatedIMs
.getDatasetUids
function.getMapDataPack_DATIM_DEs_COCs
to include handling for COP22 map.getDatasetUids
waldo
package.datapackr
.categoryOptionCombo
.packDataPackSheet
, packSheets
, and prepareSheetData
.loginToDATIM
is retired in favor of the same function in datimutils
. All
instances of this function being invoked have been replaced appropriately.DHISLogin
, GetCredentialsFromConsole
, LoadConfigFile
,
and ValidateConfig
were not exported and are now deprecated as well.
They were previously only used by loginToDATIM
.isLoggedIn
is retired as it was only used in getMechList
and
loginToDATIM
.packOPUDataPack
where createDataPack
was not
implemented correctly in version 5.0.1.getOPUDataFromDATIM
where getCOPDataFromDATIM
returns
a dataframe where the default Category Option Combo UID is listed as default
rather than the appropriate DATIM UID. This will be removed in favor of a more
permanent solution in future updates.getDataPackSchema
in favor of consolidated pick_schema
.getDataPackSchema
has been deprecated in favor of pick_schema
and has been
replaced in the two locations where it was previously used.%missing%
and %||%
.loadDataPack
is a new function that returns a Data Pack object conserving
styles and formatting of the original Data Pack .xlsx file, as well as other
metadata necessary for processing and analysing data in the Data Pack..testInvalidIndicatorCodes
was previously an internal function that is now
documented and exported by the package. This function tests for invalid
indicator codes in a d
Datapackr object.datapack_cogs
is a new dataset containing Datapack Category option groups
(id and name) along with their individual category options (id and name) as a
nested data frame.createWorkbook
has been renamed createDataPack
to deconflict with the
openxlsx function createWorkbook
. This function now returns a d
datapackr object rather than an openxlsx workbook object.d2_session
argument has been removed from the following functions:check_params
createDataPack
(previously createWorkbook
)unPackSchema_datapack
unPackSchema_datapack
was modified in the following ways:datapack_cogs
data set rather than making a query to DATIM.datapackr_params
.writeHomeTab
was modified in the following ways:wb
and datapack_name
arguments default to NULL
.check_params
function.packSNUxIM
that
had been erroneously changed during previous linting.check_params
function.data-raw
to generate the datapack_cogs
data set.cop20OPU_data_pack_schema
data set.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.