convert: Convert ICD9 codes between formats and structures.

Description Usage Arguments Value Structures used in this package are See Also

Description

ICD-9 codes are represented in short and decimal forms. The short form has up to 5 digits, or V or E followed by up to four digits. The decimal form has a dedcimal point to delimit the top-level (henceforth major) category, and the minor part containing the subsidiary classifications.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
icd9PartsToShort(parts)

icd9PartsToDecimal(parts)

icd9ShortToPartsCpp(icd9Short, minorEmpty)

icd9DecimalToPartsCpp(icd9Decimal, minorEmpty)

icd9DecimalToShort(icd9Decimal)

icd9ShortToParts(icd9Short, minorEmpty = "")

icd9DecimalToParts(icd9Decimal, minorEmpty = "")

Arguments

parts

data.frame with major and minor fields. This can be given instead of major and minor vectors

icd9Short

is a character vector of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010"

minorEmpty

vector of length one, to be used in place of minor part of zero. Defaults to ""

icd9Decimal

character vector of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010"

major

character vector of 'major' part of ICD-9 codes, i.e. that part which falls before the decimal point, in decimal notation. (In 5 digit notation, the 'major' part is be the first three characters (with leading zeroes), and includes V or E prefix. xyz

minor

character vector of 'minor' part of ICD-9 codes, i.e. that part which falls after the decimal point, in decimal notation. (In 5 digit notation, the 'major' part is be xyz, even when x and y are zero, thus the last two characters represent the 'minor' part, in this case.)

icd9

is a character vector or factor of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010".

isShort

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.

Value

Character vector or list. Deliberately returns zero-padded major, because otherwise we are creating ambiguous codes (even if we know what we mean)

Structures used in this package are

See Also

Other ICD-9 convert: icd9ChaptersToMap, icd9DropLeadingZeroes, icd9LongToWide, icd9WideToLong


jackwasey/icd9 documentation built on May 18, 2019, 7:57 a.m.