|
| 1 | +# System Overview |
| 2 | + |
| 3 | +This page gives a high-level view of the Immunisation FHIR API runtime architecture. |
| 4 | + |
| 5 | +It focuses on the API path, batch ingestion path, outbound notification flow, runtime configuration, and NHS number change handling. |
| 6 | + |
| 7 | +## High-Level Diagram |
| 8 | + |
| 9 | +```mermaid |
| 10 | +flowchart LR |
| 11 | + subgraph Ingress[Ingress and API] |
| 12 | + Suppliers[Supplier systems] --> Apigee[Apigee proxy\nOAuth, rate limiting, supplier header] |
| 13 | + Apigee --> ApiGw[AWS API Gateway HTTP API] |
| 14 | + ApiGw --> Backend[Backend API Lambdas\nCRUD, search, status] |
| 15 | + Backend --> IEDS[(IEDS DynamoDB\nImmunisation event store)] |
| 16 | + end |
| 17 | +
|
| 18 | + subgraph Batch[Batch ingestion] |
| 19 | + SupplierFiles[Supplier batch files in S3] --> Filename[Filename Processor Lambda] |
| 20 | + Mesh[MESH mailbox bucket] --> MeshProc[Mesh Processor Lambda] |
| 21 | + MeshProc --> Filename |
| 22 | + Filename --> BatchCreated[SQS FIFO\nbatch-file-created] |
| 23 | + BatchCreated --> BatchFilter[Batch Processor Filter Lambda] |
| 24 | + BatchFilter --> SupplierQueue[SQS FIFO\nsupplier metadata queue] |
| 25 | + SupplierQueue --> BatchPipe[EventBridge Pipe] |
| 26 | + BatchPipe --> RecordProcessor[ECS Fargate Record Processor] |
| 27 | + RecordProcessor --> Kinesis[Kinesis data stream] |
| 28 | + Kinesis --> Forwarder[Record Forwarder Lambda] |
| 29 | + Forwarder --> IEDS |
| 30 | + Forwarder --> AckQueue[SQS FIFO\nack metadata queue] |
| 31 | + AckQueue --> Ack[Ack Backend Lambda] |
| 32 | + end |
| 33 | +
|
| 34 | + subgraph Outbound[Outbound notifications] |
| 35 | + IEDS -->|DynamoDB stream| Delta[Delta Lambda] |
| 36 | + Delta --> DeltaTable[(Delta DynamoDB)] |
| 37 | + DeltaTable -->|DynamoDB stream| MnsPipe[EventBridge Pipe] |
| 38 | + MnsPipe --> MnsQueue[SQS\nmns-outbound-events] |
| 39 | + MnsQueue --> MnsPublisher[MNS Publisher Lambda] |
| 40 | + MnsPublisher --> Subscribers[MNS subscribers] |
| 41 | + end |
| 42 | +
|
| 43 | + subgraph Config[Runtime config] |
| 44 | + ConfigBucket[S3 config bucket] --> RedisSync[Redis Sync Lambda] |
| 45 | + RedisSync --> Redis[(Redis cache\npermissions, disease mappings, config)] |
| 46 | + Redis --> Backend |
| 47 | + Redis --> Filename |
| 48 | + Redis --> RecordProcessor |
| 49 | + Redis --> Forwarder |
| 50 | + end |
| 51 | +
|
| 52 | + subgraph IdSync[Identity sync] |
| 53 | + MnsIdEvent[MNS NHS number change event] --> IdQueue[SQS\nid-sync-queue] |
| 54 | + IdQueue --> IdSyncLambda[ID Sync Lambda] |
| 55 | + IdSyncLambda --> IEDS |
| 56 | + end |
| 57 | +``` |
| 58 | + |
| 59 | +## Key Runtime Stores |
| 60 | + |
| 61 | +| Store | Purpose | |
| 62 | +| -------------- | ------------------------------------------------------------------- | |
| 63 | +| IEDS DynamoDB | System of record for immunisation events | |
| 64 | +| Delta DynamoDB | Outbound change store derived from IEDS stream events | |
| 65 | +| Redis | Runtime cache for permissions, disease mappings, and related config | |
| 66 | +| Audit table | Batch-processing control state, deduplication, and status tracking | |
| 67 | + |
| 68 | +## Design Notes |
| 69 | + |
| 70 | +- The filename processor is the batch entry point for files placed in the source bucket. |
| 71 | +- The audit table is for deduplication, processing state, and ordering decisions. |
| 72 | +- The batch processor filter ensures only one event is processed at a time for a given supplier and vaccine-type combination. |
| 73 | +- The supplier metadata FIFO queue preserves ordering before work is dispatched to ECS through EventBridge Pipe. |
| 74 | +- ECS is used for record processing because batch row processing can be long-running. |
| 75 | +- The record forwarder is the component that applies processed batch changes to IEDS. |
| 76 | +- ACK creation is part of the batch lifecycle. |
0 commit comments