schema-validations: Standardized Schema Checks

schema-validationsR Documentation

Standardized Schema Checks

Description

Standardized package functions,in terms of schema checks. These can be run individually (e.g., checkSchema_SheetNums), or in bulk (e.g., checkSchema(template_path = "my/file/path", cop_year = 2022, tool = "Data Pack")).

Usage

checkSchema_SkippedSheets(schema, tool, cop_year)

checkSchema_SheetNums(schema)

checkSchema_SheetNames(schema, filepath_schema)

checkSchema_InvalidDatasets(schema, tool, cop_year)

checkSchema_InvalidColType(schema, tool, cop_year)

checkSchema_InvalidValueType(schema, tool, cop_year)

checkSchema_DataElementSyntax(schema)

checkSchema_COsSyntax(schema)

checkSchema_ValidAges(schema)

checkSchema_ValidSexes(schema)

checkSchema_ValidKPs(schema)

checkSchema_Formulas(schema)

checkSchema(schema, template_path, cop_year, tool, season)

unPackSchema(
  template_path = NULL,
  skip = NULL,
  tool = "Data Pack Template",
  cop_year = NULL
)

Arguments

schema

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

tool

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

cop_year

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

template_path

Local filepath to Data Pack template Excel (XLSX) file. This file MUST NOT have any data validation formats present. If left NULL, will select the default based on cop_year and tool.

season

Either COP or OPU.

skip

Character vector of Sheet Names to label for skipping in schema.

Value

For lower-level functions, a list of instances of failed tests. For the higher-level checkSchema, a list object of lists of failed tests.

  • checkSchema_SkippedSheets:

  • checkSchema_SheetNums:

  • checkSchema_SheetNames:

  • checkSchema_InvalidDatasets:

  • checkSchema_InvalidColType:

  • checkSchema_InvalidValueType:

  • checkSchema_DSDSyntax:

  • checkSchema_TASyntax:

  • checkSchema_COsSyntax :

  • checkSchema_ValidAges :

  • checkSchema_ValidSexes :

  • checkSchema_ValidKPs :

  • checkSchema_Formulas :

  • checkSchema :

  • unPackSchema :


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