NHS numbers are 10 digit numbers where the 10th digit is a checksum. This function takes the 9 core digits of the NHS number and calculates the checksums.
get_checksum(nhs_number, full_output = FALSE)
A 9 digit NHS numbers to validate
Boolean that controls display of warning messages
Checksum or the complete NHS number including the checksum.
This function has been created using information from: https://en.wikipedia.org/wiki/NHS_number and various NHS sources
get_checksum(123456788)
#> [1] 1
get_checksum(123456788, full_output = TRUE)
#> [1] 1234567881