Health tech — Morocco

Tarifs TNR

What will actually be reimbursed.

Morocco's reference medical tariffs — 39 PDF grids and a 165-page nomenclature — parsed into one dataset with a search box in front of it.

Mandate
Research, data extraction, product
Role
Everything
Stack
Static HTML · vanilla JS · 404KB JSON
Live
tarifs.autokhalid.com ↗
The TNR tariff search tool
01 — In short

The short version

Where it startedThe answer existed, unreadably

Morocco publishes its reference tariffs. They are spread across 39 separate PDF grids plus a 165-page nomenclature from 2014. The information is public and effectively unusable — nobody is going to read a 165-page PDF to find out what a filling costs.

What I didParse it, then hide the parsing

I extracted every grid and the whole nomenclature into one dataset, then put a single search field in front of it. Type the act. Get the tariff.

Where it landed2,762 acts, one box

429 fixed-price acts and 2,333 coded ones, searchable in French, free, with no account and no backend.

02 — The project

Three decisions

01

Start from the source documents, not from somebody's copy

Every figure comes out of the official grids and the published nomenclature, extracted with layout preserved so the columns survive. A second-hand list would have been faster and would have aged badly the first time a grid changed.

That choice is also what makes it maintainable: when a grid is reissued, it goes through the same parser.

  • 39 official grids
  • Published nomenclature
  • Layout-preserving extraction
02

Two record types, because the data genuinely has two shapes

Some acts carry an exact price per sector — 429 of those. The rest are coded with a coefficient, and the price is that coefficient multiplied by a key value which is not printed in the document.

Pretending there was one shape would have meant inventing prices. Instead the interface shows the fixed ones directly and, for coded acts, lets you pick the key value and does the arithmetic in front of you.

  • 429 fixed-price acts
  • 2,333 coded acts
  • Sector toggle
  • Explicit key value
03

Make the search forgiving, because the source is not

The nomenclature is laid out three different ways across its pages. An earlier version of the parser silently missed every act whose description wrapped onto a previous line — which happened to be most of the dental work. Finding that meant reading the output against the PDF, not trusting the row count.

The section hierarchy each act sits under is folded into its search text, and everyday synonyms are injected, so searching the word people actually use finds acts filed under anatomical terms.

  • Three PDF layouts
  • Hierarchy as context
  • Synonym injection
  • French UI
03 — Under the hood

What it actually does

One search field

Type an act in plain French; results rank across both record types.

Sector toggle

Private or public — the tariff changes, the lookup does not.

Key-value picker

For coded acts, choose the key and watch the price resolve.

No backend

The whole dataset is a 404KB JSON file; the page does the rest.

Works offline-ish

One HTML file and one JSON file — nothing to go down.

Free, no account

No sign-up, no paywall, no tracking.

04 — The result

Where it landed

Coverage
2,762 acts — 429 with a fixed tariff, 2,333 coded — from the official sources.
Access
A lookup that took a 165-page PDF now takes one field and one word.
Honesty
Where the source does not state a price, the tool says so and shows the calculation instead of inventing a figure.
Cost to run
A static file behind nginx. No server, no database, no monthly bill.

Tariffs are reproduced from the published national references. The tool reports them; it does not set them.

TNR search results
Next project

Magazine Doua