Skip to contents

Summarise cause-of-death check results

Usage

cod_check_code_summary(cod_check, simplify = FALSE)

Arguments

cod_check

A data.frame output of the various cod_check_code_* functions

simplify

Logical. Should output be converted into a data.frame? Default is FALSE.

Value

If simplify is FALSE (default), a list of summary check outputs. Otherwise, a tabulated summary of check outputs.

Examples

cod_check_code(
  cod_data_raw_example$code, version = "icd11",
  sex = cod_data_raw_example$sex, age = cod_data_raw_example$age
) |>
  cod_check_code_summary()
#> $`Code structure`
#> # A tibble: 65 × 2
#>    cod_check_note                                                              n
#>    <fct>                                                                   <int>
#>  1 No issues found in CoD code                                                20
#>  2 CoD code has a period (`.`) character in the wrong place                    0
#>  3 CoD code starts with `O` or `I`                                             0
#>  4 CoD code has a period (`.`) character in the wrong place; CoD code sta…     0
#>  5 CoD code has a number as its second value                                   0
#>  6 CoD code has a period (`.`) character in the wrong place; CoD code has…     0
#>  7 CoD code starts with `O` or `I`; CoD code has a number as its second v…     0
#>  8 CoD code has a period (`.`) character in the wrong place; CoD code sta…     0
#>  9 CoD code has `O` or `I` as its second value                                 0
#> 10 CoD code has a period (`.`) character in the wrong place; CoD code has…     0
#> # ℹ 55 more rows
#> 
#> $`Ill-defined code`
#> # A tibble: 2 × 2
#>   cod_check_note                      n
#>   <fct>                           <int>
#> 1 No issues found in CoD code        20
#> 2 CoD code is an ill-defined code     0
#> 
#> $`Unlikely cause-of-death code`
#> # A tibble: 2 × 2
#>   cod_check_note                             n
#>   <fct>                                  <int>
#> 1 No issues found in CoD code               20
#> 2 CoD code is an unlikely cause-of-death     0
#> 
#> $`Code not appropriate for sex`
#> # A tibble: 2 × 2
#>   cod_check_note                                   n
#>   <fct>                                        <int>
#> 1 No issues found in CoD code                     20
#> 2 CoD code is not appropriate for person's sex     0
#> 
#> $`Code not appropriate for age`
#> # A tibble: 2 × 2
#>   cod_check_note                                   n
#>   <fct>                                        <int>
#> 1 No issues found in CoD code                     20
#> 2 CoD code is not appropriate for person's age     0
#> 
#> $Overall
#> # A tibble: 2 × 2
#>   cod_check_note                  n
#>   <fct>                       <int>
#> 1 No issues found in CoD code    20
#> 2 Issues found in CoD code        0
#>