Delivered remotely for a business based in Melbourne, Australia. Names withheld by agreement.
Project Overview
Clinical teams rarely lose time because of a shortage of medical knowledge; they lose time trying to find out who currently holds the pager for a given specialty and whether an urgent message was actually seen. Across clinics and acute wards in Melbourne, practitioners relied on fragmented switchboard calls, shared spreadsheets for after-hours rosters, and consumer messaging apps that mixed clinical photography with personal chats. We engineered a dedicated clinical coordination platform that unifies practitioner directory lookup, formal shift coverage handovers, structured consultation threads, and multi-channel urgent escalation.
Business Bottleneck
Consumer chat tools create serious operational and governance risks in clinical settings. Images captured during bedside consults automatically sync to personal cloud backups, read receipts do not distinguish between a message delivered to a locked phone and a clinician actively assuming care, and static group chats continue pinging doctors long after their shift ends. Meanwhile, traditional hospital switchboards introduce manual bottlenecks whenever a registrar needs a rapid cardiology opinion or a GP requires confirmation on a discharge plan. The organization needed a purpose-built mobile and web platform where accountability follows the active duty role rather than an individual's personal inbox.
Architectural Strategy
Rather than building a generic team chat clone, we modeled the domain around Roles, Coverage Windows, and Consultation State. A thread is anchored to either a peer-to-peer consult or an active specialty service queue. Messages and attachments pass through a Laravel API layer that separates sensitive clinical payloads from push notification metadata, while Redis coordinates time-bounded escalation timers so no critical request goes silently unread.
Core Capabilities
- Role-Based Coverage Handover: Clinicians propose, accept, and audit on-call transfers with explicit start/end boundaries, automatically routing incoming specialty consults to the active holder.
- Patient-Contextual Consult Threads: Structured conversation headers capture urgency tier, clinical context tags, and participating practitioners without cluttering free-text dialogue.
- Sandboxed Clinical Capture: Native Objective-C camera and document workflows capture wound photos or ECG strips into encrypted app storage, bypassing the system photo library.
- Deterministic Escalation Ladder: Unacknowledged urgent consults escalate automatically from APNs silent and alert pushes to Twilio SMS and voice prompts based on configured clinic policies.
- Directory & Specialty Filtering: Fast lookup across hospital departments, sub-specialties, and current availability status.
Technical Architecture
Flow: iOS Objective-C Client -> AWS ALB -> Laravel PHP API -> MySQL RDS (State/Audit) + Redis (Escalation/Presence) -> AWS S3 (KMS Media) + APNs / Twilio Fallback
The Laravel backend serves stateless JSON endpoints authenticated via rotating bearer tokens tied to verified practitioner credentials and device identifiers. When a clinician dispatches an urgent consult, MySQL records the message inside a transaction and schedules a delayed verification job in Redis. If the recipient's Objective-C client fails to post an explicit acknowledgement event before the threshold expires, the queue worker inspects the practitioner's escalation policy and dispatches a Twilio programmable SMS or voice call containing a non-PHI callback prompt that deep-links back into the thread.
Binary attachments never transit through PHP worker memory. Instead, the iOS client requests a short-lived AWS S3 pre-signed PUT URL scoped to an exact content type and byte ceiling, uploads the encrypted payload directly over TLS, and commits the resulting object key to the consult thread. Viewing attachments reverses the pattern through short-lived GET signatures paired with strict server-side authorization checks.
Technology Stack
| Category | Technology detail |
|---|---|
| Backend framework | Laravel (PHP) REST API and web administration portal |
| Primary database | MySQL on Amazon RDS with encrypted-at-rest volumes and strict audit tables |
| Queue & cache | Redis for escalation timers, presence state, and worker coordination |
| iOS client | Native Objective-C application with local encrypted persistence |
| Cloud infrastructure | AWS EC2 application nodes behind Application Load Balancer |
| Media storage | AWS S3 private buckets with KMS encryption and short-lived pre-signed URLs |
| Escalation transport | Twilio Programmable SMS and Voice for unacknowledged critical consults |
| Push notifications | Apple Push Notification service (APNs) with mutable notification extensions |
| Search & directory | Indexed practitioner specialty and active-coverage lookup endpoints |
| Audit & compliance | Immutable event trail capturing handovers, read receipts, and media access |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Push notification privacy vs. urgency visibility | APNs payloads contain only a generic alert ("Urgent consult awaiting review") and thread identifier; the Objective-C Notification Service Extension fetches decrypted preview context over an authenticated endpoint only when device policy permits, keeping clinical details off Apple push servers. |
| Direct PHP media uploads vs. pre-signed S3 transfers | Streaming multi-megabyte clinical images through PHP-FPM exhausts worker pools under concurrent load. Issuing single-use KMS-backed S3 pre-signed URLs keeps Laravel workers lightweight while enforcing MIME and size constraints. |
| Real-time socket servers vs. APNs + long-lived sync | Maintaining persistent WebSocket connections on iOS drains battery and drops silently when devices lock inside concrete wards. Pairing APNs wakeups with lightweight incremental delta-sync endpoints and Redis event flags delivers responsive updates without background socket overhead. |
| Hard deletion vs. clinical auditability | Clinical communications require defensible history. Messages and handover events are immutable in MySQL; practitioner offboarding revokes access tokens and detaches directory visibility without erasing historical consultation records. |
Security & Reliability
All traffic terminates TLS at the AWS Application Load Balancer, with internal RDS storage and S3 buckets encrypted using AWS KMS-managed keys. On the iOS client, sensitive session tokens reside in the iOS Keychain, local message caches use SQLite with file-protection attributes (NSFileProtectionCompleteUnlessOpen), and screenshots or app-switcher previews trigger an automatic privacy blur overlay when backgrounded.
To guard against race conditions during shift changeovers, handover acceptance acquires a Redis lock keyed by the specialty role ID before updating MySQL state. Every consultation acknowledgement, escalation firing, and attachment download appends an immutable audit row recording actor ID, device ID, and server timestamp.
Performance & Scale
By offloading attachment binary transfers directly to AWS S3 and caching active specialty-holder mappings in Redis, the Laravel API handles bursts of morning ward-round traffic and simultaneous shift handovers with predictable sub-second query response times. MySQL thread queries rely on composite indexes over (thread_id, sequence_number) and (recipient_id, acknowledged_at) so inbox polling fetches only unseen deltas rather than re-scanning full conversation histories. Laravel queue workers scale horizontally across EC2 instances with isolated queues separating high-priority Twilio escalation triggers from routine directory synchronization and audit exports.
Operational Outcomes
Clinicians gained a single, accountable workflow for discovering who is on call, handing over active duties without dropped responsibilities, and exchanging diagnostic imagery without contaminating personal devices. Practice administrators replaced manual roster spreadsheets with an auditable record of shift coverage and consultation responsiveness, while out-of-hours escalation became deterministic even in dead-spot wards where push notifications alone proved unreliable.