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] "2396756966"
nhs_5 <- generate_nhs(5) print(nhs_5)
#> [1] "5214861621" "3192581336" "2736417666" "3928117696" "2676573152"