Skip to contents

Builds a herald_context object that captures the submission standard, version, CT package version, and optional Define-XML path. Pass the context to validate() via the standard / version parameters for standard-aware rule selection and richer reports.

Usage

new_herald_context(
  standard = NULL,
  version = NULL,
  ct_version = NULL,
  define_xml = NULL,
  call = rlang::caller_env()
)

Arguments

standard

Character. One of "sdtmig", "adamig", or "sendig". Case-insensitive.

version

Character. Standard version string, e.g., "3.4" for SDTMIG 3.4, "1.1" for ADaMIG 1.1. NULL to omit.

ct_version

Character. NCI EVS CT release date, e.g., "2024-06-28". NULL to omit.

define_xml

Character. Path to a Define-XML 2.1 file, or NULL.

call

Caller environment for error reporting.

Value

A herald_context object (S3 list with class "herald_context").

Examples

ctx <- new_herald_context("sdtmig", "3.4")
ctx$standard   # "sdtmig"
#> [1] "sdtmig"
ctx$version    # "3.4"
#> [1] "3.4"

ctx2 <- new_herald_context("adamig", "1.1", ct_version = "2024-06-28")