Skip to content

[HOTE-1099] feat: Results processor#386

Open
lauren5656 wants to merge 26 commits intomainfrom
feature/hote-1099/hiv-result-processor
Open

[HOTE-1099] feat: Results processor#386
lauren5656 wants to merge 26 commits intomainfrom
feature/hote-1099/hiv-result-processor

Conversation

@lauren5656
Copy link
Copy Markdown

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

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

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.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

Copilot AI review requested due to automatic review settings April 20, 2026 11:05
@lauren5656 lauren5656 changed the title Feature/hote 1099/hiv result processor [HOTE-1099] feat: Results processor Apr 20, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Lambdas Coverage Report

Lines Statements Branches Functions
Coverage: 98%
98.04% (2161/2204) 91.67% (606/661) 96.56% (366/379)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

UI Coverage Report

Lines Statements Branches Functions
Coverage: 96%
96.32% (5927/6153) 88.4% (724/819) 88.44% (222/251)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-lambda to 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

Comment thread lambdas/src/hiv-result-processor-lambda/validation-service.test.ts Outdated
Comment thread lambdas/package.json Outdated
Comment thread local-environment/infra/main.tf Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/task-builder.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/result-status-lambda-service.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/result-status-lambda-service.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread local-environment/infra/main.tf Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/result-status-lambda-service.ts Outdated
Signed-off-by: lewisbirks <lewis.birks1@nhs.net>
Signed-off-by: lewisbirks <lewis.birks1@nhs.net>
Comment thread lambdas/src/hiv-result-processor-lambda/task-builder.ts Fixed
Comment thread lambdas/src/hiv-result-processor-lambda/task-builder.ts Fixed
Copilot AI review requested due to automatic review settings April 23, 2026 11:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 14 comments.

Files not reviewed (1)
  • lambdas/package-lock.json: Language not supported

Comment thread lambdas/src/lib/http/lambda-http-client.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/task-builder.ts Outdated
Comment thread local-environment/infra/main.tf Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/task-builder.test.ts
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread .github/instructions/lambdas.instructions.md Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.test.ts
Comment thread lambdas/src/hiv-result-processor-lambda/validation-service.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/models.ts Outdated
- 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)
Comment thread lambdas/src/hiv-result-processor-lambda/task-builder.ts Fixed
Copilot AI review requested due to automatic review settings April 23, 2026 13:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 9 comments.

Files not reviewed (1)
  • lambdas/package-lock.json: Language not supported

Comment thread lambdas/src/lib/http/lambda-http-client.ts Outdated
Comment thread lambdas/src/lib/http/lambda-http-client.ts Outdated
Comment thread lambdas/src/lib/http/lambda-http-client.ts
Comment thread lambdas/src/hiv-result-processor-lambda/result-status-lambda-service.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/result-status-lambda-service.test.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/task-builder.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/validation-service.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.test.ts
Copilot AI review requested due to automatic review settings April 23, 2026 13:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • lambdas/package-lock.json: Language not supported

Comment thread lambdas/src/hiv-result-processor-lambda/index.ts
Comment thread lambdas/src/hiv-result-processor-lambda/result-status-lambda-service.ts Outdated
Comment thread lambdas/src/lib/http/lambda-http-client.ts Outdated
Copilot AI review requested due to automatic review settings April 24, 2026 13:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • lambdas/package-lock.json: Language not supported

Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread local-environment/infra/main.tf Outdated
Comment thread lambdas/src/order-result-lambda/validation-service.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Copilot AI review requested due to automatic review settings April 24, 2026 14:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • lambdas/pnpm-lock.yaml: Language not supported

Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/init.ts
Copilot AI review requested due to automatic review settings April 27, 2026 08:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 23 changed files in this pull request and generated 9 comments.

Files not reviewed (1)
  • lambdas/pnpm-lock.yaml: Language not supported

Comment thread lambdas/src/order-result-lambda/validation-service.ts
Comment thread local-environment/infra/main.tf
Comment thread lambdas/src/lib/fhir-observation-extractors/index.ts
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts
Comment thread lambdas/src/lib/fhir-observation-extractors/index.ts
Comment thread lambdas/src/lib/fhir-observation-extractors/index.ts
Comment thread lambdas/src/hiv-result-processor-lambda/services/result-status-lambda-service.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/index.ts Outdated
Comment thread lambdas/src/hiv-result-processor-lambda/init.test.ts
Copilot AI review requested due to automatic review settings April 27, 2026 09:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 24 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • lambdas/pnpm-lock.yaml: Language not supported

Comment thread lambdas/src/lib/fhir-observation-extractors/index.ts
Comment thread local-environment/infra/main.tf
Copilot AI review requested due to automatic review settings April 27, 2026 10:05
@sonarqubecloud
Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 26 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • lambdas/pnpm-lock.yaml: Language not supported

Comment thread lambdas/src/lib/fhir-observation-extractors/index.ts
Comment thread local-environment/infra/main.tf
Comment thread lambdas/src/lib/fhir-observation-extractors/index.ts
Comment thread lambdas/src/lib/fhir-observation-extractors/index.ts
…-result-processor

# Conflicts:
#	lambdas/package.json
#	lambdas/pnpm-lock.yaml
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants