There are a number of different health identifiers in use throughout Australia, some for patients, some for doctors, some for organisations. Each identifier has its own particular use and rules around its format, with some more complex than others.
Good software will generally check the validity of field inputs where possible. For example, a field for an email address would normally check the format to ensure it is entered along the lines of something@something.something
, and in some cases may go further to ensure the domain component is a real component (curmi.com
versus curmi.con
, for example). Similarly, mobile number fields should check the number starts with 04
in Australia, and is 10 digits long.
In the same way, good health software in Australia should generally validate health identifier fields. This article outlines many of the health identifiers in use in Australia, their formats, and any checksums or other devices used to check validity. Hopefully this can serve as a resource to developers building quality healthcare software.
Australian Health Identifiers
If you find this article useful, please consider downloading my iPhone/iPad/Mac app Australian Health Identifiers in the Apple App Store. It’s a one-time purchase and provides an easy-to-use tool that can generate random format-valid identifiers as discussed here, as well as check identifiers for format-validity, all with a slick user interface. Useful for developers, but also useful to GPs and nurses needing to use demo health identifiers in software testing and demonstrations.
The Australian health identifiers I will detail here are as follows:
- Medicare Number
- Provider Number
- Prescriber Number
- Individual Health identifier (IHI)
- Health Provider Identifier for Individuals (HPI-I)
- Health Provider Identifier for Organisations (HPI-O)
- Department of Veterans’ Affairs File Number (DVA)
- AHPRA Registration Number
Medicare Number
The Australian Medicare Number is the most well-known health identifier in the country as it is a unique number provided to every Australian citizen for claiming health services under Medicare. Just about every person in the country has one.
The Medicare Number format consists of 10 digits and an Individual Reference number of the form:
- The first digit is in the range 2–6.
- The next 7 digits are in the range 0–9.
- The next digit is a checksum digit (see below).
- The next digit is the issue number (starting at 1; each time a card is replaced (expired/lost) this number is increased).
- The next digit is the Individual Reference Number (IRN) – a reference to the individual on the card.
Software will often only request the first 10 digits, and may require the IRN to be include separately or after a “/”.
The checksum digit is a simple algorithm that produces a digit based on the other numbers. This helps to reduce input errors by misreading a number or swapping digits as the checksum will be different in such cases indicating incorrect entry. The algorithm is as follows:
- Take each digit from the first 8 digits.
- Multiple them in turn using the following weights:
1, 3, 7, 9, 1, 3, 7, 9
. - The check digit is the sum of the weighted values modulo
10
.
For example, if the first 8 digits were 31899770
, then the check digit would be (3*1+1*3+8*7+9*9+9*1+7*3+7*7+0*9)%10 = 2
.
Good healthcare software should check the digits are in the range as above, there are 10 (plus an IRN if required), and that the check digit matches.
Provider Number
Medicare Provider Numbers are issued to GPs (doctors), Allied Health and other specialists. A provider has a unique provider number for every location they practice at, so may have multiple provider numbers.
Providers do not receive a physical card with their provider number, but for explanatory purposes I have created one to show the format of the Medicare Provider Number:
- The first 6 digits are in the range 0–9 (know as the provider stem).
- The next character is the practice location character, an alphanumeric character (0–9 and A–Z) excluding I, O, S and Z.
- The final character is the check character, one of A, B, F, H, J, K, L, T, W, X or Y (see below).
To calculate the check digit you first convert the location character to a Practice Location Value (PLV) – a number between 0 and 31. The conversion is according to the following table:
Location Character | PLV |
---|---|
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 8 |
9 | 9 |
A | 10 |
B | 11 |
C | 12 |
D | 13 |
E | 14 |
F | 15 |
Location Character | PLV |
---|---|
G | 16 |
H | 17 |
J | 18 |
K | 19 |
L | 20 |
M | 21 |
N | 22 |
P | 23 |
Q | 24 |
R | 25 |
T | 26 |
U | 27 |
V | 28 |
W | 29 |
X | 30 |
Y | 31 |
- Take each digit from the first 6 digits, followed by the PLV.
- Multiple them in turn using the following weights:
3, 5, 8, 4, 2, 1, 6
. - The check digit is the sum of the weighted values modulo
11
. - Convert the check digit to a check character using the following table.
Check Digit | Check Character |
---|---|
0 | Y |
1 | X |
2 | W |
3 | T |
4 | L |
5 | K |
6 | J |
7 | H |
8 | F |
9 | B |
10 | A |
As an example, if the first 6 digits are 486674
and the location character is Y
, then the PLV is 31
, the checksum is (4*3+8*5+6*8+6*4+7*2+4*1+31*6)%11 = 9
, and 9
maps to the check character B
.
Note that if a provider number is presented with 5 digits, you should add a 0 to the front before calculating the check character. It is likely some very early numbers were 5 digits before the government moved to 6 digits.
Prescriber Number
A prescriber number is a unique, 7-digit number that identifies a registered health professional as eligible to prescribe medication under the Pharmaceutical Benefits Scheme (PBS) in Australia. If you’ve ever been issued a prescription in paper form in Australia you’d likely see a prescriber number up the top near the prescriber’s name.
Providers do not receive a physical card with their prescriber number, but for explanatory purposes I have created one to show the (very simple) format of the number:
- The first 6 digits are in the range 0–9.
- The next digit is a checksum digit (see below).
There are actually two different algorithms for calculating the check digit.
If the first digit is 0
:
- Take each digit from the first 6 digits.
- Multiple them in turn using the following weights:
0, 5, 8, 4, 2, 1
. - The check digit is the sum of the weighted values modulo
11
.
If the first digit is not 0
:
- Take each digit from the first 6 digits.
- Multiple them in turn using the following weights:
1, 3, 7, 9, 1, 3
. - The check digit is the sum of the weighted values modulo
10
.
For example, if the stem was 084840
, the check digit would be (8*5+4*8+8*4+4*2+0*1)%11 = 2
. If the stem was 242573
, the check digit would be (2*1+4*3+2*7+5*9+7*1+3*3)%10 = 9
.
Note that the algorithm here is unclear in the case of a stem starting with 0
giving a remainder of 10
. For example, 012342
gives a check digit of 10
. The specification I have seen does not say what to do with the check digit in this case. Do you put an “A
“? Is the specification wrong and it should also use modulo 10? Does this never happen in the real world? If anyone knows, let me know and I’ll update the notes here.
Individual Health identifier (IHI)
The Individual Health identifier (IHI) is a unique 16 digit identifier assigned to all residents and others accessing healthcare in Australia. It is often used with My Health Record APIs, though most patients in Australia don’t even know this identifier exists.
Individuals do not receive a physical card with their IHI, but for explanatory purposes I have created one to show the format of the number:
- The first 6 digits are the issuer ID. This is the same for all IHIs, and is
800360
. - The next 9 digits identify the individual.
- The last digit is a check digit (see below).
The check digit is based on the Luhn formula modulus 10. This is the same formula used for check digits on credit cards. It is a little more complicated than others we have looked at previously:
- Start with the Issuer ID and the next 9 digits (so no check digit).
- Double every second digit starting at the second last. If the result of doubling a digit is > 9, subtract 9 from the result (or add the digits).
- Add together all the doubled digits and the ones that weren’t. Call this
s
. - The check digit is calculated by
(10 - s mod 10)) mod 10
.
Here is a Swift function that calculates the check digit. It is close enough to pseudo-code that any developer should be able to translate this to their favourite language:
func generateCheck(_ id:[Int]) -> Int { var check = 0 for count in 1...(id.count) { let digit = id[count - 1] if count%2 == 0 { check += digit } else { check += (Int((digit*2)/10) + (digit*2)%10) } } check = abs((10 - (check%10))%10) return check }
As an example, if our base is 800360790627904
, we do the following to find s
:
Base | 8 | 0 | 0 | 3 | 6 | 0 | 7 | 9 | 0 | 6 | 2 | 7 | 9 | 0 | 4 |
Double | 0 | 6 | 0 | 18 | 12 | 14 | 0 | ||||||||
Add double digits | 9 | 3 | 5 | ||||||||||||
Add All digits | 8 | 0 | 0 | 6 | 6 | 0 | 7 | 9 | 0 | 3 | 2 | 5 | 9 | 0 | 4 |
Adding the bottom row gives s = 8+0+0+6+6+0+7+9+0+3+2+5+9+0+4 = 59
. Finally, check digit is (59%10)%10 = 9
.
Health Provider Identifier for Individuals (HPI-I)
The Healthcare Provider Identifier for Individuals (HPI-I) is allocated by Medicare to healthcare providers and other health personnel involved in providing patient care. Like the IHI, it is often used with My Health Record API calls.
Providers do not receive a physical card with their HPI-I, but for explanatory purposes I have created one to show the format of the number:
- The first 6 digits are the issuer ID. This is the same for all HPI-Is, and is
800361
. - The next 9 digits identify the individual.
- The last digit is a check digit (see below).
The check digit is based on the Luhn formula modulus 10. See IHI above for an explanation of how this algorithm works to calculate the check digit.
Health Provider Identifier for Organisations (HPI-O)
The Healthcare Provider Identifier for Organisations (HPI-O) is allocated by Medicare to healthcare practices involved in providing patient care. Like the IHI and HPI-I, it is often used with My Health Record API calls.
Practices do not receive a physical card with their HPI-O, but for explanatory purposes I have created one to show the format of the number:
- The first 6 digits are the issuer ID. This is the same for all HPI-Os, and is
800362
. - The next 9 digits identify the individual.
- The last digit is a check digit (see below).
The check digit is based on the Luhn formula modulus 10. See IHI above for an explanation of how this algorithm works to calculate the check digit.
Department of Veterans’ Affairs File Number (DVA)
A Department of Veterans’ Affairs (DVA) file number is a reference number for veterans and dependents.
The DVA number will be 8 or 9 characters long. Individuals with this card may have 3 different coloured cards:
Veteran Gold Card: Allows access to clinically required treatment, pharmaceuticals, support, and services for all health conditions. Surviving partners and dependents may also be eligible for this card.
Veteran White Card: Allows access to clinically required treatment for specific health conditions related to the veteran’s service. White Card holders may be eligible for Veterans’ Home Care (VHC) services.
Veteran Orange Card: Allows access to clinically required pharmaceutical items for all medical conditions at a cheaper concession rate. To be eligible, veterans must have qualifying service from World War I or World War II, be at least 70 years old, and have been a resident of Australia for at least 10 years.
The DVA number itself will be 8 or 9 characters long, and the card will look similar to the following:
- The first character is a state identifier from the following values:
State Identifier | State |
---|---|
N | New South Wales (including ACT) |
S | South Australia (including Northern Territory) |
W | Western Australia |
T | Tasmania |
V | Victoria |
Q | Queensland |
- The War Code characters optionally follow the state identifier (for WW1, no code is used). War Codes are valid from the following list:
War Code | War Name |
---|---|
World War I | |
A | Allied Forces |
AGX | Act of Grace 1939 |
BUR | Burma |
BW | Boer War |
CGW | Commonwealth Gulf War |
CIV | Civilians |
CN | Canadian Forces 1914 |
CNK | Canada Korea/Malaya |
CNS | Canada Special Overseas Service |
CNX | Canadian Forces 1939 |
FIJ | Fiji |
GHA | Ghana |
GW | Australian Gulf War |
HKS | Hong Kong (SP Eligibility) |
HKX | Hong Kong 1939 |
IND | India |
IV | Indigenous Veteran 1939 |
KM | Korea-Malaya |
KYA | Kenya |
MAL | Malaya-Singapore |
MAU | Mauritius |
MLS | Malaysia – Singapore SP Eligibility |
MTX | Malta 1939 |
MWI | Malawi |
N | New Zealand 1914 |
NF | Newfoundland |
NG | New Guinea Civilian War Pension |
NGR | Nigeria |
NK | New Zealand Korea-Malaya |
NRD | Northern Rhodesia |
NSM | New Zealand Serving Members |
NSS | New Zealand Special Overseas Service |
NSW | New Zealand Merchant Navy |
NX | New Zealand 1939 |
P | British Pension 1914 |
PAD | British Admiralty Pension |
PAM | British Air Ministry Pension |
PCA | Governments and Administration |
PCR | British Service Department – CRO |
PCV | British Pension Civilian |
PK | British Korea/Malaya |
PMS | British Merchant Seaman 1914 |
PSM | British Serving Members |
PSW | British Merchant Seaman 1939 |
PWO | British War Offices Pension |
PX | British Pension 1939 |
Q | Query |
RD | Southern Rhodesia 1914 |
RDX | Southern Rhodesia 1939 |
SA | South African Forces 1914 |
SAX | South African Forces 1939 |
SL | Sierra Leone |
SM | Serving Member |
SR | Far East Strategic Reserve |
SS | Special Overseas Act |
SUD | Sudan |
SWP | Seamans War Pension 1939 |
TZA | Tanganyika (Tanzania) |
X | Australian Forces 1939 |
ZZ | Zanzibar |
- The numeric file number follows the War Code (or the State ID where no War Code exists) and consists of up to 6 numeric characters.
- The dependency indicator is the last item of the DVA number. It consists of a single alphabetic character (or space where no dependency exists).
- There is NO check digit in this identifier.
Keep in mind when validating this identifier that others wars may have been added to the list above (and will, unfortunately, be added in the future). You should be able to determine that the identifier appears to be in a valid format if it has 1–3 characters for the War Code, even if you can’t recognise the code.
AHPRA Registration Number
The Australian Health Practitioner Regulation Agency (AHPRA) Registration Number is a unique identifier for health practitioners in Australia.
The AHPRA Registration Number consists of 3 letters and 10 digits and is of the form:
- The first 3 letters represent the health profession, according to the following table:
Health Profession Code | Health Profession |
---|---|
ATS | ATSI Health Practice |
CMR | Chinese Medicine |
CHI | Chiropractic |
DEN | Dental |
MED | Medical |
MRP | Medical Radiation Practice |
NMW | Nursing and Midwifery |
OCC | Occupational Therapy |
OPT | Optometry |
OST | Osteopathy |
PHA | Pharmacy |
PHY | Physiotherapy |
POD | Podiatry |
PSY | Psychology |
- The following 10 digits identifier the individual within that profession.
- There is NO check digit in this identifier.
Final Words
I hope this resource was useful and helps all of us to build better healthcare software in Australia. And if you have any corrections, please send them to me for inclusion.
And finally, if you want a really easy way to generate or test these identifiers when building your own software, or when using test data in your practice, or you just want to thank me for putting together this resource, take a look at my app below.
All the best.
Jamie
Australian Health Identifiers
If you find this article useful, please consider downloading my iPhone/iPad/Mac app Australian Health Identifiers in the Apple App Store. It’s a one-time purchase and provides an easy-to-use tool that can generate random format-valid identifiers as discussed here, as well as check identifiers for format-validity, all with a slick user interface. Useful for developers, but also useful to GPs and nurses needing to use demo health identifiers in software testing and demonstrations.
Nice work Jamie. Very detailed