From 7970aed5ccf97f42234609959c0771f8a947458b Mon Sep 17 00:00:00 2001 From: SeanSteberis <103416906+seansteberisal@users.noreply.github.com> Date: Wed, 13 Aug 2025 12:50:20 +0100 Subject: [PATCH] added tests for 371 --- .env | 36 ---- .../AUTO_RSV_ELI-371.json | 182 ++++++++++++++++++ .../AUTO_RSV_ELI-371_001.json | 45 +++++ .../AUTO_RSV_ELI-371_002.json | 45 +++++ .../AUTO_RSV_ELI-371_001.json | 28 +++ .../AUTO_RSV_ELI-371_002.json | 28 +++ 6 files changed, 328 insertions(+), 36 deletions(-) delete mode 100644 .env create mode 100644 tests/e2e/data/configs/inProgressTestConfigs/AUTO_RSV_ELI-371.json create mode 100644 tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_001.json create mode 100644 tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_002.json create mode 100644 tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_001.json create mode 100644 tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_002.json diff --git a/.env b/.env deleted file mode 100644 index c28156440..000000000 --- a/.env +++ /dev/null @@ -1,36 +0,0 @@ -# AWS Services to Enable -SERVICES=s3,sqs,sns,dynamodb,lambda - -# Debug Mode (1 = Enable, 0 = Disable) -DEBUG=1 - -# Persistent Data Directory (inside container) -DATA_DIR=/tmp/localstack/data - -# Hostname for LocalStack -HOSTNAME=localstack - -# Lambda Function Executor ('docker' or 'local') -LAMBDA_EXECUTOR=docker - -# AWS Access Credentials (Dummy) -AWS_ACCESS_KEY_ID=test -AWS_SECRET_ACCESS_KEY=test - -# Default AWS Region -AWS_DEFAULT_REGION=us-east-1 - -# Docker Host for Lambda Execution -DOCKER_HOST=unix:///var/run/docker.sock - -# Optional: LocalStack Pro API Key (if using LocalStack Pro, leave empty if not) -LOCALSTACK_API_KEY= - -# Use SSL (0 = Disable, 1 = Enable) -USE_SSL=0 - -# Optional CORS Headers and Origins -EXTRA_CORS_ALLOWED_HEADERS= -EXTRA_CORS_ALLOWED_ORIGINS= - -DOCKER_HOST="unix://$HOME/.colima/docker.sock" diff --git a/tests/e2e/data/configs/inProgressTestConfigs/AUTO_RSV_ELI-371.json b/tests/e2e/data/configs/inProgressTestConfigs/AUTO_RSV_ELI-371.json new file mode 100644 index 000000000..fb60fdf42 --- /dev/null +++ b/tests/e2e/data/configs/inProgressTestConfigs/AUTO_RSV_ELI-371.json @@ -0,0 +1,182 @@ +{ + "CampaignConfig": { + "ID": "8fcb742b-45fa-4e0d-8f2f-9c2efb1f46d0", + "Version": 1, + "Name": "EliD RSV example config", + "Type": "V", + "Target": "RSV", + "Manager": [ + "person1@nhs.net" + ], + "Approver": [ + "person1@nhs.net" + ], + "Reviewer": [ + "person1@nhs.net" + ], + "IterationFrequency": "X", + "IterationType": "O", + "IterationTime": "07:00:00", + "StartDate": "20250717", + "EndDate": "20350717", + "ApprovalMinimum": 0, + "ApprovalMaximum": 0, + "DefaultCommsRouting": "PLACEHOLDER_COMMS_ROUTING", + "Iterations": [ + { + "ID": "8fcb742b-45fa-4e0d-8f2f-9c2efb1f46d1", + "DefaultCommsRouting": "BOOK_LOCAL|HELP_SUPPORT", + "DefaultNotActionableRouting": "", + "DefaultNotEligibleRouting": "CHECK_CORRECT_X", + "Version": 1, + "Name": "EliD RSV example config", + "IterationDate": "20250717", + "IterationNumber": 1, + "CommsType": "I", + "ApprovalMinimum": 0, + "ApprovalMaximum": 0, + "Type": "O", + "IterationCohorts": [ + { + "CohortLabel": "rsv_75to79", + "CohortGroup": "rsv_age", + "PositiveDescription": "are aged 75 to 79 years old", + "NegativeDescription": "are not aged 75 to 79 years old", + "Priority": 0 + }, + { + "CohortLabel": "rsv_80_since_02_Sept_2024", + "CohortGroup": "rsv_age_catchup", + "PositiveDescription": "turned 80 after 1st September 2024", + "NegativeDescription": "did not turn 80 after 1 September 2024", + "Priority": 10 + } + ], + "IterationRules": [ + { + "Type": "S", + "Name": "Testing of AND rules where names are different", + "Description": "Testing of AND rules where names are different", + "Operator": "=", + "Comparator": "19800501", + "AttributeLevel": "PERSON", + "AttributeName": "DATE_OF_BIRTH", + "CohortLabel": "rsv_75to79", + "Priority": 100 + }, + { + "Type": "S", + "Name": "This name is completely different but should still be AND to the one above", + "Description": "Testing of AND rules where names are different", + "Operator": "=", + "Comparator": "AAA", + "AttributeLevel": "PERSON", + "AttributeName": "ICB", + "CohortLabel": "rsv_75to79", + "Priority": 100 + }, + { + "Type": "S", + "Name": "This is a rule on it's own and not part of the AND rules above", + "Description": "Testing of AND rules where names are different", + "Operator": "=", + "Comparator": "19820501", + "AttributeLevel": "PERSON", + "AttributeName": "DATE_OF_BIRTH", + "CohortLabel": "rsv_75to79", + "Priority": 1000 + }, + { + "Type": "R", + "Name": "Actionable Future Booked NBS Appointment", + "Description": "Amend NBS future booking", + "Priority": 1000, + "Operator": "D>=", + "Comparator": "0", + "AttributeTarget": "RSV", + "AttributeLevel": "TARGET", + "AttributeName": "BOOKED_APPOINTMENT_DATE", + "CommsRouting": "AMEND_NBS" + }, + { + "Type": "R", + "Name": "Actionable Future Booked NBS Appointment", + "Description": "Amend NBS future booking", + "Priority": 1000, + "Operator": "=", + "Comparator": "NBS", + "AttributeTarget": "RSV", + "AttributeLevel": "TARGET", + "AttributeName": "BOOKED_APPOINTMENT_PROVIDER", + "CommsRouting": "AMEND_NBS" + } + ], + "ActionsMapper": { + "BOOK_NBS": { + "ExternalRoutingCode": "BookNBS", + "ActionDescription": "", + "ActionType": "ButtonWithAuthLink", + "UrlLink": "http://www.nhs.uk/book-rsv", + "UrlLabel": "Continue to booking" + }, + "AMEND_NBS": { + "ExternalRoutingCode": "AmendNBS", + "ActionDescription": "##You have an RSV vaccination appointment\nYou can view, change or cancel your appointment below.", + "ActionType": "ButtonWithAuthLink", + "UrlLink": "http://www.nhs.uk/book-rsv", + "UrlLabel": "Manage your appointment" + }, + "CONTACT_GP": { + "ExternalRoutingCode": "ContactGP", + "ActionDescription": "Contact your GP", + "ActionType": "InfoText", + "UrlLink": null, + "UrlLabel": "" + }, + "BOOK_LOCAL": { + "ExternalRoutingCode": "BookLocal", + "ActionDescription": "##Getting the vaccine\n\nYou can get an RSV vaccination at your GP surgery.\nYour GP surgery may contact you about getting the RSV vaccine. This may be by letter, text, phone call, email or through the NHS App. You do not need to wait to be contacted before booking your vaccination.", + "ActionType": "InfoText", + "UrlLink": null, + "UrlLabel": "" + }, + "MANAGE_LOCAL": { + "ExternalRoutingCode": "ManageLocal", + "ActionDescription": "##You have an RSV vaccination appointment\n\nContact your healthcare provider to change or cancel your appointment.", + "ActionType": "CardWithText", + "UrlLink": null, + "UrlLabel": "" + }, + "HELP_SUPPORT": { + "ExternalRoutingCode": "HelpSupportInfo", + "ActionDescription": "## CONTENT TBC\n\nBlah blah blah.", + "ActionType": "InfoText", + "UrlLink": null, + "UrlLabel": "" + }, + "CHECK_CORRECT_X": { + "ExternalRoutingCode": "HealthcareProInfo", + "ActionDescription": "## If you think this is incorrect\n\nSpeak to your healthcare professional if you think you should be offered this vaccine.\n\nFor anything else, visit our help and support page. (ADD LINK)", + "ActionType": "InfoText", + "UrlLink": null, + "UrlLabel": "" + }, + "CHECK_CORRECT_ALREADY_VACCINATED": { + "ExternalRoutingCode": "AlreadyVaccinatedInfo", + "ActionDescription": "## If you think this is incorrect\n\nIf you believe you've not been vaccinated against RSV, speak to your healthcare professional.\n\nFor anything else please see our help and support page. (ADD LINK).", + "ActionType": "InfoText", + "UrlLink": null, + "UrlLabel": "" + }, + "CHECK_CORRECT_OTHER_SETTING": { + "ExternalRoutingCode": "ManagedSettingInfo", + "ActionDescription": "## If you think this is incorrect\n\nIf you have already had this vaccination or your personal details are wrong, visit our help and support page. (ADD LINK).", + "ActionType": "InfoText", + "UrlLink": null, + "UrlLabel": "" + } + } + } + ] + } +} diff --git a/tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_001.json b/tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_001.json new file mode 100644 index 000000000..ad25ea5bd --- /dev/null +++ b/tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_001.json @@ -0,0 +1,45 @@ +{ + "scenario_name": "RSV - Ineligible - Suppressed by AND rule with different rule names", + "request_headers": { + "nhs-login-nhs-number": "9900037101" + }, + "config_filenames": [ + "AUTO_RSV_ELI-371.json" + ], + "data": [ + { + "NHS_NUMBER": "9900037101", + "ATTRIBUTE_TYPE": "COHORTS", + "COHORT_MEMBERSHIPS": [ + { + "COHORT_LABEL": "rsv_75to79", + "DATE_JOINED": "20231020" + } + ] + }, + { + "NHS_NUMBER": "9900037101", + "ATTRIBUTE_TYPE": "PERSON", + "DATE_OF_BIRTH": "19800501", + "GENDER": "0", + "POSTCODE": "SG8 6EG", + "POSTCODE_SECTOR": "SG86", + "POSTCODE_OUTCODE": "SG8", + "MSOA": "E02003792", + "LSOA": "E01018267", + "GP_PRACTICE_CODE": "D81046", + "PCN": "U75549", + "ICB": "AAA", + "COMMISSIONING_REGION": "Y61", + "13Q_FLAG": "N", + "CARE_HOME_FLAG": "N", + "DE_FLAG": "N" + }, + { + "NHS_NUMBER": "9900037101", + "ATTRIBUTE_TYPE": "RSV", + "BOOKED_APPOINTMENT_DATE": "<>", + "BOOKED_APPOINTMENT_PROVIDER": "NBS" + } + ] +} diff --git a/tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_002.json b/tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_002.json new file mode 100644 index 000000000..29b5a7e9d --- /dev/null +++ b/tests/e2e/data/dynamoDB/inProgressTestData/AUTO_RSV_ELI-371_002.json @@ -0,0 +1,45 @@ +{ + "scenario_name": "RSV - Ineligible - Suppressed by single rule using a different D.O.B.", + "request_headers": { + "nhs-login-nhs-number": "9900037101" + }, + "config_filenames": [ + "AUTO_RSV_ELI-371.json" + ], + "data": [ + { + "NHS_NUMBER": "9900037101", + "ATTRIBUTE_TYPE": "COHORTS", + "COHORT_MEMBERSHIPS": [ + { + "COHORT_LABEL": "rsv_75to79", + "DATE_JOINED": "20231020" + } + ] + }, + { + "NHS_NUMBER": "9900037101", + "ATTRIBUTE_TYPE": "PERSON", + "DATE_OF_BIRTH": "19810501", + "GENDER": "0", + "POSTCODE": "SG8 6EG", + "POSTCODE_SECTOR": "SG86", + "POSTCODE_OUTCODE": "SG8", + "MSOA": "E02003792", + "LSOA": "E01018267", + "GP_PRACTICE_CODE": "D81046", + "PCN": "U75549", + "ICB": "AAA", + "COMMISSIONING_REGION": "Y61", + "13Q_FLAG": "N", + "CARE_HOME_FLAG": "N", + "DE_FLAG": "N" + }, + { + "NHS_NUMBER": "9900037101", + "ATTRIBUTE_TYPE": "RSV", + "BOOKED_APPOINTMENT_DATE": "<>", + "BOOKED_APPOINTMENT_PROVIDER": "NBS" + } + ] +} diff --git a/tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_001.json b/tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_001.json new file mode 100644 index 000000000..387439f12 --- /dev/null +++ b/tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_001.json @@ -0,0 +1,28 @@ +{ + "meta": { + "lastUpdated": "" + }, + "processedSuggestions": [ + { + "actions": [], + "condition": "RSV", + "eligibilityCohorts": [ + { + "cohortCode": "rsv_age", + "cohortStatus": "NotActionable", + "cohortText": "are aged 75 to 79 years old" + } + ], + "status": "NotActionable", + "statusText": "You should have the RSV vaccine", + "suitabilityRules": [ + { + "ruleCode": "Testing of AND rules where names are different", + "ruleText": "Testing of AND rules where names are different", + "ruleType": "S" + } + ] + } + ], + "responseId": "" +} diff --git a/tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_002.json b/tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_002.json new file mode 100644 index 000000000..387439f12 --- /dev/null +++ b/tests/e2e/data/responses/inProgressTestResponses/AUTO_RSV_ELI-371_002.json @@ -0,0 +1,28 @@ +{ + "meta": { + "lastUpdated": "" + }, + "processedSuggestions": [ + { + "actions": [], + "condition": "RSV", + "eligibilityCohorts": [ + { + "cohortCode": "rsv_age", + "cohortStatus": "NotActionable", + "cohortText": "are aged 75 to 79 years old" + } + ], + "status": "NotActionable", + "statusText": "You should have the RSV vaccine", + "suitabilityRules": [ + { + "ruleCode": "Testing of AND rules where names are different", + "ruleText": "Testing of AND rules where names are different", + "ruleType": "S" + } + ] + } + ], + "responseId": "" +}