Skip to contents

icd10api() allows you to search the National Library of Medicine's ICD-10-CM API by code or associated term.

Usage

icd10api(
  icd_code = NULL,
  term = NULL,
  field = c("code", "both"),
  limit = 500L,
  ...
)

Source

National Library of Medicine/National Institute of Health

Arguments

icd_code

<chr> ICD-10-CM code containing 3 to 7 characters, excluding the dot

term

<chr> Associated term describing an ICD-10-CM code

field

<chr> code or both; default is code

limit

<int> API limit, defaults to 500. Note that the current limit on the total number of results that can be retrieved is 7,500.

...

Empty dots

Value

a tibble

Details

ICD-10-CM (International Classification of Diseases, 10th Revision, Clinical Modification) is a medical coding system for classifying diagnoses and reasons for visits in U.S. health care settings.

Note

Current Version: ICD-10-CM 2024

Examples

# Returns the seven codes beginning with `A15`
icd10api(icd_code = "A15")
#> # A tibble: 7 × 2
#>   icd_code icd_description                             
#>   <chr>    <chr>                                       
#> 1 A15.0    Tuberculosis of lung                        
#> 2 A15.4    Tuberculosis of intrathoracic lymph nodes   
#> 3 A15.5    Tuberculosis of larynx, trachea and bronchus
#> 4 A15.6    Tuberculous pleurisy                        
#> 5 A15.7    Primary respiratory tuberculosis            
#> 6 A15.8    Other respiratory tuberculosis              
#> 7 A15.9    Respiratory tuberculosis unspecified        

# Returns the first five codes
# associated with tuberculosis
icd10api(term = "tuber", field = "both", limit = 5)
#> # A tibble: 5 × 2
#>   icd_code icd_description                             
#>   <chr>    <chr>                                       
#> 1 A15.0    Tuberculosis of lung                        
#> 2 A15.4    Tuberculosis of intrathoracic lymph nodes   
#> 3 A15.5    Tuberculosis of larynx, trachea and bronchus
#> 4 A15.6    Tuberculous pleurisy                        
#> 5 A15.7    Primary respiratory tuberculosis            

# Returns the two codes
# associated with pleurisy
icd10api(term = "pleurisy", field = "both")
#> # A tibble: 2 × 2
#>   icd_code icd_description     
#>   <chr>    <chr>               
#> 1 R09.1    Pleurisy            
#> 2 A15.6    Tuberculous pleurisy

# If you're searching for codes beginning
# with a certain letter, you must set the
# `field` param to `"code"` or it will
# search for terms as well:

# Returns terms containing the letter "Z"
icd10api(icd_code = "z", limit = 5)
#> # A tibble: 5 × 2
#>   icd_code icd_description                                                      
#>   <chr>    <chr>                                                                
#> 1 Z00.00   Encounter for general adult medical examination without abnormal fin…
#> 2 Z00.01   Encounter for general adult medical examination with abnormal findin…
#> 3 Z00.110  Health examination for newborn under 8 days old                      
#> 4 Z00.111  Health examination for newborn 8 to 28 days old                      
#> 5 Z00.121  Encounter for routine child health examination with abnormal findings

# Returns codes beginning with "Z"
icd10api(icd_code = "z", field = "code", limit = 5)
#> # A tibble: 5 × 2
#>   icd_code icd_description                                                      
#>   <chr>    <chr>                                                                
#> 1 Z00.00   Encounter for general adult medical examination without abnormal fin…
#> 2 Z00.01   Encounter for general adult medical examination with abnormal findin…
#> 3 Z00.110  Health examination for newborn under 8 days old                      
#> 4 Z00.111  Health examination for newborn 8 to 28 days old                      
#> 5 Z00.121  Encounter for routine child health examination with abnormal findings

# Will error if results exceed API limit
try(icd10api(icd_code = "I", field = "both"))
#> Error in icd10api(icd_code = "I", field = "both") : 
#>   Your search returned 36874 results.
#>  The NLM ICD-10-CM API limit is 7,500.