Liking cljdoc? Tell your friends :D
Clojure only.

com.eldrix.concierge.nhs-number


format-nnnclj

(format-nnn nnn)

Formats an NHS number for display purposes into 'XXX XXX XXXX'

Formats an NHS number for display purposes into 'XXX XXX XXXX'
sourceraw docstring

valid?clj

(valid? nnn)

Validate an NHS number using the modulus 11 algorithm. An NHS number should be 10 numeric digits with the tenth digit a check digit. The validation occurs thusly:

  1. Multiply each of the first nine digits by a weighting factor (digit 1:10, 2:9, 3:8, 4:7, 5:6, 6:5, 7:4, 8:3, 9:2)
  2. Add the results of each multiplication together
  3. Divide total by 11, establish the remainder
  4. Subtract the remainder from 11 to give the check digit
  5. If result is 11, the check digit is 0
  6. If result is 10, NHS number is invalid
  7. Check remainder matches the check digit, if it does not NHS number is invalid
Validate an NHS number using the modulus 11 algorithm.
An NHS number should be 10 numeric digits with the tenth digit a check digit.
The validation occurs thusly:
1. Multiply each of the first nine digits by a weighting factor (digit 1:10, 2:9, 3:8, 4:7, 5:6, 6:5, 7:4, 8:3, 9:2)
2. Add the results of each multiplication together
3. Divide total by 11, establish the remainder
4. Subtract the remainder from 11 to give the check digit
5. If result is 11, the check digit is 0
6. If result is 10, NHS number is invalid
7. Check remainder matches the check digit, if it does not NHS number is invalid
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close