Different regulatory authorities
weight the four R4SUB evidence pillars (quality, trace, risk, usability)
differently. The r4subprofile package encodes these
authority-specific requirements so that the SCI can be calibrated
accordingly.
submission_profile() returns a profile with
authority-specific pillar weights, decision bands, and required
indicators:
profile_summary() returns a tidy tibble summarising the
profile:
profile_summary(fda_nda)
#> ℹ Submission Profile: FDA NDA
#> Authority: U.S. Food and Drug Administration (United States)
#>
#> Pillar Weights:
#> quality 0.35
#> trace 0.25
#> risk 0.25
#> usability 0.15
#>
#> Decision Bands:
#> ready [85, 100]
#> minor_gaps [70, 84]
#> conditional [50, 69]
#> high_risk [0, 49]
#>
#> Required Indicators (15):
#> - Q-MISS-VAR
#> - Q-TYPE-MISMATCH
#> - Q-LABEL-LEN
#> - Q-DUP-RECORDS
#> - Q-FORMAT-ERR
#> - T-ORPHAN-VAR
#> - T-TRACE-LEVEL
#> - T-AMBIGUOUS-MAP
#> - T-DERIVATION-DOC
#> - R-HIGH-RPN
#> - R-OPEN-RISK
#> - R-MITIGATION-GAP
#> - U-DEFINE-COMPLETE
#> - U-REVIEWER-NOTE
#> - U-LABEL-QUALITY
#>
#> Required Asset Types: dataset, define, program, validation, spec
#> Minimum Coverage: 90%
#> Default Detectability: 3validate_against_profile() checks an evidence table
against the profile’s required indicators and asset types:
ev <- data.frame(
run_id = "run-001",
study_id = "STUDY01",
asset_type = c("dataset", "define", "program", "spec"),
asset_id = c("ADSL", "define.xml", "prod_adsl.R", "ADSL"),
source_name = "r4subcore",
source_version = "0.1.2",
indicator_id = c("Q-001", "Q-002", "R-001", "U-001"),
indicator_name = c("Quality Check", "Define Check",
"Program Validation", "Label Quality"),
indicator_domain = c("quality", "quality", "risk", "usability"),
severity = "info",
result = "pass",
metric_value = 1,
metric_unit = "score",
message = "Check passed",
location = c("ADSL", "define.xml", "prod_adsl.R", "ADSL"),
evidence_payload = "{}",
created_at = Sys.time(),
stringsAsFactors = FALSE
)
val <- validate_against_profile(ev, fda_nda)
val$is_compliant
#> [1] FALSE
val$coverage
#> [1] 0
val$missing_indicators
#> [1] "Q-MISS-VAR" "Q-TYPE-MISMATCH" "Q-LABEL-LEN"
#> [4] "Q-DUP-RECORDS" "Q-FORMAT-ERR" "T-ORPHAN-VAR"
#> [7] "T-TRACE-LEVEL" "T-AMBIGUOUS-MAP" "T-DERIVATION-DOC"
#> [10] "R-HIGH-RPN" "R-OPEN-RISK" "R-MITIGATION-GAP"
#> [13] "U-DEFINE-COMPLETE" "U-REVIEWER-NOTE" "U-LABEL-QUALITY"The details tibble shows per-requirement status: