Learn R Programming

icd9 (version 1.1)

icd9IsReal: Check whether ICD-9 codes exist

Description

This is different from syntactic validity: it looks it up in the canonical list of ICD-9 codes published by the CMS, and which are included in this package under extdata. Checking syntactic validity using link{icd9IsValid} etc. is still useful, with a changing list of icd-9 codes over time, and possible imperfections in the master lists derived from CMS.

Usage

icd9IsReal(icd9, isShort = icd9GuessIsShort(icd9), majorOk = TRUE)

icd9IsRealShort(icd9Short, majorOk = TRUE)

icd9IsRealDecimal(icd9Decimal, majorOk = TRUE)

icd9GetReal(icd9, isShort = icd9GuessIsShort(icd9), majorOk = TRUE)

icd9GetRealShort(icd9Short, majorOk = TRUE)

icd9GetRealDecimal(icd9Decimal, majorOk = TRUE)

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.

majorOk

single logical, if TRUE will consider a three-digit code to be real, even though the majority of three-digit codes aren't billable (which is at present synonmous with 'realness').

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"

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"

Value

logical vector

Functions

  • icd9IsRealShort:

  • icd9IsRealDecimal:

  • icd9GetReal:

  • icd9GetRealShort:

  • icd9GetRealDecimal: