Structure ICD list and ICD search outputs
Usage
icd_structure_foundation(icd_list)
icd_structure_search(icd_search)
icd_structure_autocode(icd_autocode)
icd_structure_entity(icd_entity)Arguments
- icd_list
An object produced by a call to any of the
icd_getfunctions- icd_search
An object produced by a call to any of the
icd_searchfunctions- icd_autocode
An object produced by a call to any of the
icd_autocodefunctions- icd_entity
An object produced by a call to any of the
icd_get_entityfunctions
Details
These functions are meant to be helper functions and are used
within the icd_get, icd_search, icd_autocode, and icd_get_entity
functions to structure the output responses.
Examples
# \donttest{
icd_list <- icd_get_foundation(tabular = FALSE)
#> Release `2026-01` matches a known release for ICD-11.
#> Language `en` is available for the release specified.
icd_tbl_foundation <- icd_structure_foundation(icd_list)
icd_structure_search(icd_search_foundation("cholera", tabular = FALSE))
#> Release `2026-01` matches a known release for ICD-11.
#> Language `en` is available for the release specified.
#> # A tibble: 27 × 27
#> id title stemId isLeaf postcoordinationAvai…¹ hasCodingNote
#> <chr> <chr> <chr> <lgl> <int> <lgl>
#> 1 http://id.who.int/i… Chol… http:… FALSE 0 FALSE
#> 2 http://id.who.int/i… Expo… http:… TRUE 0 FALSE
#> 3 http://id.who.int/i… Chol… http:… FALSE 0 FALSE
#> 4 http://id.who.int/i… Chol… http:… FALSE 0 FALSE
#> 5 http://id.who.int/i… Chol… http:… TRUE 0 FALSE
#> 6 http://id.who.int/i… Vibr… http:… FALSE 0 FALSE
#> 7 http://id.who.int/i… Anti… http:… TRUE 0 FALSE
#> 8 http://id.who.int/i… Harm… http:… TRUE 0 FALSE
#> 9 http://id.who.int/i… Chol… http:… FALSE 0 FALSE
#> 10 http://id.who.int/i… Chol… http:… TRUE 0 FALSE
#> # ℹ 17 more rows
#> # ℹ abbreviated name: ¹postcoordinationAvailability
#> # ℹ 21 more variables: hasMaternalChapterLink <lgl>,
#> # hasPerinatalChapterLink <lgl>, matchingPVs <list>,
#> # propertiesTruncated <lgl>, isResidualOther <lgl>,
#> # isResidualUnspecified <lgl>, chapter <chr>, theCode <lgl>, score <dbl>,
#> # titleIsASearchResult <lgl>, titleIsTopScore <lgl>, entityType <int>, …
icd_structure_autocode(icd_autocode_foundation("cholera"))
#> Release `2026-01` matches a known release for ICD-11.
#> Language `en` is available for the release specified.
#> # A tibble: 1 × 5
#> searchText matchLevel matchScore matchType isTitle
#> <chr> <int> <int> <int> <lgl>
#> 1 cholera 3 0 0 FALSE
# }
