Generate random codes that fit the NHS number formatting specification. This is useful when generating synthetic patients or testing the varification functions.

generate_nhs(size = 1)

Arguments

size

the number of codes you wish to generate

Value

a character vector of length size with NHS Numbers

Examples

nhs_1 <- generate_nhs() print(nhs_1)
#> [1] "4695582759"
nhs_5 <- generate_nhs(5) print(nhs_5)
#> [1] "5264239673" "5696521487" "6162319253" "8133273641" "1766392814"