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 decimal point to delimit the top-level (henceforth major) category, and the minor part containing the subsidiary classifications.
icd9PartsToShort(parts)icd9PartsToDecimal(parts)
icd9ShortToPartsCpp(icd9Short, mnrEmpty)
icd9DecimalToPartsCpp(icd9Decimal, mnr_empty)
data.frame with major and minor fields. This can be given instead of major and minor vectors
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"
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"
character vector of 'major' part of ICD-9 codes, i.e. that part which falls before the decimal point, in decimal notation. (In five digit notation, the 'major' part is be the first three characters (with leading zeroes), and includes V or E prefix.
character vector of 'minor' part of ICD-9 codes, i.e. that part which falls after the decimal point, in decimal notation. (In 'short' five digit notation, the 'major' part is the first three characters including leading zeroes which may be inferred; the last two characters represent the 'minor' part.)
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".
vector of length one, to be used in place of minor part of zero. Defaults to ""
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.
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:
vector (usually character vectors) of short or long codes
list, containing two elements with equal length vectors called
major
minor
. Yes, this is very like a data frame, but we do
not need the overhead of structuring it that way.
two vectors of separated major and minor parts
Other ICD-9 convert: icd9_chapters_to_map
,
icd9_drop_leading_zeroes
,
icd_long_to_wide
,
icd_wide_to_long