Home Applications BRAINSAIT-LINC-FHIR

BRAINSAIT-LINC-FHIR Awaiting Review

InterSystems does not provide technical support for this project. Please contact its developer for the technical assistance.
0
0 reviews
0
Awards
3
Views
0
IPM installs
0
0
Details
Releases (1)
Reviews
Issues
This app has a demo View
BrainSAIT LINC FHIR is a fully integrated platform

What's new in this version

Initial Release

BrainSAIT Unified AI Agents for FHIR

InterSystems Programming Contest Submission β€” AI Agents for FHIR
πŸ† 12 Contest Tasks | 60/60 Bonus Points | FHIR R4 | NPHIES | Cloudflare Edge


πŸ“‹ Overview

BrainSAIT LINC FHIR is a fully integrated platform that unifies 9 LINC AI agents with 12 contest-ready AI agents for the InterSystems IRIS ecosystem. It provides a bilingual (Arabic/English) dashboard, Cloudflare Workers deployment, and ObjectScript production classes β€” all working together under a single MASTERLINC orchestrator.

Architecture

Client / Dashboard (React + shadcn/ui)
       β”‚
       β–Ό
  brainsait-api-gateway ──► JWT Β· CORS Β· Rate Limit
       β”‚
       β”œβ”€β”€ /api/agents/*        ──► 9 LINC Agent endpoints
       β”œβ”€β”€ /api/contest/*       ──► 12 Contest AI Agent endpoints
       β”œβ”€β”€ /api/fhir/*          ──► FHIR R4 resources
       β”œβ”€β”€ /api/compliance/*    ──► HIPAA/NPHIES audit
       └── /api/intersystems/*  ──► IRIS bridge
               β”‚
               β–Ό
  Cloudflare Workers (25 total)
       β”‚
       β–Ό
  InterSystems IRIS Production (BRAINSAIT namespace)
       β”‚
       β”œβ”€β”€ BrainSAIT.Production.MASTERLINC
       β”œβ”€β”€ BrainSAIT.Production.CLAIMLINC
       β”œβ”€β”€ BrainSAIT.Production.* (10 production classes)
       └── BrainSAIT.Contest.* (12 contest agent classes)

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • InterSystems IRIS for Health (Community Edition)
  • Cloudflare account (for Worker deployment)
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/Fadil369/brainsait-linc-fhir.git
cd brainsait-linc-fhir

Install dependencies

npm install

Start development server

npm run dev

Build for production

npm run build

IRIS Deployment

  1. Open IRIS Management Portal
  2. Import classes from intersystems/src/ and intersystems/src/contest/
  3. Import intersystems/module.xml via IPM
  4. Start the BrainSAIT.Production.MasterUnified production

Cloudflare Workers

# Navigate to wrangler config
cd wrangler

Deploy the unified worker

npx wrangler deploy

Deploy with environment

npx wrangler deploy --env production


πŸ† Contest AI Agents (12 Tasks Γ— 5 Bonus Points = 60)

# Agent Endpoint Bonus Feature FHIR Output
1 Smart Patient Summary Generator /api/contest/summary Role-tailored summaries (doctor/care manager/patient) DocumentReference
2 FHIR Prior Authorization Copilot /api/contest/prior-auth Missing evidence checklist Claim + Bundle
3 Gaps-in-Care Finder /api/contest/gaps-in-care Bilingual AI outreach (Arabic/English) DetectedIssue
4 Medication Safety Assistant /api/contest/medication-safety Patient counseling explanations Parameters
5 Care Plan Navigator /api/contest/care-plan Auto-create FHIR Task resources CarePlan + Task
6 Clinical Trial Matcher /api/contest/clinical-trials Missing criteria prompts Bundle
7 Readmission Risk Workbench /api/contest/readmission-risk Next steps as Tasks/CarePlans Parameters
8 Conversational FHIR Triage /api/contest/triage Coded FHIR Observations QuestionnaireResponse
9 Imaging Follow-Up Tracker /api/contest/imaging-followup AI clinician reminders ImagingStudy
10 Patient-Friendly Lab Explainer /api/contest/lab-explainer Educational content links Bundle + Observation
11 NL to FHIR Query Explorer /api/contest/nl-query Display generated FHIR/SQL queries Parameters
12 SDOH Community Referral /api/contest/sdoh-referral Vector Search semantic matching Bundle + Task

πŸ” Demo API Calls

# 1. Patient Summary (Doctor role)
curl "https://brainsait.io/api/contest/summary?patient=Patient/101&role=doctor"

2. Prior Authorization

curl "https://brainsait.io/api/contest/prior-auth?patient=Patient/101&service=99213"

3. Gaps in Care

curl "https://brainsait.io/api/contest/gaps-in-care?patient=Patient/101"

4. Medication Safety

curl "https://brainsait.io/api/contest/medication-safety?patient=Patient/101"

5. Care Plan Navigator

curl "https://brainsait.io/api/contest/care-plan?patient=Patient/101"

6. Clinical Trial Matcher

curl "https://brainsait.io/api/contest/clinical-trials?patient=Patient/101"

7. Readmission Risk

curl "https://brainsait.io/api/contest/readmission-risk?patient=Patient/101"

8. FHIR Triage

curl "https://brainsait.io/api/contest/triage?patient=Patient/101&symptoms=chest%20pain"

9. Imaging Follow-Up

curl "https://brainsait.io/api/contest/imaging-followup?patient=Patient/101"

10. Lab Explainer

curl "https://brainsait.io/api/contest/lab-explainer?patient=Patient/101"

11. Natural Language Query

curl "https://brainsait.io/api/contest/nl-query?q=Show%20me%20diabetic%20patients%20with%20HbA1c%20over%207"

12. SDOH Referral

curl "https://brainsait.io/api/contest/sdoh-referral?needs=food,transportation"


πŸ”§ LINC Core Agents

Agent Role FHIR Resources IRIS Class
MASTERLINC 🧠 Orchestrator Bundle, Task, MessageHeader BrainSAIT.Production.MASTERLINC
ClaimLinc πŸ“‹ NPHIES Claims Claim, ClaimResponse, Coverage BrainSAIT.Production.CLAIMLINC
RadioLinc πŸ”¬ DICOM / Lab ImagingStudy, DiagnosticReport BrainSAIT.Production.RADIOLINC
ComplianceLinc πŸ›‘οΈ HIPAA/NPHIES Audit AuditEvent, Consent BrainSAIT.Production.COMPLIANCELINC
ClinicalLinc βš•οΈ CDS Hooks v2 Condition, MedicationRequest BrainSAIT.Production.CLINICALLINC
HealthcareLinc πŸ₯ FHIR R4 Patient Patient, Encounter, Appointment BrainSAIT.Production.HEALTHCARELINC
TTLinc 🌐 Arabic/English Translation Basic, Parameters BrainSAIT.Production.TTLINC
ContextLinc πŸ“‚ RAG / OCR DocumentReference, Binary BrainSAIT.Production.CONTEXTLINC
DocuLinc πŸ“ Clinical Documentation Composition, DiagnosticReport BrainSAIT.Production.DOCULINC

πŸ—οΈ Project Structure

brainsait-linc-fhir/
β”œβ”€β”€ src/                          # React Frontend (shadcn/ui)
β”‚   β”œβ”€β”€ App.jsx                   # Main app with 6 tabs
β”‚   β”œβ”€β”€ main.jsx                  # Entry point
β”‚   β”œβ”€β”€ index.css                 # Tailwind CSS v4 config
β”‚   β”œβ”€β”€ data/                     # Data layer (agents, workers, flows)
β”‚   β”œβ”€β”€ components/               # UI components
β”‚   β”‚   β”œβ”€β”€ ui/                   # shadcn/ui primitives
β”‚   β”‚   └── *.jsx                 # Page-level components
β”‚   └── lib/                      # Utility functions
β”œβ”€β”€ wrangler/                     # Cloudflare Workers
β”‚   β”œβ”€β”€ wrangler.toml             # Worker configuration
β”‚   └── src/
β”‚       β”œβ”€β”€ index.js              # Router with 20+ endpoints
β”‚       └── agents/               # 12 contest agent handlers
β”œβ”€β”€ intersystems/                 # InterSystems IRIS
β”‚   β”œβ”€β”€ module.xml                # IPM package manifest
β”‚   └── src/
β”‚       β”œβ”€β”€ BrainSAIT.Production.* # 10 production classes
β”‚       β”œβ”€β”€ BrainSAIT.Audit.*     # HIPAA & NPHIES audit
β”‚       β”œβ”€β”€ BrainSAIT.Validation.*# Saudi National ID validator
β”‚       └── contest/              # 12 contest agent classes
β”œβ”€β”€ test/                         # Test suites
β”‚   β”œβ”€β”€ e2e.js                    # 417 E2E tests
β”‚   └── integration-audit.js      # 208 integration checks
└── package.json

πŸ§ͺ Testing

# Run all E2E tests (417)
npm test

Run integration chain audit (208)

node test/integration-audit.js

Both suites: 625 total checks, 0 failures


🌐 Bilingual Support

The entire platform is bilingual (Arabic/English):

  • Dashboard tabs, agent names, and descriptions
  • Gaps-in-Care outreach messages
  • Medication safety counseling
  • Lab result explanations (Grade 6 reading level)
  • Imaging follow-up reminders
  • SDOH referral descriptions

πŸ›‘οΈ Compliance

  • HIPAA: Audit logging via BrainSAIT.Audit.HIPAA β€” all agent calls logged
  • NPHIES: Saudi healthcare standards with National ID validation (checksum)
  • SMART on FHIR: OAuth2 with launch scopes
  • RBAC: Role-based access control via ComplianceLinc

πŸ“Š Dashboard

The React dashboard includes 6 tabs:

Tab Content
LINC Agents 9 agents with search, expand, health status
FHIR Flows 12 clinical workflows with NPHIES flags
πŸ† Contest 12 AI agents with scorecard (60/60 bonus pts)
CF Workers 24 workers with type filtering
InterSystems IRIS config, 25 production classes, ObjectScript sample
Unification Plan 4-phase roadmap with status tracking

πŸ“Ή Demo Video Script

Title: BrainSAIT β€” Unified AI Agents for FHIR

Duration: 3-4 minutes

Scene 1: Dashboard Overview (0:00-0:30)
Show the main dashboard with 6 tabs. Highlight the bilingual (Arabic/English) interface. Point out the 9 LINC agents and 24 CF Workers badges.

Scene 2: Contest Agents (0:30-1:30)
Navigate to the πŸ† Contest tab. Show the 60/60 bonus scorecard. Run 3 live API demos:

  • Patient Summary Generator with role=doctor
  • Gaps-in-Care Finder with bilingual outreach
  • Medication Safety with drug interactions

Scene 3: FHIR Integration (1:30-2:30)
Show the FHIR Flows tab. Demonstrate the 12 clinical workflows. Run the NL Query Explorer: β€œShow me diabetic patients with HbA1c over 7” β€” show the generated FHIR and SQL queries.

Scene 4: IRIS Architecture (2:30-3:30)
Navigate to the InterSystems tab. Show the 25 production classes. Display the MASTERLINC ObjectScript sample. Demonstrate how FHIR Task envelopes route between agents.

Scene 5: Wrap Up (3:30-4:00)
Show the test suite passing (417 E2E + 208 integration = 0 failures). Open source on GitHub. Call to action.


πŸ”— Links


πŸ‘₯ Team

  • Fadil369 β€” Lead Developer & Architect
  • Built for InterSystems Programming Contest: AI Agents for FHIR
  • 25 May – 14 June 2026

πŸ“„ License

MIT β€” Open source for the InterSystems community.

Donate
Version
1.0.007 Jun, 2026
Ideas portal
Category
Solutions
Works with
InterSystems IRIS
First published
07 Jun, 2026
Last edited
07 Jun, 2026