From ea730539f8f81d342f8f3f08345e861a1ff45f14 Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Tue, 2 Jul 2024 06:07:52 +0100 Subject: [PATCH] update README --- README.Rmd | 18 ++++++++++--- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 87 insertions(+), 10 deletions(-) diff --git a/README.Rmd b/README.Rmd index 9a29d87..0e57311 100644 --- a/README.Rmd +++ b/README.Rmd @@ -50,7 +50,7 @@ This use case are for those that prefer not to use Microsoft Access (either beca ## Installation -`coeditr` is not yet on CRAN but can be installed through the [Oxford IHTM R-universe](https://oxfordihtm.r-universe.dev) with: +`coeditr` is not yet on CRAN but can be installed through the [Oxford IHTM R Universe](https://oxfordihtm.r-universe.dev) with: ```{r install, eval = FALSE} install.packages( @@ -98,13 +98,19 @@ The output is a data.frame that can then be saved as an `.xlsx` file for use as The `cod_check_code()` function performs all the checks implemented by the CoDEdit tool. ```{r use-case-3} -cod_check_code(cod_data_raw_example$code, version = "icd11", sex = "sex") +cod_check_code( + cod_data_raw_example$code, version = "icd11", + sex = cod_data_raw_example$sex, age = cod_data_raw_example$age +) ``` Results of the per row cause-of-death checks can also be summarised to give a count of issues found in the dataset. ```{r use-case-4} -cod_check_code(cod_data_raw_example$code, version = "icd11", sex = "sex") |> +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() ``` @@ -121,6 +127,12 @@ cod_check_code_ill_defined_icd11(cod_data_raw_example$code) ### Perform check for unlikely cause-of-death codes ---- cod_check_code_unlikely_icd11(cod_data_raw_example$code) + +### Perform check for cause-of-death codes inappropriate for specific sex ---- +cod_check_code_sex_icd11(cod_data_raw_example$code, cod_data_raw_example$sex) + +### Perform check for cause-of-death codes inappropriate for specific age ---- +cod_check_code_age_icd11(cod_data_raw_example$code, cod_data_raw_example$age) ``` ## Citation diff --git a/README.md b/README.md index 576143e..40967d5 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ potentially large scale cause-of-death data quality checks. ## Installation `coeditr` is not yet on CRAN but can be installed through the [Oxford -IHTM R-universe](https://oxfordihtm.r-universe.dev) with: +IHTM R Universe](https://oxfordihtm.r-universe.dev) with: ``` r install.packages( @@ -173,8 +173,11 @@ The `cod_check_code()` function performs all the checks implemented by the CoDEdit tool. ``` r -cod_check_code(cod_data_raw_example$code, version = "icd11", sex = "sex") -#> # A tibble: 20 × 10 +cod_check_code( + cod_data_raw_example$code, version = "icd11", + sex = cod_data_raw_example$sex, age = cod_data_raw_example$age +) +#> # A tibble: 20 × 12 #> cod_check_structure cod_check_note_structure cod_check_ill_defined #> #> 1 0 No issues found in CoD code 0 @@ -197,17 +200,20 @@ cod_check_code(cod_data_raw_example$code, version = "icd11", sex = "sex") #> 18 0 No issues found in CoD code 0 #> 19 0 No issues found in CoD code 0 #> 20 0 No issues found in CoD code 0 -#> # ℹ 7 more variables: cod_check_note_ill_defined , +#> # ℹ 9 more variables: cod_check_note_ill_defined , #> # cod_check_unlikely , cod_check_note_unlikely , -#> # cod_check_sex , cod_check_note_sex , cod_check_code , -#> # cod_check_code_note +#> # cod_check_sex , cod_check_note_sex , cod_check_age , +#> # cod_check_note_age , cod_check_code , cod_check_code_note ``` Results of the per row cause-of-death checks can also be summarised to give a count of issues found in the dataset. ``` r -cod_check_code(cod_data_raw_example$code, version = "icd11", sex = "sex") |> +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 @@ -246,6 +252,13 @@ cod_check_code(cod_data_raw_example$code, version = "icd11", sex = "sex") |> #> 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 +#> +#> 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 @@ -328,6 +341,58 @@ cod_check_code_unlikely_icd11(cod_data_raw_example$code) #> 18 0 No issues found in CoD code #> 19 0 No issues found in CoD code #> 20 0 No issues found in CoD code + +### Perform check for cause-of-death codes inappropriate for specific sex ---- +cod_check_code_sex_icd11(cod_data_raw_example$code, cod_data_raw_example$sex) +#> # A tibble: 20 × 2 +#> cod_check cod_check_note +#> +#> 1 0 No issues found in CoD code +#> 2 0 No issues found in CoD code +#> 3 0 No issues found in CoD code +#> 4 0 No issues found in CoD code +#> 5 0 No issues found in CoD code +#> 6 0 No issues found in CoD code +#> 7 0 No issues found in CoD code +#> 8 0 No issues found in CoD code +#> 9 0 No issues found in CoD code +#> 10 0 No issues found in CoD code +#> 11 0 No issues found in CoD code +#> 12 0 No issues found in CoD code +#> 13 0 No issues found in CoD code +#> 14 0 No issues found in CoD code +#> 15 0 No issues found in CoD code +#> 16 0 No issues found in CoD code +#> 17 0 No issues found in CoD code +#> 18 0 No issues found in CoD code +#> 19 0 No issues found in CoD code +#> 20 0 No issues found in CoD code + +### Perform check for cause-of-death codes inappropriate for specific age ---- +cod_check_code_age_icd11(cod_data_raw_example$code, cod_data_raw_example$age) +#> # A tibble: 20 × 2 +#> cod_check cod_check_note +#> +#> 1 0 No issues found in CoD code +#> 2 0 No issues found in CoD code +#> 3 0 No issues found in CoD code +#> 4 0 No issues found in CoD code +#> 5 0 No issues found in CoD code +#> 6 0 No issues found in CoD code +#> 7 0 No issues found in CoD code +#> 8 0 No issues found in CoD code +#> 9 0 No issues found in CoD code +#> 10 0 No issues found in CoD code +#> 11 0 No issues found in CoD code +#> 12 0 No issues found in CoD code +#> 13 0 No issues found in CoD code +#> 14 0 No issues found in CoD code +#> 15 0 No issues found in CoD code +#> 16 0 No issues found in CoD code +#> 17 0 No issues found in CoD code +#> 18 0 No issues found in CoD code +#> 19 0 No issues found in CoD code +#> 20 0 No issues found in CoD code ``` ## Citation