icd9 (version 1.3.1)

icd9GetValid: invalid subset of decimal or short ICD-9 codes

Description

Given vector of short 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

icd9GetValid(icd9, isShort = icd9GuessIsShort(icd9))
icd9GetValidDecimal(icd9Decimal)
icd9GetValidShort(icd9Short)
icd9GetInvalid(icd9, isShort = icd9GuessIsShort(icd9))
icd9GetInvalidDecimal(icd9Decimal)
icd9GetInvalidShort(icd9Short)

Arguments

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.
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"
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"

Functions

  • icd9GetValidDecimal: Returns subset of codes which are in valid decimal format, e.g. "100" or "V01.10"
  • icd9GetValidShort: Returns subset of codes which are in valid short format, e.g. "E800" or "41001"
  • icd9GetInvalid: Returns subset of codes which are not in valid short or decimal format.
  • icd9GetInvalidDecimal: Returns subset of codes which are not in valid decimal format.
  • icd9GetInvalidShort: Returns subset of codes which are not in valid short format.