Skip to contents

Converts a vector of ICD procedure codes into a vector of Procedure Classes (for ICD-9) or Procedure Classes Refined (for ICD-10) using the HCUP's software

Usage

classify_pr(icd_pr)

Arguments

icd_pr

A vector of ICD-9-CM or ICD-10-PCS codes for procedures. You do not need to specify if the codes are ICD-9 or ICD-10.

Value

A vector of Procedure Classes, falling into one of four categories listed in the details section

Details

The HCUP classifies procedures into the following four categories:

  • Minor Diagnostic: Nonoperating room procedures that are diagnostic

  • Minor Therapeutic: Nonoperating room procedures that are therapeutic

  • Major Diagnostic: Procedures that are considered operating room procedures that are performed for diagnostic reasons

  • Major Therapeutic: Procedures that are considered operating room procedures that are performed for therapeutic reasons

Troubleshooting

This has not been tested extensively with ICD-9 codes in practice, so users experiencing difficulty may want to implement their own solutions. Please see ?hcup.data::proc_class_icd9 for the data used here, and use data(proc_class_icd9) to adjust to your needs.

See also

proc_class_icd10 and proc_class_icd9 in the hcup.data package for the datasets

Examples

classify_pr("00993ZX")
#> [1] "Minor Diagnostic"
classify_pr("0015")
#> [1] "Minor Therapeutic"

# Using the dplyr workflow
library(dplyr)
pt_data <- tibble(
  Patients = c("A",       "B",       "C"),
  ICD_10   = c("0PS443Z", "3E05305", "F13ZHZZ")
)

pt_data %>%
  mutate(pr_class = classify_pr(ICD_10))
#> # A tibble: 3 × 3
#>   Patients ICD_10  pr_class         
#>   <chr>    <chr>   <chr>            
#> 1 A        0PS443Z Major Therapeutic
#> 2 B        3E05305 Minor Therapeutic
#> 3 C        F13ZHZZ Minor Diagnostic 
if (FALSE) {
# Set of wrapper functions can be helpful for filtering
is_diagnostic_pr("F13ZHZZ")
is_major_pr("0PS443Z")

pt_data %>% filter(is_therapeutic_pr(ICD_10))
}