Skip to contents

Scans built-in rules, cached CDISC CORE rules, and Pinnacle 21 Community rule directories. Returns a catalog object summarising every available rule source without loading any YAML files.

Usage

rule_catalog(path = NULL, source = "all")

Arguments

path

Path to a Pinnacle 21 rules directory (organised as {version}/{authority}/{standard}/). When NULL (default), resolved via getOption("herald.p21_rules_path"), the HERALD_P21_RULES_PATH environment variable, or a sibling-repo heuristic (see Details).

source

Character vector of sources to include. Any combination of "builtin", "core", "p21", or "all" (default).

Value

A herald_rule_catalog S3 object. Use print() for a formatted summary or as.data.frame() for a flat table.

Details

P21 path resolution

The path argument is resolved in order:

  1. Explicit path argument

  2. getOption("herald.p21_rules_path")

  3. Sys.getenv("HERALD_P21_RULES_PATH")

  4. Sibling directory ../herald-rules/.local/p21-new relative to the package project root

If none resolve, P21 rules are omitted from the catalog.

Examples

# Browse everything available
# catalog <- rule_catalog()
# print(catalog)

# Only built-in rules
# catalog <- rule_catalog(source = "builtin")

# Flatten to data.frame for analysis
# df <- as.data.frame(catalog)