[HOTE-1099] feat: Results processor#386
Open
lauren5656 wants to merge 26 commits intomainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements a new hiv-result-processor Lambda to process incoming HIV FHIR Observations and invoke the existing result-status workflow, plus local Terraform wiring and Lambda invocation dependencies.
Changes:
- Added a new
hiv-result-processor-lambda(handler, init wiring, validation/task building utilities, and unit tests). - Added a Lambda-invocation service using
@aws-sdk/client-lambdato call the result-status lambda. - Updated local Terraform to deploy the new lambda and added the new AWS SDK dependency to
lambdas/.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| local-environment/infra/main.tf | Adds local infra module for the HIV results processor lambda (API Gateway + env vars). |
| lambdas/src/hiv-result-processor-lambda/index.ts | New handler that parses Observation, branches on interpretation code, and invokes status lambda. |
| lambdas/src/hiv-result-processor-lambda/init.ts | DI wiring for commons + result status invocation service. |
| lambdas/src/hiv-result-processor-lambda/models.ts | Zod schema + interpretation/result mapping + shared identifier types. |
| lambdas/src/hiv-result-processor-lambda/validation.ts | Validation result typing helpers. |
| lambdas/src/hiv-result-processor-lambda/validation-service.ts | Observation parsing/validation and identifier extraction logic. |
| lambdas/src/hiv-result-processor-lambda/task-builder.ts | Builds a FHIR Task payload from an Observation. |
| lambdas/src/hiv-result-processor-lambda/result-status-lambda-service.ts | Wrapper around AWS Lambda Invoke for calling result-status lambda. |
| lambdas/src/hiv-result-processor-lambda/*.test.ts | Unit tests for init, handler, task builder, validation service, and invocation service. |
| lambdas/package.json | Adds @aws-sdk/client-lambda dependency. |
| lambdas/package-lock.json | Lockfile updates for the new dependency and transitive AWS SDK packages. |
Files not reviewed (1)
- lambdas/package-lock.json: Language not supported
lewisbirks
reviewed
Apr 20, 2026
Signed-off-by: lewisbirks <lewis.birks1@nhs.net>
Signed-off-by: lewisbirks <lewis.birks1@nhs.net>
- Import extraction functions from validation-service instead of duplicating - Type buildTaskFromObservation() return as FHIRTask - Type sendResult() parameter as FHIRTask and remove error handling (let caller handle it)
cptiv2020
approved these changes
Apr 27, 2026
|
❌ The last analysis has failed. |
…-result-processor # Conflicts: # lambdas/package.json # lambdas/pnpm-lock.yaml
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Implemented a new results processor lambda that invokes result status lambda after processing the test results.
Context
https://nhsd-jira.digital.nhs.uk/browse/HOTE-1099
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.