Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: [AEA-3935] - add get status update lambda #98

Merged
merged 44 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e7a1491
add gsul
anthony-nhs Mar 27, 2024
520a228
start testing
anthony-nhs Mar 27, 2024
e4c33d9
more tests
anthony-nhs Mar 27, 2024
0f0d733
more tests
anthony-nhs Mar 28, 2024
3178e95
reset changes in prepartion for merge conflict
anthony-nhs Mar 28, 2024
11c1aba
add new package to sonar
anthony-nhs Mar 28, 2024
942555e
run gsul tests
anthony-nhs Mar 28, 2024
0d44d97
sonar stuff
anthony-nhs Mar 28, 2024
f801666
tests for handler
anthony-nhs Mar 28, 2024
a853093
add some comments
anthony-nhs Mar 28, 2024
51732c4
wording
anthony-nhs Mar 28, 2024
0cab29e
better test
anthony-nhs Mar 28, 2024
1f90595
Merge branch 'main' into add_gsul
anthony-nhs Mar 29, 2024
1014799
Merge remote-tracking branch 'origin/main' into add_gsul
anthony-nhs Apr 8, 2024
270de5a
deploy lambda
anthony-nhs Apr 8, 2024
5879fef
use pull request splunk
anthony-nhs Apr 9, 2024
34aa6e3
use normal splunk
anthony-nhs Apr 9, 2024
f94bb3b
use a new log group name for state machine
anthony-nhs Apr 9, 2024
a6c68bf
Merge remote-tracking branch 'origin/main' into add_gsul
anthony-nhs Apr 9, 2024
fb3c8da
more log policies for state machine
anthony-nhs Apr 9, 2024
397f4a0
Merge branch 'main' into add_gsul
anthony-nhs Apr 9, 2024
da73b49
add export for GSUL arn
anthony-nhs Apr 12, 2024
41fc4ff
merge latest main
anthony-nhs Apr 15, 2024
2805b79
use correct index name
anthony-nhs Apr 15, 2024
9ab16e4
add prettier-eslint
anthony-nhs Apr 15, 2024
133edeb
Merge remote-tracking branch 'origin/main' into add_gsul
anthony-nhs Apr 17, 2024
af7c800
trigger build
anthony-nhs Apr 17, 2024
847be86
Merge branch 'main' into add_gsul
anthony-nhs Apr 17, 2024
87ced49
use pr fhir validator
anthony-nhs Apr 17, 2024
0bd5fb6
pass full request to validator
anthony-nhs Apr 17, 2024
8684086
rollback tests
anthony-nhs Apr 18, 2024
21432f4
log correlation keys
anthony-nhs Apr 18, 2024
c1e08f0
rename lambda
anthony-nhs Apr 18, 2024
fa2e468
correct export name
anthony-nhs Apr 18, 2024
2a81492
Merge remote-tracking branch 'origin/main' into add_gsul
anthony-nhs Apr 18, 2024
cded1ca
changes following feedback
anthony-nhs Apr 23, 2024
554605c
Merge branch 'main' into add_gsul
anthony-nhs Apr 23, 2024
3e39585
Merge remote-tracking branch 'origin/main' into add_gsul
anthony-nhs Apr 23, 2024
12a817a
Simplified GSUL dedup logic and dynamo interface.
MatthewPopat-NHS Apr 23, 2024
c8b49f1
Merge remote-tracking branch 'origin/main' into add_gsul
MatthewPopat-NHS Apr 23, 2024
19e3975
avoid for loop
anthony-nhs Apr 23, 2024
eda9dea
parse date
anthony-nhs Apr 23, 2024
1241bfc
correct logging
anthony-nhs Apr 23, 2024
f0febcd
simplify things even further
anthony-nhs Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/eps-prescription-status-update-api.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"name": "packages/updatePrescriptionStatus",
"path": "../packages/updatePrescriptionStatus"
},
{
"name": "packages/gsul",
"path": "../packages/gsul"
},
{
"name": "packages/sandbox",
"path": "../packages/sandbox"
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ compile: compile-node
lint-node: compile-node
npm run lint --workspace packages/specification
npm run lint --workspace packages/updatePrescriptionStatus
npm run lint --workspace packages/gsul
npm run lint --workspace packages/sandbox

lint-samtemplates:
Expand All @@ -117,6 +118,7 @@ lint: lint-node lint-samtemplates lint-python lint-githubactions lint-githubacti

test: compile
npm run test --workspace packages/updatePrescriptionStatus
npm run test --workspace packages/gsul
npm run test --workspace packages/sandbox
npm run test --workspace packages/specification

Expand Down
67 changes: 58 additions & 9 deletions SAMtemplates/functions/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AWSTemplateFormatVersion: '2010-09-09'
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: |
PSU lambda functions and related resources
Expand All @@ -12,25 +12,25 @@ Globals:
Runtime: nodejs20.x
Environment:
Variables:
NODE_OPTIONS: '--enable-source-maps'
NODE_OPTIONS: "--enable-source-maps"
Layers:
- !Sub arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension:49

Parameters:
StackName:
Type: String
Default: none

PrescriptionStatusUpdatesTableName:
Type: String
Default: none

LogLevel:
Type: String

LogRetentionInDays:
Type: Number

EnableSplunk:
Type: String

Expand All @@ -55,7 +55,7 @@ Resources:
tsconfig: updatePrescriptionStatus/tsconfig.json
EntryPoints:
- updatePrescriptionStatus/src/updatePrescriptionStatus.ts

UpdatePrescriptionStatusResources:
Type: AWS::Serverless::Application
Properties:
Expand All @@ -66,19 +66,68 @@ Resources:
LambdaArn: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${StackName}-UpdatePrescriptionStatus
IncludeAdditionalPolicies: true
AdditionalPolicies: !Join
- ','
- ","
- - Fn::ImportValue: !Sub ${StackName}:tables:${PrescriptionStatusUpdatesTableName}:TableWritePolicyArn
LogRetentionInDays: !Ref LogRetentionInDays
CloudWatchKMSKeyId: !ImportValue account-resources:CloudwatchLogsKmsKeyArn
EnableSplunk: !Ref EnableSplunk
SplunkSubscriptionFilterRole: !ImportValue lambda-resources:SplunkSubscriptionFilterRole
SplunkDeliveryStreamArn: !ImportValue lambda-resources:SplunkDeliveryStream

GetStatusUpdates:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub ${StackName}-GetStatusUpdates
CodeUri: ../../packages
Handler: getStatusUpdates.handler
Role: !GetAtt GetStatusUpdatesResources.Outputs.LambdaRoleArn
Environment:
Variables:
TABLE_NAME: !Ref PrescriptionStatusUpdatesTableName
LOG_LEVEL: !Ref LogLevel
Metadata:
BuildMethod: esbuild
BuildProperties:
Minify: true
Target: es2020
Sourcemap: true
tsconfig: gsul/tsconfig.json
EntryPoints:
- gsul/src/getStatusUpdates.ts

GetStatusUpdatesResources:
Type: AWS::Serverless::Application
Properties:
Location: lambda_resources.yaml
Parameters:
StackName: !Ref StackName
LambdaName: !Sub ${StackName}-GetStatusUpdates
LambdaArn: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${StackName}-GetStatusUpdates
IncludeAdditionalPolicies: true
AdditionalPolicies: !Join
- ","
- - Fn::ImportValue: !Sub ${StackName}:tables:${PrescriptionStatusUpdatesTableName}:TableReadPolicyArn
LogRetentionInDays: !Ref LogRetentionInDays
CloudWatchKMSKeyId: !ImportValue account-resources:CloudwatchLogsKmsKeyArn
EnableSplunk: !Ref EnableSplunk
SplunkSubscriptionFilterRole: !ImportValue lambda-resources:SplunkSubscriptionFilterRole
SplunkDeliveryStreamArn: !ImportValue lambda-resources:SplunkDeliveryStream

Outputs:
UpdatePrescriptionStatusFunctionName:
Description: The function name of the UpdatePrescriptionStatus lambda
Value: !Ref UpdatePrescriptionStatus

UpdatePrescriptionStatusFunctionArn:
Description: The function ARN of the UpdatePrescriptionStatus lambda
Value: !GetAtt UpdatePrescriptionStatus.Arn
Value: !GetAtt UpdatePrescriptionStatus.Arn

GetStatusUpdatesFunctionName:
Description: The function name of the GetStatusUpdates lambda
Value: !Ref GetStatusUpdates

GetStatusUpdatesFunctionArn:
Description: The function ARN of the GetStatusUpdates lambda
Value: !GetAtt GetStatusUpdates.Arn
Export:
Name: !Sub ${StackName}:functions:GetStatusUpdates:FunctionArn
Loading