packPSNUxIM: packPSNUxIM

View source: R/packPSNUxIM.R

packPSNUxIMR Documentation

packPSNUxIM

Description

Packs the PSNUxIM tab in either a COP or OPU Data Pack.

Usage

packPSNUxIM(
  wb,
  data,
  snuxim_model_data,
  org_units,
  cop_year = NULL,
  tool = "PSNUxIM",
  schema = NULL,
  expand_formulas = FALSE,
  d2_session = dynGet("d2_default_session", inherits = TRUE)
)

Arguments

wb

Openxlsx workbook object.

data

Dataset containing totals for allocation within PSNUxIM tab, formatted as a standard DHIS2 import file.

snuxim_model_data

Export from DATIM needed to allocate data across mechanisms in the PSNUxIM tab.

cop_year

COP Year to use for tailoring functions. Remember, FY22 targets = COP21.

tool

Type of tool this function will create or interact with. Either OPU Data Pack or Data Pack

schema

Which datapackr schema to use in guiding this function. If left NULL will select the default based on cop_year and tool.

expand_formulas

Write all formulas on right side of PSNUxIM tab, not just the first row.

d2_session

DHIS2 Session id. R6 datimutils object which handles authentication with DATIM.

Value

r Sidecar object containing both an openxlsx Workbook and alert messages


pepfar-datim/datapackr documentation built on April 14, 2024, 10:35 p.m.