# ClinicalRIS — Complete Platform Reference & Architecture Guide ## 1. System Overview ClinicalRIS (https://clinicalris.com) is a modern cloud-native Radiology Information System (RIS) and zero-footprint Web Picture Archiving and Communication System (PACS). Designed for imaging centers, multi-hospital health systems, teleradiology reading groups, and patient second opinion workflows, ClinicalRIS eliminates traditional on-premise hardware overhead, VPN requirements, and client desktop software. The platform is accessible worldwide via HTTPS from standard modern browsers (Google Chrome, Microsoft Edge, Mozilla Firefox, Apple Safari) on macOS, Windows, Linux, iPadOS, iOS, and Android. It includes native Progressive Web App (PWA) installation with offline caching and background service worker synchronization. --- ## 2. Technical Architecture ### 2.1 Front-End Layer - **Framework**: Next.js 15 (React 19, TypeScript 5) with App Router. - **Styling**: Tailwind CSS with clinical dark and light themes, Radix UI accessible primitives, and Lucide clinical icons. - **Diagnostic Viewing**: Integrated dual-engine viewer: - **OHIF Viewer v3**: Primary clinical diagnostic viewer with multi-viewport layouts (1x1, 2x1, 1x2, quad 2x2, 3x3), synchronized window/level (Hounsfield presets for bone, lung, brain, soft tissue), crosshairs, reference lines, Cobb angle, length, elliptical ROI measurements, and DICOM SR presentation states. - **VolView 3D MPR**: WebAssembly-accelerated VTK.js rendering engine executing true 3D Multi-Planar Reconstruction (orthogonal axial, sagittal, coronal views), maximum/minimum intensity projection (MIP/MinIP), spline vessel centerline curved planar reformation (CPR), Agatston coronary calcium scoring, and GPU volume rendering. - **Streaming Decoders**: WebAssembly-compiled OpenJPEG and CharLS workers executing concurrent client-side slice decoding. GPU texture caching prevents scrubbing stutter on massive 2,000+ slice CT and MRI series. ### 2.2 Ingestion & PACS Backend Layer - **Orthanc DICOM Server**: Highly optimized DICOM C-STORE and DICOMweb archive (WADO-RS, QIDO-RS, STOW-RS). - **Two-Door Ingestion Architecture**: - **Door 1 (Direct TLS Push)**: DICOM modalities (GE, Siemens, Philips, Canon) push standard DICOM C-STORE over TLS directly to assigned Application Entity Titles (AET). - **Door 2 (Zero-Firewall Stream Relay)**: For clinics and satellite imaging centers behind strict corporate firewalls, NATs, or dynamic IPs without port-forwarding permissions. An outbound-only lightweight relay container streams DICOM instances directly to the cloud PACS over encrypted WebSocket/HTTPS without opening inbound ports. - **Web Drag-and-Drop Ingestion**: Zero-install web uploader supporting individual `.dcm` files, entire study folders, and ZIP archives with automated tag validation, patient matching, and de-identification. ### 2.3 Application & Data Layer - **Database**: PostgreSQL 16 with Prisma ORM and multi-tenant schema partitioning. - **Caching & Ephemeral Sessions**: Redis 7 for real-time pub/sub notifications, worklist locks, and active stack streaming caches. - **Speech & AI Intelligence**: - Local AI Whisper container for real-time voice dictation with specialized radiological vocabulary. - LibreTranslate container providing offline, HIPAA-compliant on-the-fly translation across 5 languages (English, Spanish, French, Portuguese, Arabic). - **Security Guard**: Dedicated network policy container managing kernel-level DOCKER-USER firewall chains, brute-force rate limiting on SSH (2222) and DICOM Relay (11104), and multi-tenant isolation. --- ## 3. Clinical Roles & Operational Workflows ### 3.1 Super Administrator (`super_admin`) - Multi-facility tenant governance, license tier allocations, and storage limits. - DICOM AET routing, PACS modalities configuration, and server health telemetry. - User verification, credential vetting, mandatory 2FA enforcement, and HIPAA audit trail logs. - Platform-wide regional pricing, currency exchange management, and global announcement banners. ### 3.2 Facility Administrator (`center_admin`) - Center operational cockpit, scanner suite scheduling, and intake queues. - Center branding studio: upload custom light/dark logos, custom PDF report letterheads, brand color themes, and medical director cryptographic signature stamps. - Radiologist fee schedules, commission allocations, and physician referral tracking. - Multilingual support ticket tracking and patient satisfaction telemetry. ### 3.3 Radiologist (`radiologist`) - Clinical diagnostic worklist with urgency badges (STAT < 1 hour, URGENT, ROUTINE). - Blinded reading mode: patient demographic details de-identified during interpretation to prevent diagnostic bias. - Side-by-side diagnostic reporting editor with PACS viewports. - Hand-free voice dictation with automatic punctuation and medical terminology macros. - AI preliminary findings import with one-click acceptance or editing. - Digital report sign-off with cryptographic hash stamping and automatic PDF generation. - Radiologist finance & earnings portal: commission tracking, case logs, and automated payouts. ### 3.4 Technologist (`technologist`) - Drag-and-drop web DICOM upload for incoming scans. - Study QA: tag verification, series re-ordering, study split/merge, and repeat-view tracking. - Modality worklist pairing and real-time dispatch to radiologist reading pools. ### 3.5 Referring Physician (`ref_physician`) - Electronic imaging orders with clinical indications, prior history, and ICD-10/CPT codes. - Live case progression tracking (Ordered → Checked In → Scanned → In Review → Finalized). - Zero-footprint web viewer access to review studies directly from clinic or mobile device. - Immediate automated notification and secure report retrieval upon sign-off. ### 3.6 Front Desk & Reception (`clerk` / `receptionist`) - Rapid patient demographic registration and identity verification. - Modality check-in, real-time waiting room queue status, and arrival alerts to technologists. - Calendar appointment scheduling across MRI, CT, X-Ray, Ultrasound, and Mammography suites. ### 3.7 Billing Specialist (`billing`) - Examination invoice generation, fee collections, and insurance pre-authorizations. - Support for credit cards, bank wire transfers, electronic invoices, and regional mobile money (MTN Mobile Money, Telecel Cash, M-PESA). ### 3.8 Patient Portal (`patient`) - Confidential access via expiring cryptographic tokens (`/portal/[token]`). - Instant mobile-friendly image inspection with basic measurements and zoom/pan. - Downloadable signed PDF diagnostic reports. - One-click PWA installation on iOS and Android devices. --- ## 4. Online Radiology Second Opinion Service ### 4.1 How It Works Patients worldwide can request an independent expert second opinion on their medical imaging: 1. **Examination Selection**: Select imaging modality (Brain MRI, Spine CT, Chest X-Ray, Mammogram, Abdominal Ultrasound) and urgency tier (STANDARD 24–48h or STAT < 1h). 2. **Transparent Regional Pricing**: Upfront fee calculation adjusted by fair regional purchasing power multipliers with zero hidden fees. 3. **Secure DICOM Upload**: Drag and drop DICOM files or upload a single ZIP archive through a private upload link. 4. **Subspecialist Assignment**: Cases are routed to credentialed, board-certified subspecialists (e.g. Neuroradiology, Musculoskeletal, Thoracic, Pediatric) with in-country priority. 5. **Report Delivery**: Comprehensive, patient-friendly second opinion report delivered securely with downloadable PDF and side-by-side key image annotations. --- ## 5. Security, Privacy & Regulatory Compliance - **HIPAA & HITECH**: Compliant with 45 CFR Parts 160 and 164 standards for electronic Protected Health Information (ePHI). - **SOC 2 Type II**: Certified for Security, Availability, and Confidentiality. - **Encryption**: - Data at rest: AES-256 encrypted storage volumes. - Data in transit: Mandatory TLS 1.3 encryption across all web, API, and DICOM endpoints. - **Authentication**: Role-based access control (RBAC), mandatory hierarchical two-factor authentication (TOTP authenticator apps and WebAuthn/FIDO2 biometric passkeys), and automated account lockouts after repeated failed attempts. - **De-Identification & Blinded Reading**: Automatic stripping of direct patient identifiers from DICOM tags for teleradiology reading pools to ensure objective interpretation and HIPAA safe harbor de-identification. - **Audit Logging**: Immutable, tamper-evident audit logs capturing every user login, study view, slice download, report amendment, and DICOM export event. - **Data Sovereignty & DPA**: Standard Data Processing Agreements (DPA) and transparent subprocessor registries for healthcare institutions. --- ## 6. Developer APIs & Interoperability - **RESTful Endpoints**: Modern JSON APIs for worklist synchronization, study creation, patient records, report generation, and webhooks. - **DICOMweb Standards**: Full implementation of WADO-RS (Retrieve), QIDO-RS (Search), and STOW-RS (Store). - **HL7 & FHIR**: Modality worklist (MWL) integration, order scheduling feeds, and Electronic Health Record (EHR) interoperability. - **IndexNow Integration**: Automated real-time indexing protocol notifying Bing and other search engines instantaneously upon publishing new articles, documentation updates, or public services.