Synchronize Validation Statuses with KoboToolbox
sync_validation_submissions.Rd
Synchronizes validation statuses between the local system and KoboToolbox by processing validation flags and updating submission statuses accordingly. This function handles both flagged (not approved) and clean (approved) submissions in parallel.
Usage
sync_validation_submissions(log_threshold = logger::DEBUG)
Details
The function follows these steps:
Downloads the current validation flags from cloud storage
Sets up parallel processing using the future package
Processes submissions with alert flags (marking them as not approved in KoboToolbox)
Processes submissions without alert flags (marking them as approved in KoboToolbox)
Pushes all validation flags to MongoDB for record-keeping
Progress reporting is enabled to track the status of submissions being processed.
Note
This function requires proper configuration in the config file, including:
MongoDB connection parameters
KoboToolbox asset ID and token
Google cloud storage parameters
Parallel Processing
The function uses the future and furrr packages for parallel processing, with the number of workers set to system cores minus 2 to prevent resource exhaustion.
Examples
if (FALSE) { # \dontrun{
# Run with default DEBUG logging
sync_validation_submissions()
# Run with INFO level logging
sync_validation_submissions(log_threshold = logger::INFO)
} # }