uk-fci / nhs-number

Python package to provide utilities for NHS Numbers, including validity checks, normalisation, and generation.
https://nhs-number.uk-fci.tech/
MIT License
4 stars 6 forks source link

'Geovalidation' #5

Closed pacharanero closed 1 year ago

pacharanero commented 1 year ago

This feature was suggested by @andylaw and would enable the nhs_number.is_valid(nhs_number) function to be passed an optional parameter that will enable it to only return True if the number is valid for the region selected.

I would propose an optional validation_region name in the is_valid function, which if present constrains the validation further so that if the number is numerically (Modulo11 check digit) valid, but is from a different region, then the function would return False (not valid)