1 | # NHS Validation
|
2 | [![Testing](https://github.com/JoshWalshaw/NHS-Validation/actions/workflows/testing.yaml/badge.svg?branch=main)](https://github.com/JoshWalshaw/NHS-Validation/actions/workflows/testing.yaml)
|
3 |
|
4 | A package containing several validation tools useful for working with NHS or UK medical data.
|
5 |
|
6 |
|
7 | ## NHS Numbers
|
8 | This package allows you to validate if a string provided, has the potential to be a valid NHS Number - as well as generate an example NHS compliant number.
|
9 |
|
10 | NHS numbers follow a slightly modified version of [Modulus 11](https://www.loc.gov/issn/check.html) algorithm. Specific information on the format for the NHS can be found [here](https://en.wikipedia.org/wiki/NHS_number#Format).
|
11 |
|
12 | Current basic usage is as follows.
|
13 |
|
14 | ```js
|
15 | import { NHSNumber } from 'nhs-validation'
|
16 |
|
17 | const nhsNumber = NHSNumber.generate();
|
18 |
|
19 | console.log('Is valid? ', NHSNumber.validate(nhsNumber) ); // true
|
20 | console.log('Is valid? ', NHSNumber.validate('671 668 9966') ); // true
|
21 | console.log('Is valid? ', NHSNumber.validate('000 000 0001') ); // false
|
22 | ```
|
23 |
|
24 | ## Read / Clinical Codes
|
25 | TODO - Coming soon
|