Back to projects

HL7 Data Proxy & Cloud Run Integration

TypeScriptFastifyDockerGCP Cloud RunPostgreSQLHL7Reliability

Problem

Laboratory analyzers produced HL7 messages, but downstream systems needed structured JSON to ingest data reliably. Onboarding new devices was slow and error-prone due to differences in device formats and configuration steps.

Constraints

  • Service must be stateless to scale and recover cleanly on Cloud Run.
  • Traffic reliability matters (medical data workflows).
  • Messages needed validation and predictable JSON output.

Solution

I built a proxy service using Fastify that accepts HL7 input, parses and validates it, transforms it into a consistent JSON schema, and exposes endpoints for downstream ingestion. The service was packaged as a Docker container and deployed to GCP Cloud Run.

Architecture

HL7 Proxy Architecture Diagram

Key decisions

  • Stateless design: no local file storage and no in-memory “state” required for correct processing, so Cloud Run can scale instances safely.
  • Containerized deployment: consistent runtime + easy rollbacks with image versions.
  • Validation layer: reject malformed messages early to protect downstream systems.
  • Observability mindset: structured logs to troubleshoot parsing and integration issues.

Impact

  • Reduced new equipment onboarding time by ~50%.
  • Improved operational reliability by standardizing output format and handling edge cases consistently.

What I learned

  • Designing for stateless compute (Cloud Run) and scaling characteristics.
  • Building robust parsers + defensive validation for “messy” real-world inputs.
  • Deploying containerized services with predictable releases and rollbacks.