Learn R Programming

icd (version 2.2)

icd_get_valid: invalid subset of decimal or short_code ICD-9 codes

Description

Given vector of short_code or decimal ICD-9 codes, return (in the same format) those codes which are valid or invalid. Useful for generating error messages with the faulty codes if validation fails.

Usage

icd_get_valid(x, short_code = icd_guess_short(x))

# S3 method for character icd_get_valid(x, short_code = icd_guess_short(x))

# S3 method for icd9 icd_get_valid(x, short_code = icd_guess_short(x))

# S3 method for icd10 icd_get_valid(x, short_code = icd_guess_short(x))

# S3 method for icd10cm icd_get_valid(x, short_code = icd_guess_short(x))

Arguments

x

input vector of ICD codes

short_code

single logical value which determines whether the ICD-9 code provided is in short (TRUE) or decimal (FALSE) form. Where reasonable, this is guessed from the input data.

Methods (by class)

  • character: get valid ICD codes from character vector, guessing ICD version

  • icd9: Get valid ICD-9 codes

  • icd10: Get valid ICD-10 codes

  • icd10cm: Get valid ICD-10-CM codes