TaifCare — Autism Care Management System (ACMS)
A Full-Stack Arabic-First (RTL) Web & Mobile Platform with Standardized ABLLS-R / VB-MAPP Clinical Workflows, Two-Way Scheduling, and an Admin-Governed Bilingual AI Assistant.
Presentation Flow & Clear Engineering Ownership
Our full-stack graduation project spans five structured chapters backed by a live Apache + PHP 8.2 + MariaDB + Flutter deployment.
01. Problem & SOTA
Clinical motivation, 5 operational gaps, and comparative review of 6 platforms.
02. Design & DB
14 Use Cases (Admin AI arrow), UML Class, Split ERDs & 19 clean tables.
03. Admin (Maher)
Admin Portal: KPIs, 3-stage intake, staff CRUD, M:N caseloads & Parent PINs.
04. Specialist & AI (Najeeb)
ABLLS-R/VB-MAPP, IEP math, 2-way booking, AI Engine & Flutter API.
05. Parent (Abdullah)
6 pages: Live charts, Confirm/Decline, Home/Holiday tracking & Games.
Maher Al-Amri
Admin Portal Operations, 3-Stage Intake, Specialist Lifecycle, QA Analytics, M:N Caseloads & Parent PINs.
Najeeb Al-Turkmani
Specialist Portal (16 pages), Weighted IEP Engine, AI Assistant & Knowledge Governance, Security, 6 APIs & Flutter.
Abdullah Al-Khaibari
Parents Portal (6 pages), Live Charts, Two-Way Schedule UI, Daily/Holiday Home Logs, Alerts & Entertainment Games.
Five Operational Failures Solved by TaifCare
WHO estimates ~1 in 127 people globally are autistic (with Riyadh early-screening cohorts near 2.51%), yet regional clinics still run intensive ABA therapy on paper.
Eight Measurable Objectives & Clear Ethical Boundaries
| ID | Objective | Verified Deliverable |
|---|---|---|
| O1 | Normalized Arabic Schema | 19 InnoDB utf8mb4 tables; 956 skills |
| O2 | Admin Governance Portal | 14 Admin pages + AI Knowledge Manager |
| O3 | ABA Specialist Portal | 16 pages: ABLLS-R/VB-MAPP + AJAX IEP |
| O4 | Two-Way Scheduling | Pending → Confirm/Decline → Reschedule |
| O5 | Family Engagement Portal | 6 Parent pages + Home logs + Games |
| O6 | Governed Bilingual AI | Admin ai_config.json + Cohere v2 SSE |
| O7 | Mobile Companion | Flutter (6 Dart files) + 6 Bearer APIs |
| O8 | Defense-in-Depth Security | 174 prepared SQL, bcrypt, RBAC, lockout |
Two Explicit Clinical Boundaries
- Not Automated Diagnosis: Every mastery score records direct observation by a qualified specialist.
- Advisory AI Only: Grounded in clinic ABA protocols; prohibits medical diagnosis or medication changes (kb_policy_04).
Deliberately Scoped Exclusions
- Billing/insurance invoicing & video tele-therapy excluded to keep focus deep on clinical ABA workflows.
- Zero local LLM GPU weight training — external pre-trained model isolated behind 1 proxy file for future portability.
Comparative Review of Existing Clinic Platforms
Constructive evaluation of international ABA suites, general practice tools, and regional outpatient clinics — highlighting strengths and contextual gaps.
| Platform | Main Modules / Pages | Key Strengths | Contextual Shortcomings / Gaps | Arabic RTL & Cost |
|---|---|---|---|---|
| CentralReach | EMR, ABLLS-R/AFLS, billing, CR Mobile | Enterprise ABA depth; offline tablet capture | No documented Arabic RTL; quote-based seat tiers (+7% escalation); cloud abroad | LTR only • Enterprise SaaS |
| Catalyst / Ensora | Program setup, tablet runner, graphs | Fast discrete-trial capture & phase-change charts | Often paired with external PM tool; no Arabic parent portal or AI | LTR only • Opaque SaaS |
| Passage Health | Onboarding, programs, runner, claims | Modern unified clinical + scheduling UI | US insurance focus; lacks Arabic RTL & parent approval gate | LTR only • Quote cloud |
| SimplePractice / Cliniko | Calendar, client portal, generic notes | Polished UX; transparent per-seat pricing | No ABA skill hierarchies, prompt weights, or mastery rules | No Arabic • $49–99/mo |
| Regional Polyclinics | Reception queue, doctor notes, VAT | Native Arabic RTL; local compliance | General outpatient focus; lacks ABA curricula & caregiver AI | Arabic RTL • Commercial |
| TaifCare (ACMS) | Admin (14 incl. AI), Spec (16), Parent (6+Games+AI), Flutter | 100% Arabic RTL; ABLLS-R & VB-MAPP; 2-way approval; AJAX IEP; Admin-governed AI | Academic clinic scope (excludes billing/insurance & offline mobile sync) | 100% RTL • Self-hosted ($0/seat) |
Use Case Model (14 UCs) & Sequence Flows
Four Actors & Fourteen Principal Use Cases
- Administrator (6 UCs): Intake, staff, M:N caseloads, parent PINs, QA KPIs, plus UC-14: Manage AI Prompt & Knowledge (ai_config.json).
- Specialist (5 UCs): ABLLS-R/VB-MAPP, IEP plans, two-way booking/rescheduling, live IEP scoring, Flutter mobile analytics.
- Parent (3 UCs): Two-way Confirm/Decline, Progress/Home Tracking/Games, and UC-12: Query Bilingual AI Assistant.
- TaifCare AI Agent (2 UCs): Managed by Admin & queried by Parents via Cohere Chat API v2.
Domain Class Model, Split Crow's Foot ERDs & 19-Table Schema
Key Schema Design Decisions
- Granular Trial Storage: session_goal_data records raw prompt logs & trial counts — every chart computes dynamically.
- M:N Caseloads: child_assignments lets multiple clinicians co-manage one child without overwriting history.
- Immutable Master Bank: program_questions (956 items) is never mutated; custom wording lives in treatment_goals.custom_goal_name.
- Complete Data Dictionary: All 19 tables & 171 attributes documented in Appendix B and shipped in stripped autismdbSubmission.sql.
Modular 4-Tier Architecture & Unified Secure Gateway
Zero-License Open-Source Stack
- Server Stack: Apache 2.4 + PHP 8.2.12 + MariaDB 10.4 (utf8mb4) on Ubuntu Linux (ThinkPad T480, i7-8550U, 12 GB RAM, 512 GB NVMe).
- Web UI: HTML5/CSS3/Vanilla JS, Cairo Arabic RTL, Font Awesome 6, Chart.js 4 — zero Node bundler bloat.
- Mobile & AI: Flutter 3 (Dart) over 6 Bearer-token APIs + Cohere v2 isolated behind chatbot_api.php.
Admin Portal (1/2): Dashboard, Child Intake & Case Assignment
Central Operational Dashboard
- Live KPIs: Active Specialists, Mastered Goals, Active IEP Plans & Today's Sessions.
- 3 interactive Chart.js analytics: 7-day trend, top-5 specialist workload, and 6-month enrollment growth.
- Central command hub linking child intake (add_child.php), M:N case assignment (assign_case.php), and live daily operations.
Admin Portal (2/2): Add Specialist, QA, Parent PINs & Feedback
Specialist Onboarding (add_specialist.php)
- Registers clinician credentials into users (bcrypt hashed) and 1:1 clinical profile into specialists.
- Captures specialty (ABA, Special Ed, Speech), license number, years of experience, phone, email & validated CV upload (pdf/doc/docx/jpg/png).
- Enforces duplicate username/email checks via prepared statements before saving.
Admin AI Prompt & Clinic Knowledge-Source Manager
Live Governance (Admin/ai_settings.php)
- Instant Kill-Switch: Pause parent AI replies anytime with one checkbox.
- Parameter Control: Configure model, temperature (0.6), max_tokens (450), and bilingual system prompt.
- Zero Schema Bloat: Atomic UTF-8 JSON (includes/ai_config.json) + system_logs audit trail.
Inspect Active Clinic ABA Sources:
Specialist Portal: 1st Assessment, Create IEP & View Plan
End-to-End Clinical Pipeline
- 1st Pre-Assessment (run_session.php): Digital ABLLS-R (544 items) & VB-MAPP (412 items) with read-only history & daily closures.
- Create IEP (create_treatment_plan.php): Auto-loads failed skills & isolates custom wording in custom_goal_name.
- View & Migrate Plan (view_plan.php): Formal printable IEP report with live goal badges & one-click plan closure/migration.
Weighted Prompt-Fading vs. Strict Independent Mastery
Parents Portal: Charts, Alerts, Schedule, Feedback & Games
Live Progress (Zero Cross-Family Leakage)
- Active IEP completion bar, ABLLS-R / VB-MAPP mastery bar chart, goal doughnut & 10-session trend line.
- Privacy by Design: Resolves linked_child_id strictly from authenticated $_SESSION — never reads URL child_id.
- Direct quick-actions panel linking to Notifications, Schedule Approval, Daily Home Reports, Feedback & Games.
How All 3 Portals Link & Communicate in Real Time
Step 1 (Maher): Admin Creates the Trusted Link
Before any clinical session or message happens, Administration establishes both relational bridges:
- Links child ↔ multiple specialists in M:N child_assignments (assign_case.php / manage_assignments.php).
- Provisions the family account locked strictly to linked_child_id (admin_parents.php).
- Tracks center-wide live session status and QA metrics on admin_dashboard.php.
AI Assistant in Action: Verified Arabic & English Q&A
Example 1 — Grounded Arabic Query
Parent asked: كيف أهدئ طفلي عند نوبة غضب قبل النوم؟
- Returns 4 concise, empathetic ABA steps: calm voice, low-sensory safe space, visual bedtime cards, and logging observations in the daily home report.
- Directly grounded in Admin sources kb_meltdown_02 & kb_sleep_01.
Flutter Specialist App & Stateless Bearer-Token REST API
Flutter App (mobile_app/ — 6 Files, 1,625 LOC)
- 3 Arabic RTL Screens: Splash, Login (login_screen.dart), Dashboard (dashboard_screen.dart) using fl_chart & Provider.
- Zero Offline Patient Cache: Protects handset privacy over clinic LAN.
| Endpoint (api/) | Method | Purpose |
|---|---|---|
| auth_login.php | POST | Verifies bcrypt & issues 7-day 64-hex token |
| get_dashboard_stats.php | GET | Assigned caseload, today's sessions & mastery |
| get_goal_progress.php | GET | Per-goal mastery rates & statuses |
| get_weekly_sessions.php | GET | 7-day session distribution for fl_chart |
| get_recent_activity.php | GET | Recent clinical session feed |
| get_specialist_notes.php | GET | Clinician session summaries & notes |
Falsifiable Verification: 13/13 Live Tests & 15-Point Security Audit
Verified Security Controls (Appendix D)
| Password Storage | PASS | 100% bcrypt ($2y$); zero plaintext |
| SQL Injection Defense | PASS | 174 bound mysqli::prepare() queries |
| Brute-Force & Session | PASS | 5 fails → 30-min lockout; session_regenerate_id |
| Vertical & Horizontal RBAC | PASS | Role guards + strict session linked_child_id |
| AI Proxy Auth & Keys | PASS | HTTP 401 unauth; API key never reaches browser |
| CSRF (Internal Forms) | PARTIAL | Enforced on login.php; internal forms on roadmap |
| HTTPS / TLS | DEPLOY | LAN HTTP now; reverse-proxy TLS before public web |
Highlights of 13/13 Passed Live Tests
- TC-01–TC-04: Brute-force lockout, cross-role redirect, inactive account block & parent child scoping.
- TC-05–TC-07: ABLLS-R/VB-MAPP filtering, read-only history & non-destructive custom goal naming.
- TC-08–TC-09: Two-way Decline with reason → Reschedule → Confirm unlocking Start Session.
- TC-10–TC-11: 3× G (80% weighted) NOT mastered vs. 3× I (100% indep.) Mastered + confetti summary.
- TC-12–TC-13: Live grounded Arabic & English AI replies via SSE, mobile 401 recovery, and Admin AI Manager persistence + audit logging.
Verified Outcomes, Honest Limitations & Future Roadmap
Three Core Project Achievements
- Clinical Arithmetic Integrity: Replaces error-prone manual percentages with live AJAX trial scoring separating weighted prompt fading from strict independent mastery.
- Zero-Friction Family Handshake: Turns ad-hoc phone calls into an auditable Confirm / Decline-with-reason / Reschedule loop linked directly to session readiness.
- Governed Arabic Caregiver AI: Gives families 24/7 bilingual ABA support while keeping full control of instructions and clinic sources in the Administrator's hands.
Prioritized Production Roadmap
- 1. Security Hardening: Extend CSRF tokens across all authenticated internal POST forms & add Apache/Nginx HTTPS (TLS) termination.
- 2. Multi-Child Families & Local Assets: Add a parent_children junction table for siblings and bundle Chart.js/Font Awesome locally for air-gapped clinics.
- 3. Offline Mobile Sync & Vacation Reader: Add Flutter SQLite caching + specialist tab for vacation_tracking_reports.
- 4. Optional Local LLM & Clinical Pilot: Swap in an on-premises Arabic LLM via chatbot_api.php and run a 4-week IRB-governed clinic pilot.