Skip to content

Locales Overview

The --locale flag controls three things for every generated resource:

  1. Which identifier systems are used (e.g. NHS Number, Aadhaar, BSN)
  2. Which address format is applied (street order, postal code pattern, country code)
  3. Which name pool is drawn from (culturally appropriate given and family names)

All identifier values pass their country’s validation algorithm before being included in output. The fhir-test-data locales command returns the same data programmatically.

CodeCountryPatient identifiersPractitioner identifiersOrganisation identifiers
usUnited StatesSSN, MRNNPI (Luhn)NPI (Luhn)
ukUnited KingdomNHS Number (Mod 11)GMC Number, GMP NumberODS Code
auAustraliaIHI (Luhn), Medicare Number (Mod 10)HPI-I (Luhn)HPI-O (Luhn)
caCanadaOntario Health Card NumberCPSO/Provincial Licence
deGermanyKVID-10LANR (Mod 10)BSNR, IKNR
frFranceNIR (Mod 97)RPPS (Luhn)FINESS
nlNetherlandsBSN (11-proef)UZI NumberAGB-Z Code
inIndiaAadhaar (Verhoeff), ABHA NumberNMC Registration
jpJapanJapanese Hospital Patient IDJMPC Physician Registration
krSouth KoreaRRN (weighted sum mod 11)Medical Licence Number
sgSingaporeNRIC / FIN (NRIC check letter)SMC Registration
brBrazilCPF (Mod 11 two-digit check)CRM
mxMexicoCURPCédula Profesional
zaSouth AfricaSA ID Number (Luhn)HPCSA Registration

Each identifier definition includes a system URI. These are the URIs embedded in FHIR Identifier.system fields in generated resources. See individual locale pages for the full list.

Algorithms used across locales:

AlgorithmUsed for
LuhnUS NPI, AU IHI, AU HPI-I, AU HPI-O, FR RPPS, ZA ID Number
Modulus 11UK NHS Number
VerhoeffIN Aadhaar
11-proef (Modulus 11 variant)NL BSN
Modulus 97FR NIR
Modulus 10AU Medicare Number, DE LANR
RRN weighted sum mod 11KR Resident Registration Number
NRIC check letterSG NRIC / FIN
CPF two-digit checkBR CPF

Check-digit implementations live in src/core/generators/check-digits.ts. They are shared across locales and are tested against known-valid examples.