API and FHIR
All endpoints are JSON over HTTPS and scoped to the signed-in user's hospital (tenant). Sessions are HttpOnly, Secure, SameSite=Strict cookies; writes also require a same-site Origin. Every write is checked against the role rules and the safety rules on the server, and recorded in the audit log.
Session
/api/startCreate a private hospital workspace with synthetic data and sign in. Body {"role": "coder" | "manager" | "physician" | "finance"}. Limited per network.
/api/roleIn a hospital workspace, switch to a colleague's role.
/api/meUser, role, hospital and the working date.
Before sending
/api/prebillUnsent claims with the value at risk and the rules that would deny them.
/api/claims/{id}Claim, note with coded evidence spans, checks (for unsent claims) or the denial case, approvals, history and audit. The patient appears as initials and record number.
/api/claims/{id}/codeCode the note. {"ai": true} adds the language model; each suggestion must quote the note exactly and pass the negation and injection checks, or it is returned under rejected with the reason.
/api/claims/{id}/fixApply one check's fix ({"index": n}) or every safe fix ({"all": true}). Coders and managers only.
/api/claims/{id}/submitSend to the insurer once. Duplicates and late claims are refused with the violated rule.
Autopilot
/api/autopilotThe manager's policy, the queue and recent runs.
/api/autopilot/policyManager only. Which administrative fixes may run unattended, auto-send and auto-resubmit, and the model-risk ceiling for sending. Clinical changes cannot be enabled.
/api/autopilot/start · /api/autopilot/stepStart a run, then work up to four claims per step. Each result carries the outcome (sent, resubmitted, or routed to a coder, doctor or manager) and the step-by-step trace.
Front desk and payments
/api/frontdeskNext week's bookings and what was found for each.
/api/frontdesk/{id}/prepareCheck eligibility, request prior approvals from the insurer, and estimate the patient's share.
/api/paymentsRemittances reconciled against approved amounts: totals, per-insurer days to pay, and the exceptions (underpaid, not paid, paid twice).
/api/payments/{claim}Manager or finance: raise a dispute, chase a missing payment or return an overpayment, with the letter drafted.
/api/modelThe denial-risk model's version and test metrics. Each unsent claim in /api/claims/{id} carries its risk and the factors behind it.
Denials
/api/worklistOpen denials ranked by expected recovery weighted by deadline, with the proposed action and who must approve it.
/api/claims/{id}/decide{"decision": "approve" | "reject"}. Records the caller's approval; when every required role has approved, the action runs (resubmit, rebill, appeal, withdraw, bill patient, write off) after the safety rules are checked again.
Insights
/api/insightsTotals, root causes by insurer × department × reason, open denials by deadline, and rules learned from denials.
/api/learned/{id}A manager approves or rejects a learned rule; approval re-checks unsent claims and re-triages open denials.
/api/auditThe hospital's audit log.
FHIR R4
Shaped the way NPHIES exchanges them; profile and code-system URLs are placeholders.
/fhir/Claim/{id}Diagnoses (ICD-10), items, approvals (preAuthRef), attachments and care team.
/fhir/ClaimResponse/{id}Per-item adjudication with denial reasons.
/fhir/CoverageEligibilityResponse/{id}Whether the billed policy was in force on the date of service.
{
"resourceType": "Claim", "id": "CLM-000206", "status": "active", "use": "claim",
"insurer": { "display": "Sanabel Insurance" },
"diagnosis": [{ "sequence": 1, "diagnosisCodeableConcept": { "coding": [{ "system": "http://hl7.org/fhir/sid/icd-10", "code": "M51.1" }] } }],
"insurance": [{ "sequence": 1, "focal": true, "coverage": { "reference": "Coverage/COV-12" }, "preAuthRef": ["PA-SANB-40031"] }],
"item": [{ "sequence": 2, "productOrService": { "coding": [{ "code": "PRC-205", "display": "MRI lumbar spine" }] }, "net": { "value": 2900, "currency": "SAR" } }]
}