chi_dob: Extract date of birth from Community Health Index (CHI)...

Description Usage Arguments Value Examples

View source: R/chi.R

Description

The Community Health Index (CHI) is a population register used in Scotland for health care purposes. The CHI number uniquely identifies a person on the index. Note 'cutoff_2000'. As CHI has only a two digit year, you need to specify whether year is 1900s or 2000s. The cut-off determines the year before that number is considered 2000s i.e. at cutoff_2000 = 20, "18" is considered 2018, rather than 1918.

Usage

1
chi_dob(.data, cutoff_2000 = 20)

Arguments

.data

Character. A vector of CHIs as characters/strings.

cutoff_2000

Integer. Two-digit year before which is considered 2000s.

Value

Vector of 'Dates'.

Examples

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

chi_dob(chi)

tibble(chi = chi) %>%
  mutate(
    dob = chi_dob(chi)
  )

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