Skip to main content

Patient Portal Service — Deployment Topology

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 03 platform-services · 02 DDD

1. Runtime

AttributeValue
RuntimeNestJS 11 / Node.js 22
LanguageTypeScript 5.x
ContainerDocker (linux/amd64 + linux/arm64)
OrchestrationKubernetes (production), Docker Compose (local dev)
Base imagenode:22-alpine

2. Kubernetes Deployment

ParameterValue
Namespaceehealth-portal
Deployment namepatient-portal-service
Min replicas2
Max replicas8 (HPA on CPU + request rate)
CPU request / limit250m / 1000m
Memory request / limit256Mi / 512Mi
Pod disruption budgetmin 1 available
Rollout strategyRollingUpdate — maxUnavailable 1, maxSurge 1

3. Networking

ConcernConfig
IngressKong Edge (/v1/portal/*, /fhir/R4/* — patient routes)
Internal service addresspatient-portal-service.ehealth-portal.svc.cluster.local:3000
Health checkGET /health — liveness + readiness
TLSTerminated at Kong; mTLS optional in mesh (Linkerd)

4. Dependencies (Runtime)

DependencyTypeNotes
PostgreSQL 16Primary storePHI data — tenant-region deployment
Redis 7Cache + push token storeBFF response caching, 30–120s TTL
NATS JetStreamEvent busOutbox relay + event consumption
KeycloakAuthPatient realm JWT issuance + introspection
registration-serviceHTTPPatient demographics
scheduling-serviceHTTPAppointment data
laboratory-serviceHTTPLab results (policy-filtered)
radiology-serviceHTTPImaging reports (policy-filtered)
medication-serviceHTTPMedicationRequest resources
claims-serviceHTTPCoverage + EOB
immunizations-serviceHTTPImmunization records
patient-chart-serviceHTTPProblem list + allergy + vitals
ai-gateway-serviceHTTPPatient navigation assistant (optional)
audit-serviceNATS consumerPortal access event audit trail
FCM / APNsHTTPMobile push notifications

5. Multi-Region Topology

PHI data does not leave the AFG region. Redis cache and object-store export URLs are also region-bound. Additional country deployments (UAE, etc.) use separate regional stacks.


6. Scaling Triggers

MetricScale-out threshold
CPU utilization> 70% for 2 min
Request rate (RPM)> 500 RPM per pod
Memory utilization> 80% for 5 min

7. Environment Variables

VariableDescription
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis connection string
NATS_URLNATS JetStream URL
KEYCLOAK_REALM_URLKeycloak issuer URL for patient realm
MODULE_LICENSE_KEYehr.portal entitlement key
AI_GATEWAY_URLai-gateway-service base URL
PUSH_FCM_KEYFirebase Cloud Messaging server key
PUSH_APNS_KEY_IDAPNs key ID for iOS push
EXPORT_STORAGE_BUCKETObject storage bucket for export downloads