Currently it offers:
- NHS number validation
- Unique random NHS number generation
steps for installing for dev purposes:
- clone the repo
- create a virtualenv (
python -m pyenv virtualenv 3.11.0 rcpch-nhs-numbers
) pip install -e .
Testing can be done from the command line in the root directory:
pytest
NHS numbers are complicated - they are always 10 digits long, do not start with a zero, and must fulfill the modulus 11 algorithm to be valid. This is explained here
Validation rules are needed in software though nowhere is this offered as an API or as a standardised module. There are several packages on pypi that offer it and there is currently a conversation across UK health tech to have one nhs-number package to rule them all.
This package is designed to be a conversation starter, not the definitive solution. It is a call to arms for NHS data enthusiasts to:
- Tweak and improve the versions offered here
- Begin a conversation about what other scope might be included (eg Scotland, Wales and NI)