Skip to content

Commit

Permalink
updated number and test
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoZepeda committed Jul 19, 2024
1 parent 60553e2 commit c2e7c06
Show file tree
Hide file tree
Showing 54 changed files with 102 additions and 97 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: WHOicd
Title: Retrieve data from the World Health Organization (WHO) International Classification of Diseases (ICD) API version 2
Version: 0.4.0
Version: 0.4.1
Authors@R:
person("Rodrigo", "Zepeda-Tello", , "rzepeda17@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4471-5270"))
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# WHOicd 0.4.1

* Fixed minor errors on the website.

# WHOicd 0.4.0

* `doris` now allows for multiple languages beyond English
Expand Down
21 changes: 15 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,24 @@ code_place <- function(input) {
#'
#' Function that retrieves a list of function
#'
#' @param lname Name of the list entry to recover as a vector
#' @return A
#' @param list_val List to extract the entry `val` from
#' @param val Name of the list entry to recover as a vector
#' @return The entry `val` from `list_val` as vector
#' @examples
#' val <- "title"
#' search_results <- icd11_search(token, "HIV stage 4")
#' search_results |> retrieve("title")
#' if (exists("CLIENT_ID") & exists("CLIENT_SECRET")) {
#' # Generated token
#' token <- get_token(CLIENT_ID, CLIENT_SECRET)
#' val <- "title"
#' search_results <- icd11_search(token, "HIV stage 4")
#' search_results |> retrieve("title")
#' }
#' @export
retrieve <- function(list_val, val){
vec <- unlist(sapply(list_val$destinationEntities, function(entity) entity[val]))
if (val %in% names(list_val)){
vec <- unlist(list_val[val])
} else {
vec <- unlist(sapply(list_val$destinationEntities, function(entity) entity[val]))
}
names(vec) <- NULL
return(vec)
}
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Another function of importance is `autocode` which reads plain-text diagnostic t
code_results <- icd11_autocode(token, "Patient with cerebrovascular accident")
#Recover the code that matched
code_results |> retrieve("title")
code_results |> retrieve("theCode")
```


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ diagnostic text and returns the best matching code either in *MMS* or
code_results <- icd11_autocode(token, "Patient with cerebrovascular accident")

#Recover the code that matched
code_results |> retrieve("title")
#> NULL
code_results |> retrieve("theCode")
#> [1] "8B20"
```

## ICD-10 examples
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Generating-your-token.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/ICD-10.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pkgdown_sha: ~
articles:
articles/Generating-your-token: Generating-your-token.html
articles/ICD-10: ICD-10.html
last_built: 2024-07-19T18:37Z
last_built: 2024-07-19T18:54Z
2 changes: 1 addition & 1 deletion docs/reference/autocode.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_names.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_token_expiration_time.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/code_place.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/codify_ans.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/codify_manner_of_death.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/codify_sex.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/doris.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dot-icd10_search_recursive.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/get_token.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_blocks.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_chapters.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_code_search_release.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_codes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_name_children.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_parent.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_release_info.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_releases.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_request_children.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_search.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_title.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/icd10_validate_code.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c2e7c06

Please sign in to comment.