Skip to contents

Loads the 85 Define-XML validation rules from the herald-rules repository and runs them against the spec slots. Returns a herald_validation object with findings. Rules are loaded from the local cache at ~/.cache/R/herald/herald-rules/engines/herald/define/.

Usage

validate_spec_define(spec)

Arguments

spec

A herald_spec object.

Value

A herald_validation object.

Examples

spec <- herald_spec(
  ds_spec = data.frame(dataset = "DM", label = "Demographics",
                       stringsAsFactors = FALSE),
  var_spec = data.frame(dataset = "DM", variable = "STUDYID",
                        label = "Study Identifier", data_type = "text",
                        length = "12", stringsAsFactors = FALSE)
)
result <- validate_spec_define(spec)
result
#> 
#> ── herald validation ──
#> 
#> Datasets checked: 1
#>  Spec checks only -- no conformance rules evaluated
#> Findings: 0 reject, 8 high, 0 medium, 0 low
#> 
#> ── Reject / High Impact 
#>  [DD0006] [High] spec.dataset: Dataset name is missing. Each row in the Datasets sheet must have a dataset name.
#>  [DD0007] [High] spec.label: Dataset label is missing. Description is required for all ItemGroupDef in regulatory submissions.
#>  [DD0011] [High] spec.structure: Structure description is missing. def:Structure is required for all datasets.
#>  [DD0017] [High] spec.keys: Key Variables is missing. In regulatory submissions, a key must be provided for each dataset.
#>  [DD0021] [High] spec.variable: Variable name is missing. Each row in the Variables sheet must have a variable name.
#>  [DD0022] [High] spec.label: Variable label is missing. Description is required for all ItemDef corresponding to Variable definitions in regulatory submissions.
#>  [DD0026] [High] spec.data_type: Significant Digits is missing but required when Data Type is float.
#>  [DD0030] [High] spec.origin: Origin is missing. For regulatory submissions, def:Origin metadata must be provided for all variables at either the variable or value level.