HOME

TheInfoList



OR:

The National Health Index (NHI) number is the unique person identifier used within the New Zealand health system. It is technically not a number but rather an alphanumeric identifier consisting of 7 characters, with three letters and four numbers. It is often referred to as the NHI, although care must be taken when using this abbreviated term, because the NHI can also refer to the national collection of health care user demographic data (of which the NHI Number is the
unique identifier A unique identifier (UID) is an identifier that is guaranteed to be unique among all identifiers used for those objects and for a specific purpose. The concept was formalized early in the development of computer science and information systems ...
). The NHI Number, as part of the NHI was established in 1993.New Zealand Health Information Service
Retrieved 13 June 2007.


Usage

Primarily the NHI is used to identify individuals uniquely within the
New Zealand New Zealand ( mi, Aotearoa ) is an island country in the southwestern Pacific Ocean. It consists of two main landmasses—the North Island () and the South Island ()—and over 700 smaller islands. It is the sixth-largest island count ...
health system,New Zealand Health Information Service
http://www.nzhis.govt.nz/nhi/index.html NHI Number]. Retrieved 13 June 2007.
especially in electronic systems. An example of this is its use to alert health care providers using the Medical Warnings System (MWS) of risks associated with medical decision-making for specific patients.


Format

NHI number are in the format LLLNNNC, where L is a letter (excluding I and O), and N is a numeral, and C is a numeric
check digit A check digit is a form of redundancy check used for error detection on identification numbers, such as bank account numbers, which are used in an application where they will at least sometimes be input manually. It is analogous to a binary parity ...
. (e.g. ABC1235) The assignment of the first characters is arbitrary and bears no relationship to the individual to whom it is assigned. The NHI Number is most often represented with the alphabetic characters upper case. The format provides for 13,824,000 unique NHI numbers. NHI Numbers are often referred to as being valid or invalid. Any NHI Number that does not fit the correct format or that has an incorrect check digit is referred to as invalid. Usually reference to an NHI Number being valid or not does not indicate that it is correctly associated with the right individual. As the identifier is arbitrary there is no way to do this based solely on the identifier itself. Open-source packages are available to check the validity of NHI numbers: * R -
nhiValidator
* JavaScript -
nhi-validator
* Python -
python-nhi
The existing range is expected to be exhausted after 2025. In 2019, a revised standard introduced a new format of LLLNNLX, where X is an letter check digit (e.g. ABC12DV). The new format will be available for allocation from July 2022, and will provide an additional 33,177,600 unique NHI numbers. The two formats will co-exist indefinitely, and all administrative and clinical systems will need to support them both. All NHI numbers starting with Z are reserved for test purposes.


Duplicates

When it has been identified that an individual has been assigned more than one NHI Number, one is deemed to be the primary identifier. This is usually done by ranking all assigned numbers in alpha-numeric order and choosing the first one as the primary. All other NHI Numbers for the individual within the NHI are then linked to the primary one.


Check digit

There are two variants of the check digit algorithm to allow for the old NHI number format having a numeric check digit while the new format has an alphabetic check character. The change to using an alphabetic check digit was intended to resolve a previously identified weakness where simple single character transcription errors are not always detected by the old check digit scheme. The new algorithm implementation however creates a situation where collisions in the check-digit are much more likely to happen for simple single character transcription errors. For the new format, each alphabetic character is given a numeric value equal to its ordinal position within a version of the alphabet that omits the letters I and O. The ordinal range is 1–24. This gives A=1 and Z=24, for example. Each numeric character is used with its face value 0–9 in the calculation. Each character’s equivalent numeric value is then multiplied by its reverse ordinal position within the NHI number. The first value is multiplied by 7, the second by 6, the third by 5, the fourth by 4, the fifth by 3 and the sixth by 2. The sum of the six products is calculated. The calculated sum modulo 24 is subtracted from 24 to give an index number. If the index number is zero, then the NHI number is invalid and cannot be used. For the old format, the NHI Number contains a check digit. The algorithm for generating the digit is described below: Each alpha character is given a numeric representation equivalent to its ordinal position within the alphabet, starting at A through to Z. The letters I and O are omitted making the ordinal range 1 - 24. Each alpha character's numeric representation is multiplied by the inverse of its ordinal position within the NHI Number. The first value is multiplied by 7, the second by 6 and so on. The first 3 numeric characters are multiplied by the inverse of their ordinal position also. The sum of these multiplications modulus 11 subtracted from 11 is taken as the check digit (a result of 10 is translated to 0). This scheme is similar to the ISBN check digit scheme.


PHP code to calculate NHI validation for the old format

/** * @param $nhi_number The NHI number to validate * @return bool True if valid, false if not valid * @author some.one txample.com */ function validateNHINumber_old(string $nhi_number) : bool echo (int)validateNHINumber_old('DAB8233'); // 0 (invalid) echo (int)validateNHINumber_old('CGC2720'); // 1 (valid) echo (int)validateNHINumber_old('EPT6335'); // 1 (valid)


Excel formulae to validate NHI numbers in old, new, and both formats

These formulae require Excel version 2010 or later (or equivalent). The formulae assume input is alphanumeric and uppercase. Checks are made to confirm the string is 7 characters, letters "I" and "O" are not present, and that alphanumeric characters are in the correct places. The formulae return TRUE for a valid NHI or FALSE if not.


Old format

=AND(IF(LEN(A2)=7,TRUE,FALSE),NOT(ISNUMBER(FIND("I",A2))),NOT(ISNUMBER(FIND("O",A2))),ISTEXT(LEFT(A2,3)),IF(ISNUMBER(VALUE(RIGHT(A2,4))),11-MOD( 7*IF(ISERR(MID(A2,1,1)*1),IF(CODE(MID(A2,1,1))>79,CODE(MID(A2,1,1))-66,IF(CODE(MID(A2,1,1))>72,CODE(MID(A2,1,1))-65,CODE(MID(A2,1,1))-64)),MID(A2,1,1))+ 6*IF(ISERR(MID(A2,2,1)*1),IF(CODE(MID(A2,2,1))>79,CODE(MID(A2,2,1))-66,IF(CODE(MID(A2,2,1))>72,CODE(MID(A2,2,1))-65,CODE(MID(A2,2,1))-64)),MID(A2,2,1))+ 5*IF(ISERR(MID(A2,3,1)*1),IF(CODE(MID(A2,3,1))>79,CODE(MID(A2,3,1))-66,IF(CODE(MID(A2,3,1))>72,CODE(MID(A2,3,1))-65,CODE(MID(A2,3,1))-64)),MID(A2,3,1))+ 4*IF(NOT(ISERR(MID(A2,4,1)*1)),MID(A2,4,1))+3*IF(NOT(ISERR(MID(A2,5,1)*1)),MID(A2,5,1))+2*IF(NOT(ISERR(MID(A2,6,1)*1)),MID(A2,6,1)),11) =IF(NOT(ISERR(MID(A2,7,1)*1)), MID(A2,7,1)*1)))


New format

=AND(LEN(A2)=7,NOT(ISNUMBER(FIND("I",A2))),NOT(ISNUMBER(FIND("O",A2))),NOT(ISERR(MID(A2,4,2)*1)), 24 - MOD( 7*IF(ISERR(MID(A2,1,1)*1), IF(CODE(MID(A2,1,1))>79,CODE(MID(A2,1,1))-66,IF(CODE(MID(A2,1,1))>72,CODE(MID(A2,1,1))-65,CODE(MID(A2,1,1))-64)), MID(A2,1,1))+ 6*IF(ISERR(MID(A2,2,1)*1), IF(CODE(MID(A2,2,1))>79,CODE(MID(A2,2,1))-66,IF(CODE(MID(A2,2,1))>72,CODE(MID(A2,2,1))-65,CODE(MID(A2,2,1))-64)), MID(A2,2,1))+ 5*IF(ISERR(MID(A2,3,1)*1), IF(CODE(MID(A2,3,1))>79,CODE(MID(A2,3,1))-66,IF(CODE(MID(A2,3,1))>72,CODE(MID(A2,3,1))-65,CODE(MID(A2,3,1))-64)), MID(A2,3,1))+ 4*IF(NOT(ISERR(MID(A2,4,1)*1)),MID(A2,4,1))+ 3*IF(NOT(ISERR(MID(A2,5,1)*1)),MID(A2,5,1))+ 2*IF(ISERR(MID(A2,6,1)*1), IF(CODE(MID(A2,6,1))>79,CODE(MID(A2,6,1))-66,IF(CODE(MID(A2,6,1))>72,CODE(MID(A2,6,1))-65,CODE(MID(A2,6,1))-64)), MID(A2,6,1)),24) = IF(ISERR(MID(A2,7,1)*1), IF(CODE(MID(A2,7,1))>79,CODE(MID(A2,7,1))-66,IF(CODE(MID(A2,7,1))>72,CODE(MID(A2,7,1))-65,CODE(MID(A2,7,1))-64)),MID(A2,7,1)))


Both formats

=AND( LEN(A2)=7,NOT(ISNUMBER(FIND("I",A2))),NOT(ISNUMBER(FIND("O",A2))),NOT(ISERR(MID(A2,4,2)*1)), IF( ISERR(MID(A2,6,1)*1), 24 - MOD( 7*IF(ISERR(MID(A2,1,1)*1), IF(CODE(MID(A2,1,1))>79,CODE(MID(A2,1,1))-66,IF(CODE(MID(A2,1,1))>72,CODE(MID(A2,1,1))-65,CODE(MID(A2,1,1))-64)), MID(A2,1,1))+ 6*IF(ISERR(MID(A2,2,1)*1), IF(CODE(MID(A2,2,1))>79,CODE(MID(A2,2,1))-66,IF(CODE(MID(A2,2,1))>72,CODE(MID(A2,2,1))-65,CODE(MID(A2,2,1))-64)), MID(A2,2,1))+ 5*IF(ISERR(MID(A2,3,1)*1), IF(CODE(MID(A2,3,1))>79,CODE(MID(A2,3,1))-66,IF(CODE(MID(A2,3,1))>72,CODE(MID(A2,3,1))-65,CODE(MID(A2,3,1))-64)), MID(A2,3,1))+ 4*IF(NOT(ISERR(MID(A2,4,1)*1)),MID(A2,4,1))+ 3*IF(NOT(ISERR(MID(A2,5,1)*1)),MID(A2,5,1))+ 2*IF(ISERR(MID(A2,6,1)*1), IF(CODE(MID(A2,6,1))>79,CODE(MID(A2,6,1))-66,IF(CODE(MID(A2,6,1))>72,CODE(MID(A2,6,1))-65,CODE(MID(A2,6,1))-64)), MID(A2,6,1)),24) = IF(ISERR(MID(A2,7,1)*1), IF(CODE(MID(A2,7,1))>79,CODE(MID(A2,7,1))-66,IF(CODE(MID(A2,7,1))>72,CODE(MID(A2,7,1))-65,CODE(MID(A2,7,1))-64)),MID(A2,7,1)), 11 - MOD( 7*IF(ISERR(MID(A2,1,1)*1), IF(CODE(MID(A2,1,1))>79,CODE(MID(A2,1,1))-66,IF(CODE(MID(A2,1,1))>72,CODE(MID(A2,1,1))-65,CODE(MID(A2,1,1))-64)), MID(A2,1,1))+ 6*IF(ISERR(MID(A2,2,1)*1), IF(CODE(MID(A2,2,1))>79,CODE(MID(A2,2,1))-66,IF(CODE(MID(A2,2,1))>72,CODE(MID(A2,2,1))-65,CODE(MID(A2,2,1))-64)), MID(A2,2,1))+ 5*IF(ISERR(MID(A2,3,1)*1), IF(CODE(MID(A2,3,1))>79,CODE(MID(A2,3,1))-66,IF(CODE(MID(A2,3,1))>72,CODE(MID(A2,3,1))-65,CODE(MID(A2,3,1))-64)), MID(A2,3,1))+ 4*IF(NOT(ISERR(MID(A2,4,1)*1)),MID(A2,4,1))+ 3*IF(NOT(ISERR(MID(A2,5,1)*1)),MID(A2,5,1))+ 2*IF(NOT(ISERR(MID(A2,6,1)*1)),MID(A2,6,1)),11) = IF(NOT(ISERR(MID(A2,7,1)*1)), MID(A2,7,1)*1) ))


References


External links


Fourteen Years Young: A Review of the National Health Index in New Zealand
archived at https://web.archive.org/web/20120326144237/http://www.hinz.org.nz:80/journal/936
NHI Encryption Methods
{{National identification numbers Health care in New Zealand National identification numbers