Free 30-minute AI & automation audit with a senior engineer. You keep the notes. Book yours

Use case · Health insurance

Mapping hospital service catalogues to clinical codes, with reviewers in the loop

A mapping engine, hospital onboarding portal and LLM contract-rules extraction that turn messy hospital price lists into auditable, coded data for an insurer.

Client details are kept confidential. This use case describes the problem and what we built.

The brief

A health insurer working with a growing network of hospitals and clinics needed to standardise how it receives and understands provider data. Every hospital submitted its own service catalogue, and every insurer contract carried its own rules. All of it had to be turned into coded, structured data before claims could be assessed consistently.

We built a set of cloud services around this. A deterministic mapping engine handles catalogue lines and a reviewer workflow handles the uncertain ones. An LLM pipeline pulls payer rules out of contracts, and portals give both the insurer’s team and hospital administrators a shared view of onboarding.

The challenge

What needed solving

Every hospital names services differently

Each hospital sends its own service catalogue and price list, in its own wording and format. Before claims can be checked, every line has to be matched to the insurer's canonical clinical code list.

Mapping must be explainable

A wrong code means a wrong payout. The insurer needed the same input to give the same answer every time, with evidence behind each mapping, not a black-box guess.

Payer rules are buried in contracts

Coverage rules, pre-authorisation requirements and mandatory checks sit inside long insurer contracts and forms that staff had to read by hand.

Onboarding hospitals was slow

Registering a provider, collecting its documents and tracking integration status ran on email and spreadsheets, with no single view for the internal team.

The solution

What we built

  1. Deterministic mapping engine

    A FastAPI service matches catalogue lines with rule-based detectors, classical retrieval over a pgvector index and calibrated probabilities. There is deliberately no LLM in the mapping path, so results are repeatable and every mapping carries its evidence.

  2. Reviewer service for uncertain items

    Low-confidence mappings go to a review queue where clinical reviewers confirm or correct them. Every state change lands in an append-only audit log.

  3. Hospital portal and internal console

    A hospital-facing React portal covers registration, checklists, master-list upload and a sandbox. An internal console shows the onboarding pipeline, blockers, engine output, review work and analytics.

  4. LLM extraction of payer rules

    A Celery worker watches a document inbox, splits contracts and pre-auth forms into sections, extracts rules with an LLM and merges them into structured records in PostgreSQL, including flags for missing mandatory checks.

  5. Secure, multi-provider mailbox ingestion

    A separate service reads hospital mailboxes with the owner's consent across Gmail, Microsoft 365 and IMAP providers. Each credential is sealed with AES-256-GCM under its own data key.

  6. Platform services on Azure

    Schema-per-service PostgreSQL, Keycloak single sign-on behind an API gateway with rate limiting and audit, and Spring Boot services for user access, MFA and reinsurance. Everything runs as containers on Azure, with infrastructure written as code.

The outcome

What changed

Auditable mappings

Each catalogue line is mapped deterministically with traceable evidence. Humans review only the items the engine is unsure about.

Contracts become data

Payer rules that used to live in PDFs are now structured records that downstream claim-verification services can query.

One view of hospital onboarding

Internal teams and hospital admins work from the same pipeline instead of email threads.

Technology used

  • Python
  • FastAPI
  • PostgreSQL
  • pgvector
  • Celery
  • RabbitMQ
  • Redis
  • React
  • Vite
  • Java
  • Spring Boot
  • Keycloak
  • Docker
  • Azure Container Apps
  • Terraform
  • Bicep

Have a similar problem to solve?

Share a few lines about your project. A senior engineer — not a salesperson — replies within one business day.

Free AI audit Let’s talk