Counts by severity, domain and rule class - the three cuts a lead programmer actually triages on, and the equivalent of the PROC FREQ block everyone writes over a validation report before the first status call.

finding_summary(traced)

Arguments

traced

A p21_traced object from trace_findings(), or a p21_findings object from read_findings().

Value

An object of class p21_summary: a list of tibbles by_severity, by_domain and by_rule_class, plus n_findings, n_records (the sum of the reported record counts) and n_unresolved.

Examples

ex <- readRDS(system.file("extdata", "example_study.rds", package = "p21bridge"))
f <- read_findings(system.file("extdata", "findings.csv", package = "p21bridge"))
s <- finding_summary(trace_findings(f, ex$datasets, spec = ex$spec))
s
#> 
#> ── p21bridge finding summary ───────────────────────────────────────────────────
#>  12 findings covering 23 reported records
#> ! 3 findings could not be traced to a supplied dataset
#> 
#> ── By severity ──
#> 
#> # A tibble: 3 × 4
#>   level   findings records errors
#>   <chr>      <int>   <int>  <int>
#> 1 Error          7      11      7
#> 2 Warning        3       8      0
#> 3 Notice         2       4      0
#> ── By domain ──
#> 
#> # A tibble: 5 × 4
#>   level     findings records errors
#>   <chr>        <int>   <int>  <int>
#> 1 DM               5       9      3
#> 2 AE               4       6      3
#> 3 <missing>        1       1      0
#> 4 ADSL             1       4      1
#> 5 VS               1       3      0
#> ── By rule_class ──
#> 
#> # A tibble: 4 × 4
#>   level                  findings records errors
#>   <chr>                     <int>   <int>  <int>
#> 1 SDTM data                     8      18      5
#> 2 Controlled terminology        2       3      2
#> 3 Define-XML                    1       1      0
#> 4 ODM / define metadata         1       1      0
s$by_domain
#> # A tibble: 5 × 4
#>   level     findings records errors
#>   <chr>        <int>   <int>  <int>
#> 1 DM               5       9      3
#> 2 AE               4       6      3
#> 3 <missing>        1       1      0
#> 4 ADSL             1       4      1
#> 5 VS               1       3      0