Architecture — Component HLD Master

LumisCare — Component High-Level Design Master Document

Version: 1.0 Date: 2026-04-04 Author: Dr. Sarah Chen, Healthcare IT Systems Architect Status: Active — Reflects verified implementation state as of 2026-04-04 Method: Static analysis of source tree + HLD document review + gap analysis synthesis


Document Purpose

This document provides the authoritative component-level HLD for all LumisCare microservices, BFF layers, and frontend features. It cross-references the documented architecture (VCC2-C4-Architecture-Diagrams.md, Services-Integration-Matrix.md, BFF-Architecture-Design.md, Service-Bus-Subscriptions-Design.md) against verified implementation on disk.

Each component section records: implementation status, controller/entity counts, BFF integration status, event bus wiring status, and known gaps.

CRITICAL NOTE — Naming inconsistency: HLD documents use "VCC 2.0" throughout. The BFF design switches to "iCON". The deployed product is "LumisCare". All three names refer to the same system. This document uses "LumisCare" as the canonical product name.


System Architecture Summary

Web (React 19) ──────────────────────── Web BFF (port 8080)
                                                │
Mobile (React Native / Expo SDK 52) ──── Mobile BFF
                                                │
                               ┌────────────────┴───────────────────┐
                               │    MICROSERVICES LAYER              │
                               │  (Java 21, Spring Boot 3.4)         │
                               │                                     │
                               │  identity-service                   │
                               │  assessment-service                 │
                               │  careplan-service                   │
                               │  visits-service                     │
                               │  hr-service                         │
                               │  scheduling-service                 │
                               │  incidents-service                  │
                               │  finance-service                    │
                               │  notification-service               │
                               │  safety-service                     │
                               │  policy-service                     │
                               │  document-service                   │
                               │  fhir-adapter-service              │
                               └─────────────────────────────────────┘
                                               │
                              Azure Service Bus (domain-events topic)
                              Azure PostgreSQL (per-service databases)
                              Azure Redis (shared cache)
                              Azure Blob Storage (documents)

Multi-tenancy: Row-Level Security (RLS) on organisation_id across all service databases. Auth: Azure Entra ID (MSAL) — JWT pass-through from BFF to microservices. Service-to-service via Azure Managed Identity. Deployment: Azure Container Apps (AKS target). Azure Static Web Apps for frontend.


Component Status Legend

Status Meaning
PRODUCTION-READY Controllers, entities, repositories, and migrations all present and verified
PARTIAL Core entities and controllers present but key integration (event bus, BFF, mobile) absent
SKELETON Directory exists, minimal or no Java source files
UNDOCUMENTED Implemented in code but absent from all HLD documents
DESIGN-ONLY Documented in HLD but not implemented in code

Component Index

  1. Identity
  2. HR
  3. Visits
  4. Scheduling
  5. Care Plans
  6. Assessments
  7. Incidents
  8. Finance
  9. Notifications
  10. Safety
  11. Policy (AI/RAG)
  12. Document
  13. FHIR Adapter
  14. Web BFF
  15. Mobile BFF

1. Identity

Purpose

Manages users, organisations, service users, RBAC roles, consent records, PHI access audit, and GDPR data rights. Serves as the authentication enrichment layer for Azure Entra ID tokens — all services call identity-service to resolve user context from JWTs.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


2. HR

Purpose

Manages employee records, qualifications, training certifications, availability preferences, leave management, performance reviews, and equality/diversity data. Acts as the canonical source of carer workforce data for the scheduling-service.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


3. Visits

Purpose

Manages the full visit execution lifecycle: Electronic Visit Verification (EVV) check-in/check-out, care note recording, eMAR (electronic medication administration record), vital sign capture, task completion, observation recording, real-time carer location tracking, and geofence enforcement. The most clinically active service during field operations.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


4. Scheduling

Purpose

Creates, manages, and publishes care schedules. Handles recurring appointment generation, carer assignment with skill matching, schedule approval workflow, cover arrangements, and proposed appointment review. Bridges care plan proposed visits and operational visit execution.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


5. Care Plans

Purpose

Manages the full care plan lifecycle: AI-assisted generation from assessments, plan versioning, task definition, master visit type configuration, and proposed visit generation. The care plan is the primary clinical document linking assessment outcomes to scheduled care delivery.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


6. Assessments

Purpose

Manages the complete clinical assessment lifecycle: intake, section/question/answer management, risk assessments (NEWS2, Waterlow, PHQ-9, GAD-7), Mental Capacity Assessment (MCA), DNACPR order management, medication reconciliation, clinical scoring, AI-assisted assessment transcription, and real-time collaborative assessment via Azure Web PubSub.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


7. Incidents

Purpose

Manages incident reporting, safeguarding concerns, hazard logging, complaints management, and CQC statutory reporting evidence. Provides CSV export for regulatory data extraction during CQC inspections.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


8. Finance

Purpose

Manages the complete financial lifecycle: invoice generation, pay rates, payroll, timesheet management, insurance claim generation (837P/837I EDI), remittance reconciliation (835 EDI), gross profit analysis, hours variance reporting, and payer management. The largest service by code volume in the fleet.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


9. Notifications

Purpose

Multi-channel notification dispatch: push (Firebase Cloud Messaging), email (SendGrid), SMS (Twilio), and in-app inbox. Consumes domain events from Azure Service Bus and routes them to appropriate users based on notification preferences and rate limits. Maintains notification history and delivery analytics.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


10. Safety

Purpose

Manages lone worker protection (LWP), SOS emergency alerts, and emergency contact management. The LWP timer service runs server-side (not dependent on carer device signal) and escalates overdue check-in sessions through a supervisor notification ladder. This service addresses the CQC requirement for lone worker safety in domiciliary care.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


11. Policy (AI / RAG)

Purpose

Provides RAG (Retrieval-Augmented Generation) based policy question-and-answer capability. Care workers and managers can ask questions about organisational policies, CQC standards, and care protocols in natural language. The service chunks policy documents, stores vector embeddings, and queries them via Azure OpenAI.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


12. Document

Purpose

Manages document storage, retrieval, and retention for clinical and operational documents. Uses Azure Blob Storage as the backing store with application-level retention policy enforcement. Supports document upload, categorisation, and time-limited access via pre-signed URLs.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


13. FHIR Adapter

Purpose

Exposes FHIR R4 resources (Patient, Observation, MedicationStatement) for interoperability with NHS systems, third-party care management platforms, and referral networks. Enables LumisCare to participate in NHS DSCR (Digitising Social Care Record) programme and GP Connect workflows.

Backend Service

Frontend

BFF Integration

Event Bus

Gaps


14. Web BFF

Purpose

Backend-for-Frontend aggregation layer for the React 19 web application. Orchestrates parallel and sequential calls to microservices, aggregates responses, enforces JWT validation, applies rate limiting (via Azure API Management), and provides OpenAPI-generated typed client contracts. Port 8080.

Backend Service

Frontend Integration

BFF Integration

Event Bus

Gaps


15. Mobile BFF

Purpose

Backend-for-Frontend aggregation layer for the React Native / Expo field worker mobile application. Provides a minimal, mobile-optimised API surface for care execution: care plan read access, appointment viewing, assessment submission, risk assessment, and blob storage for photos. Port not confirmed.

Backend Service

Frontend Integration

BFF Integration

Event Bus

Gaps


Event Bus Summary Table

Event Producer Publisher Code? Consumer Listener Code? Status
assessment.completed assessment-service NO careplan-service NO NOT WIRED
careplan.published careplan-service NO scheduling-service CarePlanEventIdempotencyEntity (ready) NOT WIRED
careplan.updated careplan-service NO visits-service NO NOT WIRED
schedule.published scheduling-service AppointmentEventPublisher YES notification-service @ServiceBusListener COMMENTED OUT BROKEN
schedule.updated scheduling-service AppointmentEventPublisher YES visits-service NO PARTIALLY WIRED
visit.checkedin visits-service VisitEventPublisher YES notification-service @ServiceBusListener COMMENTED OUT BROKEN
visit.completed visits-service VisitEventPublisher YES finance-service NO PARTIALLY WIRED
task.flagged visits-service VisitEventPublisher YES notification-service @ServiceBusListener COMMENTED OUT BROKEN
checkin.timeout visits-service VisitEventPublisher YES notification-service @ServiceBusListener COMMENTED OUT BROKEN
assistance.requested visits-service VisitEventPublisher YES notification-service @ServiceBusListener COMMENTED OUT BROKEN
invoice.created finance-service OutboxEvent entity only — NO publisher notification-service @ServiceBusListener COMMENTED OUT NOT WIRED
invoice.paid finance-service NO notification-service @ServiceBusListener COMMENTED OUT NOT WIRED
timesheet.created finance-service NO notification-service @ServiceBusListener COMMENTED OUT NOT WIRED
employee.created hr-service HrEventPublisher YES identity-service NO confirmed listener PARTIALLY WIRED
employee.terminated hr-service HrEventPublisher YES scheduling-service NO PARTIALLY WIRED
availability.updated hr-service HrEventPublisher YES scheduling-service AvailabilityUpdatedEventListener YES WIRED
leave.approved hr-service HrEventPublisher YES scheduling-service NO confirmed listener PARTIALLY WIRED
incident.created incidents-service EventPublisher YES (outbox) notification-service @ServiceBusListener COMMENTED OUT BROKEN
notification.sent notification-service NotificationEventPublisher YES analytics-service NOT IMPLEMENTED PARTIALLY WIRED

Summary: HR → Scheduling (availability.updated) is the only fully wired event chain. The primary clinical workflow (Assessment → CarePlan → Scheduling → Visits → Finance) has broken links at every node.


Priority Remediation Register

P0 — Patient Safety and Compliance Blocking

P0-001: Uncomment @ServiceBusListener in notification-service

P0-002: Resolve DNACPR dual-domain ownership

P1 — Regulatory Exposure

P1-001: Add event publisher to assessment-service for assessment.completed

P1-002: Add event publisher to careplan-service for careplan.published

P1-003: Add mobile BFF controllers for eMAR, EVV, incidents, and SOS

P1-004: Implement mandatory notification deadline and automated escalation in incidents-service

P1-005: Document and security-review fhir-adapter-service

P2 — Architecture Integrity

P2-001: Implement OutboxEventPublisher in finance-service

P2-002: Add finance-service listener for visit.completed event

P2-003: Confirm EmarController enforces witness requirement at service layer

P2-004: Add Flyway migrations to bring visits-service (7) and assessment-service (8) in line with entity complexity

P2-005: Standardise finance-service package namespace from com.lumiscare.icon.finance to com.lumiscare.finance

P2-006: Operationalise yarn generate:api pipeline


Architectural Risks

Risk Severity Description
BFF-less frontend in production CRITICAL Frontend routes to old Django monolith, not web-bff. All microservices are bypassed.
Broken clinical workflow event chain HIGH Assessment → CarePlan → Schedule → Visit → Finance has multiple broken publisher/subscriber links
Notification service deaf to event bus HIGH @ServiceBusListener commented out — all event-driven alerts are non-functional
Four undocumented services in production path HIGH safety, policy, document, fhir-adapter — no API contracts, no security posture
FHIR PHI exposure HIGH FHIR R4 resources expose PHI without documented authentication controls
Finance event bus gap MEDIUM Transactional outbox started but publisher absent — billing events are silent
Mobile BFF coverage gap HIGH eMAR, EVV, incidents, SOS absent from mobile BFF — direct service calls bypass auth boundary
DNACPR dual ownership HIGH Resuscitation decision data in two services with no confirmed sync
CQC mandatory notification deadline MEDIUM No automated enforcement for 24-hour statutory reporting requirement
OpenAPI client drift MEDIUM 6 of 10 services accessed via manual WebClient — contract drift inevitable

Document History

Version Date Author Changes
1.0 2026-04-04 Dr. Sarah Chen Initial — 13 components + 2 BFFs documented. Evidence base: static filesystem analysis + HLD document review. Cross-reference with lumiscare-backend-lld.md and lumiscare-hld-gap.md.

Revision #2
Created 2026-04-05 21:40:48 UTC by John
Updated 2026-05-31 20:05:32 UTC by John