Skip to main content

A function to check strings against the New Zealand Ministry of Health NHI Validation Routine

Project description

NHI

Repository License PyPi

A function to check strings against the New Zealand Ministry of Health NHI Validation Routine. Supports the old and new NHI number formats specified in HISO 10046:2023.

Install

pip install python-nhi

Usage

from nhi import is_nhi

print(is_nhi("WLD9413"))  # True
print(is_nhi("zsc21tn"))  # True
print(is_nhi("zzZ0044"))  # False
print(is_nhi("ZZZ00AA"))  # False

Checks are case-insensitive.

Note: This does not check that the NHI number has been assigned to a person, it merely checks the NHI is consistent with the HISO 10046:2023 standard.

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:

from nhi import is_nhi

value = "zvb97xq"

print(is_nhi(value))  # True
print(not value.upper().startswith("Z") and is_nhi(value))  # False

Note: This check does not mean that the NHI number has been assigned to a person, it just means that the NHI value is not reserved for testing.

See Also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_nhi-1.2.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_nhi-1.2.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file python_nhi-1.2.1.tar.gz.

File metadata

  • Download URL: python_nhi-1.2.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for python_nhi-1.2.1.tar.gz
Algorithm Hash digest
SHA256 8a52a6a0cc744ac3b4bb5ae760552aba80772c4d56ecd8990886b3c000b371d1
MD5 0adc4207c5954d990db94dacbe938f97
BLAKE2b-256 27ad8c77a298994056819bca26295bc15ede8eea3a857f05e6af4486d2723335

See more details on using hashes here.

File details

Details for the file python_nhi-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: python_nhi-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for python_nhi-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1fd3eb48a845d5f0c355bfdc271f79d210b33e27d0f654b0e7e925fb3cf159ad
MD5 fb871969b40da3a5a92dda85282c7dd4
BLAKE2b-256 c6140c24fdbebba1c0de7fdf137a6b5e7faedcfb4b405939ec4962e459694b6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page