GenerateCodeForDataEntryValidation: Autogenerate code for error reporting

Description Usage Arguments Details Value See Also

Description

This is a utility function that employs code generation to produce R code that validates data entry workflow for errors of omission and commision.

Usage

1
2
generate_data_validation_code(metadata, date_var, hosp_var, custom_code = NA,
  updates = NULL, updates_envir_depth = 1)

Arguments

metadata

REDCap metadata

date_var

Name of variable that captures the date of entry

hosp_var

Name of variable that holds the hospital code

custom_code

Any code that is appended for custom plugin of special validation checks.

updates

Name of a list of RedcapUpdate(s) to be used for plugging functionality that abstracts the introduction of new variables during the projects lifecycle. See RedcapUpdate

updates_envir_depth

Integer of what parent frame contains updates. Default is immediate parent of calling environment (1) ie one level deep.

Details

Using the redcap metadata, code is generated that validates data entry during the data capture process.

This code is then evaluated into a function that is then iterated through the records to check for errors during data capture.

The result is a dataset containing the resultant errors.

Value

A function that can be evaluated to validate data entry workflow for a single record.

See Also

Other Code Generators: generate_date_conversion_code; generate_formatting_code; generate_remove_missing_code; generate_remove_outliers_code


Maglado/redcapdata_p documentation built on May 26, 2019, 4:37 p.m.