chi_valid: Test for valid Community Health Index (CHI) number

Description Usage Arguments Value Examples

View source: R/chi.R

Description

Modulus 11 test on final digit to ensure CHI numnber is valid.

Usage

1
chi_valid(.data)

Arguments

.data

Character. A vector of CHIs as characters/strings.

Value

A logical vector with FALSE indicating a non-valid CHI.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(dplyr)
# These CHIs are not real.
chi = c("1009701234", "1811431232", "1304496368")

chi_valid(chi)
# From tibble
tibble(chi = chi) %>%
  mutate(
    chi_valid = chi_valid(chi)
  )

SurgicalInformatics/chiTools documentation built on Feb. 5, 2021, 8:28 p.m.