validate_data_in_branching_logic | R Documentation |
This is a utility function that uses branching logic to validate data entry workflow for errors of omission.
validate_data_in_branching_logic(rec, metadataName = "metadata.formatted", dataName = "data.raw", ipno_var = stop("Provide variable name for IP Number"), dateOfEntry_var = stop("Provide variable name for date of entry"), recordID_var = stop("Provide variable name for record ID"), hospitalID_var = stop("Provide variable name for hospitals"), individual.vars = stop("Provide a list of variables to be validated individually"), n.groups = NULL, group.names = NULL, validateTreatmentDates = F, treatmentFormName = NULL, dischargeDateVar = NULL, admissionDateVar = NULL)
rec |
Single record in the data |
metadataName |
Metadata name |
dataName |
Data name |
ipno_var |
Name of variable for patient IP Number |
dateOfEntry_var |
Name of variable that captures the date of entry |
recordID_var |
Name of variable that uniquely identifies records |
hospitalID_var |
Name of variable that holds the hospital code |
individual.vars |
A character name of the object containing variables to be validated individually |
n.groups |
Numebr of groups provided in group.names |
group.names |
A vector of character names of the objects containing variables to be validated as a group |
validateTreatmentDates |
Logical. If FALSE, treatment dates will not be validated |
treatmentFormName |
Name of the treatment section in the metadata. This is required if validateTreatmentDates is TRUE |
dischargeDateVar |
Name of variable that holds the date of discharge. This is required if validateTreatmentDates is TRUE |
dischargeDateVar |
Name of variable that holds the date of admission. This is required if validateTreatmentDates is TRUE |
Using the redcap metadata's newly created variable f.branching_logic, code is generated that validates data entry during the data capture process.
A data frame with details of the errors.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.