Skip to contents

Searches the foundation component of the ICD-11.

Usage

icd11_search(
  token,
  text,
  release = "2024-01",
  linearization = "mms",
  subtrees_filter = NULL,
  subtrees_filter_foundation_descendents = FALSE,
  include_keyword_result = FALSE,
  chapter_filter = NULL,
  use_flexisearch = FALSE,
  flat_results = NULL,
  highlighting_enabled = FALSE,
  medical_coding_mode = TRUE,
  properties_to_be_searched = NULL,
  language = "en",
  auto_update = TRUE
)

icd11_search2(
  token,
  text,
  release = "2024-01",
  linearization = "mms",
  subtrees_filter = NULL,
  chapter_filter = NULL,
  use_flexisearch = FALSE,
  flat_results = NULL,
  highlighting_enabled = FALSE,
  properties_to_be_searched = NULL,
  language = "en",
  auto_update = TRUE
)

Arguments

token

(list) Access token to the API obtained from get_token()

text

The text component to search in ICD-11.

release

Release version as listed in https://icd.who.int/docs/icd-api/SupportedClassifications/#supported-classifications-and-versions the default is 2024-01.

linearization

(character) ICD-11 linearization (default = "mms"). See all linearizations in the WHO's API website https://icd.who.int/docs/icd-api/APIDoc-Version2/#the-icd11-linearizations

subtrees_filter

(string) Optional parameter. Vector of URIs. If provided, the search will be performed on the entities provided and their descendants

subtrees_filter_foundation_descendents

When a subtrees_filter is used the search looks at the linearization descendants of the entities in the subtrees_filter. If

subtrees_filter_foundation_descendents is set to TRUE, the search looks at the foundation descendants of the entities in the subtrees_filter. Default value: FALSE

include_keyword_result

Boolean. Optional parameter. If set to TRUE, the search result will also include keyword list. Default value: FALSE

chapter_filter

Vector of chapter codes e.g., c("01","02","21"). When provided, the search will be performed only on these chapters.

use_flexisearch

Boolean. Changes the search mode to flexible search. Default value: FALSE

flat_results

Boolean. Optional parameter. If set to true the search result entities are provided in a nested data structure representing the ICD-11 hierarchy. Default value: true.

highlighting_enabled

Boolean. Optional. If set to FALSE the search result highlighting is turned off. Default value: FALSE. Highlighting is in html format.

medical_coding_mode

Boolean. This mode is the default and should be used when searching the classification for medical coding purposes. Default value: TRUE.

properties_to_be_searched

String. The properties to be included in the search. Used only when medical_coding_mode=FALSE

language

(character) Language for the request. Available languages are listed in https://icd.who.int/docs/icd-api/SupportedClassifications/ the default is English (language = "en").

auto_update

Attempts to update token automatically

Value

A list of the coded information as well as any additional information.

Details

The icd11_search function allows you to search across different linearizations such as the Mortality and Morbidity Statistics linearization = "mms" (default) and the International Classifications of Functioning Disability and Health linearization = "icf".

Note

Both icd11_search() and icd11_search2() provide options for search. They correspond to two different API entry-points in the WHO's API and provide slighly different amount of information for the same result.

This provides the default search but might throw different amount of information as icd11_search2.

Examples

# Assuming that the CLIENT ID and CLIENT SECRET are set up. Substitute accordingly
if (exists("CLIENT_ID") & exists("CLIENT_SECRET")) {
  # Generated token
  token <- get_token(CLIENT_ID, CLIENT_SECRET)

  # Search for ICD-10 releases
  search_results <- icd11_search(token, text = "HIV stage 4")
}

# Assuming that the CLIENT ID and CLIENT SECRET are set up. Substitute accordingly
if (exists("CLIENT_ID") & exists("CLIENT_SECRET")) {
  # Generated token
  token <- get_token(CLIENT_ID, CLIENT_SECRET)

  # Search for ICD-10 releases
  search_results <- icd11_search2(token, text = "Cerebrovascular accident")
}
#> Error in search[["resultChopped"]]: object of type 'closure' is not subsettable