checkMechanismValidity: Check Mechanism Period Validity

View source: R/checkMechanismValidity.R

checkMechanismValidityR Documentation

Check Mechanism Period Validity

Description

This function will return an object of invalid mechanisms and periods. All data which is reported must have a period within the valid start and end dates of the attribute option combination to which it is assigned. The mechanism must also be associated with the operating unit. If either of these two conditions are not met, the data will be flagged as being invalid.

Usage

checkMechanismValidity(
  d,
  organisationUnit = NA,
  return_violations = TRUE,
  d2session = dynGet("d2_default_session", inherits = TRUE)
)

Arguments

d

D2 Parsed data frame

organisationUnit

Organisation unit ancestor.

return_violations

Boolean to return violations only.

d2session

DHIS2 Session id

Value

Returns a data frame of invalid period-mechanism combinations. A warning will also be issued. Returns TRUE if there are no violations.

Examples

## Not run: 
     d <- d2Parser("myfile.csv",type="csv")
     ds <- getCurrentDataSets(type="RESULTS")
     checkMechanismValidity(data=d, organisationUnit = "f5RoebaDLMx")

## End(Not run)


jason-p-pickering/datim-validation documentation built on April 20, 2023, 5:32 a.m.