is_valid_major: Test whether an ICD code is major

View source: R/valid.R

is_valid.defaultR Documentation

Test whether an ICD code is major

Description

Codes without real or implied decimal place return TRUE

Usage

## Default S3 method:
is_valid(x, short_code = guess_short(x), ...)

is_valid_major(x, whitespace_ok = TRUE)

## Default S3 method:
is_valid_major(x, whitespace_ok = TRUE)

## S3 method for class 'icd9'
is_valid_major(x, whitespace_ok = TRUE)

## S3 method for class 'icd10'
is_valid_major(x, whitespace_ok = TRUE)

icd9_is_valid_major_n(x, whitespace_ok = TRUE)

icd9_is_valid_major_v(x, whitespace_ok = TRUE)

icd9_is_valid_major_e(x, whitespace_ok = TRUE)

Arguments

x

vector of ICD codes

Value

logical vector of same length as input, with TRUE when a code is a major (not necessarily a real one)

Methods (by class)

  • default: Test whether an ICD code is of major type, which at present assumes ICD-9 format. Converts to character than calls is_valid.character

  • default: Test whether an ICD code is of major type, either ICD-9 or ICD-10

  • icd9: Test whether an ICD-9 code is of major type.

  • icd10: Test whether an ICD-9 code is of major type.


jackwasey/icd documentation built on Dec. 22, 2024, 4:47 a.m.