Skip to content

Commit ba7d55b

Browse files
authored
Merge branch 'master' into VED-1235-Lambda-to-mock-PDS-in-Ref
2 parents aae6283 + cef7e32 commit ba7d55b

34 files changed

Lines changed: 1136 additions & 546 deletions

.github/pull_request_template.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
1-
## Summary
1+
## PR Description
22

3-
- Routine Change
4-
- :exclamation: Breaking Change
5-
- :robot: Operational or Infrastructure Change
6-
- :sparkles: New Feature
7-
- :warning: Potential issues that might be caused by this change
3+
Description of the changes made.
84

9-
Add any other relevant notes or explanations here. **Remove this line if you have nothing to add.**
5+
## How were the changes tested
106

11-
## Reviews Required
12-
13-
- [x] Dev
14-
- [ ] Test
15-
- [ ] Tech Author
16-
- [ ] Product Owner
17-
18-
## Review Checklist
19-
20-
:information_source: This section is to be filled in by the **reviewer**.
21-
22-
- [ ] I have reviewed the changes in this PR and they fill all of the acceptance criteria of the ticket.
23-
- [ ] If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
24-
- [ ] If there were changes that are outside of the regular release processes e.g. account infrastructure to setup, manual setup for external API integrations, secrets to set, then I have checked that the developer has flagged this to the Tech Lead as release steps.
25-
- [ ] I have checked that no Personal Identifiable Data (PID) is logged as part of the changes.
7+
Describe how the changes were tested

.github/workflows/dependabot-auto-approve.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Fetch Dependabot metadata
1515
id: metadata
1616
continue-on-error: true
17-
uses: dependabot/fetch-metadata@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36
17+
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98
1818

1919
- name: Auto-approve minor and patch updates
2020
if: steps.metadata.outcome == 'success' && contains(fromJSON('["version-update:semver-minor", "version-update:semver-patch"]'), steps.metadata.outputs.update-type)

.github/workflows/deploy-lambda-artifact.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ jobs:
235235
- name: Login to Amazon ECR
236236
id: login-ecr
237237
if: ${{ steps.decide.outputs.deployment_mode == 'build' && !steps.build-check.outputs.existing_image_digest }}
238-
uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a
238+
uses: aws-actions/amazon-ecr-login@19d944daaa35f0fa1d3f7f8af1d3f2e5de25c5b7
239239

240240
- name: Set up Docker Buildx
241241
if: ${{ steps.decide.outputs.deployment_mode == 'build' && !steps.build-check.outputs.existing_image_digest }}
242-
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
242+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
243243

244244
- name: Build and publish image with layer caching
245245
id: build-image

.github/workflows/quality-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
2020

21-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
21+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
2222
with:
2323
node-version: "23.11.0"
2424
cache: "npm"
@@ -268,7 +268,7 @@ jobs:
268268
fi
269269
270270
- name: SonarCloud Scan
271-
uses: SonarSource/sonarqube-scan-action@299e4b793aaa83bf2aba7c9c14bedbb485688ec4
271+
uses: SonarSource/sonarqube-scan-action@55e44800a8f495208cce6e4e82f5dedb45fcf0ef
272272
env:
273273
GITHUB_TOKEN: ${{ github.token }} # Needed to get PR information, if any
274274
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

config/dev/permissions_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"FLU.CRUDS",
4747
"HPV.CRUDS",
4848
"MENACWY.CRUDS",
49+
"MENB.CRUDS",
4950
"MMR.CRUDS",
5051
"MMRV.CRUDS",
5152
"PERTUSSIS.CRUDS",

config/preprod/permissions_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"FLU.CRUDS",
4444
"HPV.CRUDS",
4545
"MENACWY.CRUDS",
46+
"MENB.CRUDS",
4647
"MMR.CRUDS",
4748
"MMRV.CRUDS",
4849
"PERTUSSIS.CRUDS",

config/prod/permissions_config.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
},
2626
{
2727
"supplier": "RAVS",
28-
"permissions": ["MMR.CRUDS", "RSV.CRUDS", "PNEUMOCOCCAL.CRUDS"],
28+
"permissions": [
29+
"MENB.CRUDS",
30+
"MMR.CRUDS",
31+
"RSV.CRUDS",
32+
"PNEUMOCOCCAL.CRUDS"
33+
],
2934
"ods_codes": ["X26", "X8E5B"]
3035
},
3136
{
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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.

infrastructure/account/.terraform.lock.hcl

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/instance/.terraform.lock.hcl

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)