Product notes

How a health record should hold Nigeria’s new postcode.

We built a free, open-source package that lets health software keep Nigeria’s new building codes and share only as much of an address as each use needs.

On 1 October NIPOST gave every building in Nigeria an 11-character postcode. A code like “EK 01 A03 FK 01” reads state, local government area, district, area, building. It belongs to the building, not to the person living there, and anyone can look theirs up free at postcode.gov.ng.

In the first week Kayode Adeniyi wrote about AI agents passing a location to each other and published tools for it, and Kaivoc Digital Health Hub asked what health could build on top. So I wanted to take that discussion into the patient record, where a visiting nurse may need the building code or an outreach report may need only a broader area; we built health-postcode to help developers build applications that represent that difference and record what has actually been checked.

What we built

health-postcode is a free, open-source package for anyone building health software in Nigeria. It does two things.

It cuts the code down to what each use needs. The code is a ladder: cut it short and you zoom out.

  1. State: EK, here Ekiti.
  2. LGA: EK 01, one local government area.
  3. District: EK 01 A03, a district.
  4. Area: EK 01 A03 FK, a patch of at most 99 building codes.
  5. Building: EK 01 A03 FK 01, one building.

Each use gets only the rung it needs:

  • A dashboard or an AI tool gets the district.
  • An outbreak signal gets the area, as counts.
  • The nurse visiting today gets the building.
  • A text message to a patient carries no code at all.

It stores the code one way. Health systems pass records to each other in a standard format called FHIR. The package adds a field to it that carries the code, how precise it is, and whether NIPOST confirmed the building, so the location means the same thing when a record moves from a clinic to a lab, an HMO or the state. An OpenMRS template does the same for the registration screen in clinics that use OpenMRS.

It also keeps “checked” honest. NIPOST confirming that a building exists is not the same as the patient living there now, or a visit being appropriate. The record keeps those apart, and a failed lookup is never saved as a “no”.

The effect

  • Developers stop reinventing the rules. Instead of every EMR, lab or community health app deciding on its own how much of an address to show, the cut is one function call anyone can read and review.
  • Location can be shared without exposing homes. Dashboards, AI tools and research exports get a district, not a front door.
  • Records keep their meaning as they travel. A referral, a claim or a lab request carries the same code, at a stated precision, on both sides.

The opportunities

  • Finding people after they stop coming. A study of the HIV programme at Lagos University Teaching Hospital found 56% of a cohort lost to follow-up, with inaccurate or missing contact details among the reasons patients could not be traced. A checked building code gives the visiting team a clearer destination than a landmark.
  • Seeing a cluster early. Nigeria already has case reporting through SORMAS and digital vaccination records at NPHCDA. Counting cases by area, and sharing the signal at district level, adds street-level detail without a new system.
  • Care closer to home. The same LUTH study names distance as the most common reason people stopped attending. A clinic that knows where a patient lives can offer follow-up nearer home, the way the OnTIME dashboard maps travel time to emergency obstetric care for whole populations.
  • Beyond Nigeria. Ghana has GhanaPostGPS, Kenya’s National Addressing Bill is before parliament, and India launched DIGIPIN. The ladder and the record format work for any address code that nests like this one; a new country needs a new parser, not a new idea.

Where Pisgah fits

Pisgah runs hospitals, pharmacies and laboratories from one record. Today it stores a patient’s state, LGA, town and typed address. The postcode field at registration, the NIPOST check and the ladder for reports and visit lists are the next release, built on this package. We published the rules first so they can be reviewed before they are relied on.

Issues and pull requests are welcome, especially from anyone running OpenMRS or a community health programme.

health-postcode is open source under the MIT licence. Pisgah publishes the rules it intends to follow so they can be reviewed before they are relied on.

Open source

Use the package.

Zero dependencies, Node 18 and up, FHIR R4 artifacts included.

View on GitHub
All articles