
Initial Release
An autonomous, pre-payment payment integrity agent running natively on InterSystems IRIS for Health. ClaimAuditAI intercepts FHIR Claim submissions in the request lifecycle, analyzes them through a three-tier AI reasoning engine, and holds suspicious transactions for human review.
Author: Mainza Kangombe β LinkedIn
Learn more about the business motivation and technical architecture of ClaimAuditAI:
ClaimResponse records, review Task resources, and provider CommunicationRequest notifications atomically.%SYS namespace access required. Supports Keycloak RS256 JWKS for federated OIDC. Numeric role hierarchy (ViewerβAuditorβSpecialistβDirectorβAdmin) gates all protected endpoints.ChatHistory tables. Provider-agnostic LLM routing supports NVIDIA, Ollama, and OpenAI backends (openai==2.41.0, httpx>=0.28.1). SSE streaming with 300s nginx timeout.^ClaimAuditLedger) provide a reliable, date-indexed audit trail of override decisions.ClaimAuditAI integrates InterSystems IRIS for Health with an Embedded Python runtime and a React/TypeScript frontend.
[ Submitted Claim ]
β
βΌ
ββββββββββββββββββββββββββββββββ
β InterSystems IRIS FHIR App β
β (FHIR Interceptor Hooks) β
ββββββββββββββββ¬ββββββββββββββββ
β (Atomic Transaction Bundle)
βΌ
ββββββββββββββββββββββββββββββββ
β tier_orchestrator β
β (Sequential Engine Runner) β
ββββββββ¬ββββββββ¬ββββββββ¬ββββββββ
β β β
β β βββββββββββββββββββββββββββββββ
βΌ (Timeout & Circuit Breaker) βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Tier 1: NLP β β Tier 2: ML β βTier 3: Graph β
β (HNSW Vector β β (PyTorch AE β β (NetworkX β
β Similarity) β β Anomaly Loss)β β Collusion) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
OnBeforeRequest & OnAfterRequest)The Interactions.cls class intercepts incoming requests for single Claim submissions or batch Bundle submissions. If a claim is flagged by the three-tier AI reasoning engine:
transaction Bundle to write:
ClaimResponse with outcome set to queued (HOLD status) and custom billing code/threat level extensions.Task routed to the practitioner queue.CommunicationRequest hold notification.202 Accepted alongside the created hold ClaimResponse resource.
tier_orchestrator.py)AI evaluation runs within the database memory space using Embedded Python, running sequentially to ensure thread-safety and database integrity in InterSystems IRIS:
Tier 1 (NLP Similarity): Cosine similarity between claim descriptions and progress notes via sentence-transformers in nlp_auditor.py. Flags when best_similarity < 0.38 β CPT codes semantically distant from clinical documentation.
Tier 2 (ML Autoencoder Anomaly): autoencoder_train.py trains an unsupervised PyTorch Autoencoder (5 input dimensions β 4 bottleneck). Reconstruction loss threshold is max(95th_percentile, 0.02) β the 0.02 floor prevents false negatives with homogeneous training data. Requires β₯5 training claims; tier gracefully bypasses (not-flagged) when data is insufficient.
Tier 3 (Collusion Networks): graph_analyzer.py builds a MultiDiGraph of patient-provider relationships. Detects address collisions, geo-temporal leaps, and referral ring cycles. Graph cache is invalidated after each claim audit. Exception handler is fail-open β errors flag the claim for review, never silently suppress.
Risk Scoring: Tier 1 (+0.35) + Tier 2 (+0.35) + Tier 3 (+0.30), capped at 1.0. Score stored as FHIR ClaimResponse extension β the single source of truth read by all endpoints. Classification: β₯0.86βcritical, β₯0.50βhigh, elseβmedium.
The system enforces strict role-based access control (RBAC) across both API and database layers:
^ClaimAuditAI("Users",...)) β avoiding %SYS namespace access for CSP gateway requests. Tokens validated with $SYSTEM.Encryption.HMACSHA(256, ...) signature verification. Supports Keycloak RS256 JWKS for federated OIDC.JWT_SECRET environment variable required in production mode β raises a critical security error if missing.$Roles dependency on IRIS process identity.
/api and /interop/fhir/r4) run under tightened MatchRoles parameters (:%DB_INTEROP-CODE:%DB_INTEROP-DATA:%Admin_Secure) instead of matching %All permissions.llama3.2:3b-instruct-fp16 (6.4 GB) or granite4.1:3b-bf16 (6.8 GB)) accessible from the container..env file.git clone https://github.com/mainza-ai/ClaimAuditAi.git
cd ClaimAuditAi
cp .env.example .env
# Edit .env: set LLM_PROVIDER (ollama/nvidia/openai), API keys, and JWT_SECRET
docker compose up -d --build
docker exec -it claimaudit-iris iris session IRIS "##class(ClaimAudit.REST.Router).LoadSampleData()"
Open http://localhost:3000 to access the dashboard.
auditor / AuditReview2026!admin / ClaimAuditAdmin2026!For system administrators and operations teams, ClaimAuditAI provides dedicated configuration portals to configure LLM reasoning providers and inspect component health:
All protected endpoints require an Authorization: Bearer <token> header:
| Method | Path | Access | Purpose |
|---|---|---|---|
POST |
/api/auth/login |
Public | Authenticates credentials and returns a signed JWT |
POST |
/api/auth/introspect |
Public | SMART on FHIR token validation (RFC 7662) |
GET |
/api/stats |
Protected | Aggregated hold, complete, and value metrics |
GET |
/api/claims/held |
Protected | Paginated active hold queue |
GET |
/api/claims/:id |
Protected | Detailed claim JSON with AI reason summaries |
POST |
/api/claims/:id/approve |
Director+ | Approve override (writes to ledger, completes task) |
POST |
/api/claims/:id/reject |
Director+ | Reject claim (sets outcome to error, cancels task) |
POST |
/api/claims/:id/escalate |
Auditor+ | Progresses task status (Specialist -> Director) |
GET |
/api/ledger |
Protected | Paginated override audit ledger log |
GET |
/api/graph |
Protected | Cytoscape network graph data |
GET |
/api/stats/model-performance |
Protected | AI model precision/recall/F1 metrics |
POST |
/api/chat |
Protected | AI audit assistant (provider-agnostic LLM) |
POST |
/api/chat/stream |
Protected | SSE streaming chat response |
GET/POST |
/api/settings/llm |
Admin | Query or update runtime LLM provider settings |
POST |
/api/samples/load |
Admin | Clears tables and re-seeds synthetic FHIR data (8 claims with diversified risk) |
Comprehensive verification suites validate both client and server layers.
pytest)Contains 23 test cases verifying NLP calculations, PyTorch training/inference anomaly outputs, NetworkX network cycles, and tier_orchestrator circuit breakers:
# Inside the container (or local environment with virtualenv)
pytest src/python/tests/ -v
Vitest)Runs 18 test cases checking React components, rendering states, and Zustand stores:
cd ui
npm run test
To verify the complete payment integrity workflow against the live, dockerized application services from the host, execute the E2E script:
# From the project root on the host machine
.venv/bin/python scratch/real_world_e2e_tests.py
This automated script executes a full transaction verification suite:
director, specialist) via the Admin API.Seeding LLM bypass to prevent HTTP connection timeouts).Playwright)Simulates user behavior covering login, sidebar routing, sample data seeding, and hold queue approval cycles:
cd ui
npm run test:e2e
A GitHub Actions workflow (ci.yml) automates quality gates on every push/PR:
eslint, tsc --noEmit)The following slideshow walks through the business motivation, technical architecture, and implementation details of ClaimAuditAI. Click to expand and view the slides.
Released under the MIT License.