2.1.0 • Published 9 months ago

nhi-validator v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

nhi-validator

Build Status CodeQL MIT License NPM Version NPM Bundle Size

Checks a string against the New Zealand Ministry of Health NHI Validation Routine. Supports the old and new NHI number formats specified in HISO 10046:2023.

Getting Started

npm install nhi-validator
import {validateNHI} from 'nhi-validator'

validateNHI('WLD9413') // => true
validateNHI('zsc21tn') // => true
validateNHI('zzZ0044') // => false
validateNHI('ZZZ00AA') // => false

Checks are case-insensitive.

Excluding Testcases

NHI numbers that begin with Z are reserved for testing. If you wish to exclude these values, you will need to manually check for a Z prefix:

import {validateNHI} from 'nhi-validator'

let value = 'zvb97xq'

validateNHI(value) // => true
!value.toUpperCase().startsWith('Z') && validateNHI(value) // => false

License

nhi-validator is available under the MIT License.

Contact

Eli Lamb - elilambnz
James Ansley - James-Ansley

See Also

Acknowledgments

Derived from python-nhi written by James Ansley.

Disclaimer

This repository contains NHI numbers provided in examples and tests, however, no identification with actual persons (living or deceased) is intended. If you believe that an NHI number that belongs to a real person has been included in this repository, please get in contact to remove it.

Contributing

If you're interested in contributing, please read our contributing docs before submitting a pull request.

2.1.0

9 months ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

2.0.0

1 year ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago