Saudi Arabia · NPHIES Compliant

AI-Powered Healthcare Claims
Intelligence Platform

Automate rejection triage, fraud detection, FHIR bundle construction, and human-in-the-loop escalation — all in one NPHIES-compliant platform.

Get Started View on GitHub 💬 Join Chat Space
5 Microservices
5 AI Agents (LINC)
85%+ Test Coverage
FHIR R4 Standard
NPHIES Integrated
Platform Capabilities

Everything you need for modern claims management

From intelligent rejection routing to real-time fraud detection and compliant FHIR submissions.

🤖

AI Rejection Triage

Automatically classifies and routes rejected claims across five rejection categories using business rules and ML agents.

🔐

PHI Security & Compliance

AES-256-GCM encryption, HMAC-SHA256 signing, PHI field masking, and RBAC — meeting MOH, PDPL, and HIPAA requirements.

📋

FHIR R4 Builder

Constructs compliant FHIR bundles for NPHIES claim submissions, appeals, and resubmissions.

🧠

Fraud Detection

Isolation Forest anomaly detection, duplicate billing checks, and heuristic fraud scoring per claim.

🔄

NPHIES Integration

Async HTTP bridge to Saudi Arabia's national health claims exchange with submission tracking.

👩‍⚕️

Human-in-the-Loop

Claims exceeding 10,000 SAR are automatically escalated to human reviewers via Google Chat.

📊

Google Workspace

Chat bot integration, real-time claim issue tracking, and space management for team collaboration.

n8n Automation

Low-code workflow orchestration for claim pipelines, notifications, and downstream integrations.

🌐

Vertex AI / Gemini

AI-powered clinical documentation assessment and outcome prediction via Google Cloud.

System Design

Microservices Architecture

Each component is independently deployable, containerised, and communicates over HTTP/FHIR.

Entry Point
SBS Landing:8005 — Intake & Routing
Processing Layer
Normalizer:8001
Signer:8002
Financial Rules:8003
NPHIES Bridge:8004 — FHIR Submission
NPHIES Saudi Arabianphies.sa — National Exchange
AI Agent Layer (LINC)
AuthLINCEligibility
ClinicalLINCDocumentation
ComplianceLINCRegulatory
FraudLINCAnomaly Detection
PredictiveLINCForecasting
Integrations
Google ChatHITL Escalation
Vertex AIGemini LLM
n8nWorkflow Automation
Service Reference

Microservices & API Endpoints

All services expose FastAPI Swagger UI at /docs and ReDoc at /redoc.

Service Port Endpoint Method Description
SBS Landing8005/processPOSTIntake, classify & route claims
/dashboardGETOperational status overview
/healthGETHealth check
NPHIES Bridge8004/submitPOSTSubmit FHIR bundle to NPHIES
/status/{claim_id}GETQuery NPHIES claim status
Financial Rules8003/classifyPOSTClassify rejection codes
Signer8002/signPOSTSign & encrypt FHIR bundles
Normalizer8001/normalizePOSTStandardise incoming claim data

Rejection Routing Logic

Rejection TypeConditionAction
AdministrativeRESUBMIT_NEW
Clinical DocumentationAPPEAL
Pre-AuthorizationCode starts with BE-1-4RESUBMIT_NEW
Pre-AuthorizationOther codesAPPEAL
Medication / DeviceAPPEAL
Policy LimitationFraud score > 0.7VOID
Policy LimitationFraud score ≤ 0.7APPEAL
Getting Started

Quickstart Guide

Be up and running in under 5 minutes with Docker Compose.

1

Clone the Repository

Get the source code from GitHub.

git clone https://github.com/Fadil369/MOH.git
cd MOH
2

Configure Environment

Create a .env file with your credentials.

NPHIES_API_URL=https://nphies-sandbox.sa/api
AES_KEY=<base64-encoded-32-byte-key>
HMAC_KEY=<your-hmac-secret>
GOOGLE_CLOUD_PROJECT=your-gcp-project
3

Start All Services

Spin up all five microservices with Docker Compose.

docker-compose up --build
4

Submit Your First Claim

Send a POST request to the SBS Landing service.

curl -X POST http://localhost:8005/process \
  -H "Content-Type: application/json" \
  -d '{
    "claims": [{
      "patient_id": "P-001",
      "provider_id": "PROV-100",
      "amount_sar": 15000.00,
      "rejection_code": "BE-1-4-1",
      "date_of_service": "2025-01-15",
      "preauth_id": "PA-2025-001"
    }]
  }'
5

Run the Test Suite

Verify everything is working with the built-in tests.

pip install -r requirements.txt
pytest
Security & Compliance

Built for Healthcare Data

Every layer is designed to protect PHI and meet Saudi Arabia's healthcare regulatory standards.

🔒

AES-256-GCM Encryption

All sensitive claim data encrypted at rest and in transit using authenticated encryption.

✍️

HMAC-SHA256 Signing

FHIR bundles are cryptographically signed to guarantee integrity before NPHIES submission.

🎭

PHI Masking

Patient IDs and names are automatically masked in all logs and API responses.

👥

Role-Based Access Control

Four built-in roles: Billing Admin, Clinical Reviewer, Compliance Officer, and Auditor.

RBAC Permissions Matrix

Role Read Claims Submit Claims Review Clinical Approve Appeal View Audit Log Check Compliance View Dashboard
billing_admin
clinical_reviewer
compliance_officer
auditor