flywheel-gear-extensions

Form QC Checker

This gear reads a JSON form data file and uses a form- and study-specific set of QC rules to check the values.

Environment

This gear uses the AWS SSM parameter store, and expects that AWS credentials are available in environment variables (AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, AWS_DEFAULT_REGION) within the Flywheel runtime.

Running

Ideally, qc checks for a participant should be triggered by Form QC Coordinator. Prevent from manually running this gear on individual visit files.

Inputs

Configs

Gear configs are defined in manifest.json.

Error Report

File Metadata and Tagging

After processing, the gear updates the input file with the following metadata. See the QC Conventions reference for details on the data models and conventions used.

  1. QC Result: A validation QC result is added to the file’s file.info.qc metadata with:
    • name: "validation"
    • state: "PASS" or "FAIL" depending on whether QC checks passed
    • data: List of FileError objects with error details (codes, messages, locations) if any validation errors occurred
  2. Validation Timestamp: The file’s .info metadata is updated with a validated_timestamp field set to the current UTC time. This is used by the form-qc-coordinator to determine whether a file needs re-validation.

  3. Gear Tags: The file is tagged using the GearTags mechanism with status-specific tags:
    • Adds form-qc-checker-PASS or form-qc-checker-FAIL based on QC outcome
    • Previous status tags for this gear are removed before adding the new one