Learn R Programming

r4subprofile (version 0.1.0)

validate_against_profile: Validate Evidence Against a Submission Profile

Description

Checks whether an evidence table meets the requirements specified by a regulatory submission profile: required indicators present, required asset types covered, and minimum indicator coverage met.

Usage

validate_against_profile(evidence, profile)

Value

A list of class "profile_validation" with elements:

  • is_compliant: logical; TRUE if all requirements are met

  • missing_indicators: character vector of missing required indicator IDs

  • missing_asset_types: character vector of missing required asset types

  • coverage: numeric; fraction of required indicators present (0-1)

  • coverage_met: logical; whether coverage meets the minimum threshold

  • details: tibble with per-requirement status

Arguments

evidence

A validated evidence data.frame conforming to the r4subcore evidence schema.

profile

A submission_profile object.

Examples

Run this code
# \donttest{
ctx <- r4subcore::r4sub_run_context(study_id = "STUDY01")
ev <- r4subcore::as_evidence(
  data.frame(
    asset_type = "dataset", asset_id = "ADSL",
    source_name = "test", source_version = "1.0",
    indicator_id = "Q-001", indicator_name = "Test",
    indicator_domain = "quality", severity = "high",
    result = "fail", metric_value = 1, metric_unit = "n",
    message = "Example finding", location = "ADSL",
    evidence_payload = "{}", stringsAsFactors = FALSE
  ), ctx = ctx
)
prof <- submission_profile("FDA", "NDA")
result <- validate_against_profile(ev, prof)
result$is_compliant
result$missing_indicators
# }

Run the code above in your browser using DataLab