From 8da15b486c2103e59b212d909cdfd0ad38d85826 Mon Sep 17 00:00:00 2001 From: anthony-nhs <121869075+anthony-nhs@users.noreply.github.com> Date: Thu, 9 May 2024 08:28:19 +0100 Subject: [PATCH] Fix: [AEA-4049] - pass headers and body to FHIR validator lambda (#150) ## Summary - Routine Change ### Details - pass body and headers to FHIR validator lambda --- .../UpdatePrescriptionStatusStateMachine.asl.json | 2 +- SAMtemplates/state_machines/main.yaml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/SAMtemplates/state_machines/UpdatePrescriptionStatusStateMachine.asl.json b/SAMtemplates/state_machines/UpdatePrescriptionStatusStateMachine.asl.json index b7c59489f..f1efcd39d 100644 --- a/SAMtemplates/state_machines/UpdatePrescriptionStatusStateMachine.asl.json +++ b/SAMtemplates/state_machines/UpdatePrescriptionStatusStateMachine.asl.json @@ -15,7 +15,7 @@ "NumberFailedValidation.$": "States.ArrayLength($.Payload.issue[?(@.severity ==error)])" }, "Next": "Do FHIR Validation Errors Exist", - "InputPath": "$.body", + "InputPath": "$", "Catch": [ { "ErrorEquals": [ diff --git a/SAMtemplates/state_machines/main.yaml b/SAMtemplates/state_machines/main.yaml index fb9e6a3fc..4254779d9 100644 --- a/SAMtemplates/state_machines/main.yaml +++ b/SAMtemplates/state_machines/main.yaml @@ -22,6 +22,10 @@ Parameters: EnableSplunk: Type: String + FihrValidatorStackName: + Type: String + Default: fhir-validator + Resources: UpdatePrescriptionStatusStateMachine: Type: AWS::Serverless::StateMachine @@ -33,7 +37,7 @@ Resources: DefinitionSubstitutions: FhirValidationFunctionArn: !Join - ":" - - - !ImportValue fhir-validator:FHIRValidatorUKCoreLambdaArn + - - Fn::ImportValue: !Sub ${FihrValidatorStackName}:FHIRValidatorUKCoreLambdaArn - snap UpdatePrescriptionStatusFunctionArn: !Sub ${UpdatePrescriptionStatusFunctionArn}:$LATEST Logging: @@ -56,7 +60,7 @@ Resources: AdditionalPolicies: !Join - "," - - Fn::ImportValue: !Sub ${StackName}:functions:${UpdatePrescriptionStatusFunctionName}:ExecuteLambdaPolicyArn - - !ImportValue fhir-validator:FHIRValidatorUKCoreExecuteLambdaPolicyArn + - Fn::ImportValue: !Sub ${FihrValidatorStackName}:FHIRValidatorUKCoreExecuteLambdaPolicyArn LogRetentionInDays: !Ref LogRetentionInDays CloudWatchKMSKeyId: !ImportValue account-resources:CloudwatchLogsKmsKeyArn EnableSplunk: !Ref EnableSplunk