Title: | Tools for Working with NHS Number Checksums |
---|---|
Description: | Provides functions for working with NHS number checksums. The UK's National Health Service issues NHS numbers to all users of its services and this package implements functions for verifying that the numbers are valid according to the checksum scheme the NHS use. Numbers can be validated and checksums created. |
Authors: | Mark Sellors [aut, cre, cph] |
Maintainer: | Mark Sellors <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2 |
Built: | 2024-10-16 02:45:03 UTC |
Source: | https://github.com/sellorm/nhsnumber |
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)
get_checksum(nhs_number, full_output = FALSE)
nhs_number |
A 9 digit NHS numbers to validate |
full_output |
Boolean that controls display of warning messages |
This function has been created using information from: https://en.wikipedia.org/wiki/NHS_number and various NHS sources
Checksum or the complete NHS number including the checksum.
get_checksum(123456788) get_checksum(123456788, full_output = TRUE)
get_checksum(123456788) get_checksum(123456788, full_output = TRUE)
NHS numbers are 10 digit numbers where the 10th digit is a checksum. This function validates the checksums of the supplied NHS numbers.
is_number_valid(nhs_number, warn = TRUE)
is_number_valid(nhs_number, warn = TRUE)
nhs_number |
A 10 digit NHS number to validate |
warn |
Boolean that controls display of warning messages |
is_valid(1234567881) is_valid(1234567890, warn = FALSE)
is_valid(1234567881) is_valid(1234567890, warn = FALSE)
NHS numbers are 10 digit numbers where the 10th digit is a checksum. This function validates the checksums of the supplied NHS numbers.
is_valid(nhs_number, warn = TRUE)
is_valid(nhs_number, warn = TRUE)
nhs_number |
A vector of 10 digit NHS numbers to validate |
warn |
Boolean that controls display of warning messages |
A logical vector indicating the validity of each input value
is_valid(1234567881) is_valid(c(1234567881, 1234512345, 123456789)) is_valid(1234567890, warn = FALSE)
is_valid(1234567881) is_valid(c(1234567881, 1234512345, 123456789)) is_valid(1234567890, warn = FALSE)