HomeCase studiesClinical Coverage, Consultations, and Encrypted Messaging

Case study · Melbourne, Australia

Clinical Coverage, Consultations, and Encrypted Messaging

Healthcare — clinical workforce coordination and practitioner-to-practitioner collaboration

Hospital specialists and community clinicians frequently rely on ad-hoc phone calls, pagers, and consumer chat apps to hand over on-call responsibility and request urgent consultations. We engineered a dedicated clinical coordination platform built around a Laravel REST API, an Objective-C iOS client, Redis-backed escalation queues, and AWS S3 media isolation. Practitioners transfer active coverage explicitly, collaborate inside patient-contextual threads, and receive deterministic SMS or voice fallbacks via Twilio when push delivery stalls.

Industry
Healthcare — clinical workforce coordination and practitioner-to-practitioner collaboration
Solution
A secure clinical communication and coverage platform comprising a native Objective-C iOS app, a web administration console, and a Laravel API backend hosted on AWS.
Platforms
iOS · Web & API
Stack
Laravel · PHP · MySQL · Redis · Objective-C · AWS
Location
Melbourne, Australia · delivered remotely
Role
Engineering, with the team behind for mobile and QA

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.

01 — Questions

asked about this kind of project

Why build the escalation pipeline with Twilio fallback instead of relying solely on APNs?

APNs offers best-effort delivery and can be suppressed by Focus modes, weak hospital Wi-Fi, or background app termination. For acute consultation requests, the backend schedules a delayed Redis job whenever a message is dispatched; if the recipient client fails to post an acknowledgement before the timeout window closes, a Laravel queue worker triggers a Twilio SMS or automated voice call to the practitioner's verified secondary number.

How are clinical photographs and referral attachments kept off personal device photo libraries?

The Objective-C capture controller routes camera output directly into an encrypted app-sandbox container rather than the iOS Camera Roll. Images are stripped of extraneous location EXIF tags, uploaded directly to a private AWS S3 bucket via single-use pre-signed PUT URLs, and rendered in-app through ephemeral memory-cached streams so clinical media never leaks into personal iCloud backups.

How does the platform prevent consultation requests from landing on an off-duty specialist?

Consultation routing resolves against live coverage assignments rather than static user IDs. Every specialty service maintains an explicit active-holder record in MySQL backed by Redis state. When a clinician ends a shift or delegates coverage, open and subsequent consult requests automatically rebind to the incoming practitioner while preserving full thread history.

Why was Objective-C chosen for the iOS client alongside a Laravel backend?

The clinical group already maintained legacy diagnostic viewer libraries and device-management hooks written in Objective-C. Building the coordination client natively in Objective-C avoided bridging overhead, provided direct control over background URLSession uploads and security keychain APIs, and kept binary behavior predictable across managed hospital iPads and personal iPhones.

How does the system handle concurrent handover attempts between two clinicians?

Coverage transfers use a two-step propose-and-accept state machine protected by optimistic locking and Redis mutex keys. An outgoing clinician cannot release a role until the incoming colleague confirms acceptance, eliminating the gap where a specialty appears uncovered or two practitioners simultaneously assume responsibility.

How are read receipts and message ordering guaranteed across intermittent hospital networks?

Each message carries a client-generated UUID and server-assigned monotonic sequence per thread. If an iOS device loses connectivity mid-upload, it retries idempotently against the Laravel API, preventing duplicate entries while stamping authoritative server timestamps once persisted in MySQL.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.