Back to Blog
Healthcare January 15, 2026 · 12 min read

Deploying a Full Radiology System on the Edge: 13 Modules, Zero Servers

GM

Gonzalo Monzón

Founder & Lead Architect

An expert radiologist who has worked with Siemens, Philips, Carestream and Epic rated our system 9/10. That system — CIMAD RIS — is a complete Radiology Information System with 13 production modules, running entirely on Cloudflare Workers, D1 and R2. No hospital servers. No Java monolith. No six-figure license. Just a React SPA talking to edge infrastructure for ~€50/month.

The Problem: Healthcare IT Is Stuck in 2005

Traditional RIS systems share a depressing pattern:

  • Cost: €100K-500K+ upfront license, plus annual maintenance contracts
  • Infrastructure: Dedicated servers, on-premise PACS storage, IT staff to maintain them
  • Updates: Twice a year if you're lucky, coordinated downtime windows
  • Access: VPN-only, hospital network only — radiologists can't read studies from home
  • UX: Interfaces designed in 2008, never meaningfully updated

For a diagnostic imaging center in Andorra, these traditional options were either unaffordable or overkill. They needed a full RIS — from appointment booking to signed report delivery — that a small clinic could actually operate. We built it.

13 Modules, All at 100%

CIMAD isn't a prototype or a "v1 MVP." It's a production v3.0 system with 13 fully completed modules:

1. Public Portal

Institutional website with online appointment requests, center information, services, and FAQ. Built with Astro SSG on Cloudflare Pages — static, fast, SEO-optimized.

2. Core RIS

The heart of the system — appointment calendar with slots by room and modality, patient management (demographics, history, documents), and the full study lifecycle: request → schedule → perform → report → deliver. Rooms configured for RX, CT, MRI, Ultrasound and Mammography.

3. Technician Worklist

Real-time work queue filtered by room, modality, and urgency. Status tracking from scheduled → in progress → completed → reported. Automatic prioritization of urgent cases. Radiologist assignment.

4. DICOM Viewer

Full medical imaging viewer running in the browser — the most technically challenging module. More on this below.

5. Report Editor

Structured reporting with templates by modality and anatomical region. Voice dictation via Whisper STT. AI-assisted suggestions from MedGemma integrated directly in the editor. Structured findings (BIRADS, ACR, TNM). Digital signature and professional PDF export with clinic branding.

6. Patient Portal

Secure patient access: view appointments, studies, and reports. Download report PDFs. Access DICOM images through a simplified viewer. Full history. Notifications when reports are ready.

7. AI Diagnostics (MedGemma 1.5)

Detailed below — AI-assisted diagnosis that suggests, never decides.

8. Billing & CASS Integration

Electronic invoicing to Andorra's Social Security (CASS). Automatic coverage calculation (CASS portion vs. patient copay). Professional PDF invoices. Redsys integration for online card payments. Full billing dashboard with filters and export.

9. Digital Consent Forms

14 types of informed consent (CT contrast, MRI gadolinium, biopsy, mammography, etc.). Digital signature on canvas (touchscreen or mouse). PDF generated with embedded signature. SHA-256 hash for document integrity. Permanently archived and linked to the study.

10-11. WhatsApp & Email Notifications

Twilio WhatsApp templates (Meta-approved) for appointment confirmation, 24h reminders, and report availability. Resend email for 5 transactional templates.

12-13. Cloud PACS & R2 Storage

DICOM studies stored in Cloudflare R2 with 8 API endpoints. Presigned URLs with expiration. Organized by patient/study/series. Smart compression. Centralized file management for DICOMs, report PDFs, signed consent forms, and invoices.

The DICOM Viewer: Medical Imaging in the Browser

Building a production-grade DICOM viewer in the browser was the single hardest engineering challenge. Medical imaging has extreme requirements: lossless rendering, precise measurements, windowing controls that radiologists rely on for diagnosis.

Our stack:

  • cornerstone.js — The rendering engine. Handles DICOM parsing, image display, and the rendering pipeline
  • Cloudflare R2 — Cloud PACS storage. Studies organized by patient → study → series
  • Progressive loading — First image appears in under 2 seconds, even for CT scans with 200+ slices. Remaining slices stream in the background

Tools available to the radiologist:

  • Zoom, pan, rotate — Standard navigation
  • Windowing (W/L) — Window width and level adjustment, critical for diagnosis (bone window, soft tissue, lung)
  • Measurements — Distance, angle, area, with DICOM-calibrated pixel spacing
  • Series navigator — Multiple series per study, quick switching
  • AI overlay — MedGemma findings displayed as semi-transparent markers on the image, togglable

The key insight: radiologists don't want a "new" interface. They want the same tools they've used for 20 years, but faster and accessible from anywhere. We matched the interaction patterns of Syngo and InteleViewer, but with 2-second load times instead of 15.

MedGemma 1.5: AI That Suggests, Never Decides

We integrated three AI models, each with a specific role:

ModelFunction
MedGemma 1.5Radiological image analysis — detects anomalies, suggests findings with confidence levels, highlights regions of interest
Gemini 2.0 FlashReport text generation — drafts report language from findings, creates summaries for patient portal
WhisperVoice dictation — real-time speech-to-text for hands-free reporting

The critical design principle: the AI suggests, the radiologist decides. MedGemma findings appear as an overlay on the DICOM viewer, clearly marked as AI-generated. The radiologist can accept, modify, or dismiss each finding. The report editor shows AI-suggested text as editable drafts, never as final output.

This isn't about replacing radiologists — it's about catching what gets missed during an 8-hour reading session. A second pair of eyes that never gets tired, never gets distracted, and processes every pixel of every image.

HL7 FHIR: Talking to the National Health System

Andorra has a national shared health record system — HCCA (Historia Clínica Compartida d'Andorra). Integration is mandatory. We built a complete HL7 v2.x parser:

  • Segment decoding: MSH, PID, PV1, OBR, OBX, AL1, DG1 — the full message structure
  • Bidirectional mapping: CIMAD ↔ HCCA data translation in both directions
  • DICOM MWL: Modality Worklist integration — imaging equipment receives the patient worklist automatically, no manual entry on the machine
  • European standards compliance: Full conformity with EU healthcare interoperability requirements

When a radiologist signs a report, it's automatically transmitted to HCCA. The patient's GP receives a notification. The study becomes part of the patient's national health record. All of this happens in seconds, not days.

Digital Signatures: Legal Validity on the Edge

Every radiology report requires a legally valid digital signature. Every informed consent form needs a patient signature with document integrity verification. We implemented:

  • Radiologist signature: Cryptographic signature applied to the final report PDF, embedded in the document
  • Patient consent signature: Canvas-based signature capture (works on touchscreens and with mouse), embedded in the consent PDF
  • SHA-256 integrity hash: Every signed document gets a hash stored separately — any modification to the PDF after signing is detectable
  • Audit trail: Who signed, when, from which device, IP address — complete chain of custody

Edge Security Is Better Than On-Premise

The first objection from every healthcare stakeholder: "Patient data can't be in the cloud." We address this head-on because our cloud setup is genuinely more secure than most hospital server rooms:

  • Encryption: Data encrypted at rest (D1/SQLite) and in transit (TLS 1.3 everywhere)
  • Zero-trust model: No VPN needed. Every request authenticated with JWT + role-based access. Radiologists, technicians, receptionists, and patients each see only what they should
  • Cloudflare WAF + DDoS: Automatic protection that most hospitals don't have on their on-premise servers
  • EU data residency: Workers and storage configured for EU region — GDPR compliant by architecture
  • Access from anywhere: Sub-100ms latency worldwide. Radiologists read studies from home, from the hospital, from a conference — same speed, same security

Compare this to the typical hospital RIS: an unpatched Windows Server in a closet with a UPS, accessible only via a VPN that hasn't been audited in three years. We'll take our setup.

Architecture: How It All Connects

Public Portal (Astro SSG)
  └── Cloudflare Pages (static, cached globally)

CIMAD RIS App (React SPA + Vite)
  ├── Appointment Calendar / Patient Management
  ├── Technician Worklist (real-time status)
  ├── DICOM Viewer (cornerstone.js + R2 PACS)
  ├── Report Editor (templates + voice dictation + AI)
  ├── Patient Portal (secure, role-limited)
  ├── Billing Dashboard (CASS + Redsys)
  └── Admin / Configuration

Backend (Cloudflare Workers — 30+ API endpoints)
  ├── D1 → Patients, appointments, studies, reports, invoices
  ├── R2 → DICOM images, PDFs, consent forms
  ├── MedGemma 1.5 → AI diagnostic analysis
  ├── Whisper → Voice dictation STT
  ├── Twilio → WhatsApp notifications
  └── Resend → Transactional email

Institutional Integrations
  ├── CASS API → Social Security billing
  ├── HCCA / HL7 FHIR → National health record
  ├── DICOM MWL → Imaging equipment worklist
  └── Redsys → Card payments

~700 Tests: Healthcare Demands Correctness

Healthcare software can't have "minor bugs." A wrong patient ID on a report, a billing error with the Social Security, or a consent form with an invalid signature — any of these could have legal consequences. Our test suite covers:

  • End-to-end flows: Appointment → study → report → signature → billing → FHIR transmission
  • CASS integration: Coverage calculations, electronic invoicing, edge cases (foreign patients, special coverages)
  • HL7 message parsing: Every segment type, bidirectional mapping, malformed message handling
  • PDF generation: Reports, invoices, consent forms — correct content, embedded signatures, valid structure
  • Role-based access: Radiologist sees everything, technician sees worklist, patient sees own data only

~700 tests pass on every deploy. The CI pipeline blocks any deployment that doesn't pass 100%.

ROI: The Numbers That Matter

⏱️ Time to report: -92% (from hours to minutes with voice dictation + AI draft)

📞 Phone calls: -90% (patient portal + WhatsApp notifications handle it)

📅 Appointments processed/hour: +150% (digital workflow vs. paper)

📂 Lost studies: -100% (cloud PACS — nothing gets lost, ever)

💰 Infrastructure cost: ~€50/month vs. €500+/month for dedicated servers

🏥 Expert rating: 9/10 by radiologist with Siemens, Philips, Carestream, Epic experience

🧪 Test coverage: ~700 tests passing on every deploy

🔒 Compliance: GDPR, CASS, HCCA (HL7 FHIR), digital signatures — all production-verified

What We Learned Building Healthcare Software

  • Match existing workflows, don't reinvent them: Radiologists have specific habits built over decades. Our DICOM viewer mirrors the interaction patterns of tools they already know (Syngo, InteleViewer). Innovation in UX means faster, not different.
  • AI must be explicitly assistive: The moment AI "decides" something in healthcare, you have a liability problem. Every AI output is clearly labeled, editable, and dismissible. The radiologist's signature means the radiologist takes responsibility — not the algorithm.
  • Institutional integrations are 40% of the work: CASS billing rules, HL7 FHIR message structures, DICOM MWL quirks — the "boring" integration work took as much time as building the viewer and the AI combined.
  • Digital signatures need legal review: Different jurisdictions have different requirements. Andorra's digital signature regulations required specific implementation choices that we wouldn't have discovered without involving legal counsel early.
  • Edge infrastructure works for healthcare: The "data can't be in the cloud" objection dissolves when you demonstrate encryption, zero-trust access, EU residency, and WAF protection. Most healthcare stakeholders are surprised to learn their current setup is less secure.

Tags

Healthcare DICOM FHIR Cloudflare Radiology RIS MedGemma cornerstone.js

About the Author

Gonzalo Monzón

Gonzalo Monzón

Founder & Lead Architect

Gonzalo Monzón is a Senior Solutions Architect & AI Engineer with over 26 years building mission-critical systems in Healthcare, Industrial Automation, and enterprise AI. Founder of Cadences Lab, he specializes in bridging legacy infrastructure with cutting-edge technology.

Stay in the loop

Get notified when we publish new articles about AI automation, use cases, and practical guides.