Learn R Programming

icd (version 3.3)

get_major.icd9: Get major part of an ICD code

Description

Returns major component of codes, i.e. the part before the decimal, or where the decimal would be.

Usage

# S3 method for icd9
get_major(x, short_code)

get_major(x)

# S3 method for icd10 get_major(x)

Arguments

Methods (by class)

  • icd9: Get major part of ICD-9 code, i.e. first three digits of numeric or V code, or first four digits of E code. This is the part before the decimal, when a decimal point is used.

  • icd10: Get major part of an ICD-10 code

Details

For ICD-10, this is an initial implementation. If speed needed, then can re-use C++ ICD-9 version: just grabbing the first three characters, after all, and this is much easier in ICD-10 then ICD-9