Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@

export const runnerBasedEpic3MedTestScenariosAdd = "@DTOSS-4967-01|@DTOSS-4975-01|@DTOSS-6325-01|@DTOSS-5374-01|@DTOSS-6320-01|@DTOSS-5578-01|@DTOSS-5582-01"

export const runnerBasedEpic3MedTestScenariosAmend = "@DTOSS-5286-01|@DTOSS-5579-01|@DTOSS-5799-01|@DTOSS-5800-01|@DTOSS-5583-01|@DTOSS-5409-01"
export const runnerBasedEpic3MedTestScenariosAmend = "@DTOSS-5286-01|@DTOSS-5579-01|@DTOSS-5799-01|@DTOSS-5800-01|@DTOSS-5583-01"
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { expect, test } from '../../fixtures/test-fixtures';
import { validateSqlDatabaseFromAPI } from "../../steps/steps";
import { getRecordsFromCohortDistributionService } from '../../../api/dataService/cohortDistributionService';
import { TestHooks } from '../../hooks/test-hooks';
import { testWithAmended, testWithTwoAmendments } from '../../fixtures/test-fixtures';
import { processFileViaStorage, verifyBlobExists } from "../../steps/steps";


test.describe('@regression @e2e @epic3-med-priority Tests', () => {
test.describe('@regression @e2e @epic3-med Tests', () => {

TestHooks.setupAddTestHooks();
test('@DTOSS-5561-01 @not-runner-based @bs-select - CohortDistribution_Requesting data from Cohort Manager and set record to extracted and add the request ID to the data table', {
Expand Down Expand Up @@ -75,7 +77,49 @@ test.describe('@regression @e2e @epic3-med-priority Tests', () => {

});

});
testWithTwoAmendments('@DTOSS-5409-01 @not-runner-based @bs-select Provide Cohort to BS Select - Transformation_RFR_Rule_4_RDR', {
/*
Note: To be able to test Rule4 validation successfully, Rule54 must be prevented by setting IgnoreParticipantException to true.
As a workaround for test, the expectation for validation should be as below.

"RuleId":54,
"RuleDescription":"ValidateBsoCode"

And should be replace with below with the new solution in the AMENDED2 Test File.

"RuleId":0,
"RuleDescription":"4.ParticipantNotRegisteredToGPWithReasonForRemoval"
*/

annotation: {
type: 'Requirement',
description: 'Tests - https://nhsd-jira.digital.nhs.uk/browse/DTOSS-4577',
},
}, async ({ request, testData }) => {
await test.step(`When ADD participant is processed via storage`, async () => {
await processFileViaStorage(testData.runTimeParquetFileAdd);
});

await test.step(`Then ADD record should be updated in the cohort`, async () => {
await validateSqlDatabaseFromAPI(request, testData.checkInDatabaseAdd);
});

await test.step(`When same ADD participant record is AMENDED via storage for ${testData.nhsNumberAmend}`, async () => {
await processFileViaStorage(testData.runTimeParquetFileAmend);
});

await test.step(`Then the record should end up in exception management`, async () => {
await validateSqlDatabaseFromAPI(request, testData.checkInDatabaseAmend);
});

await test.step(`When same ADD participant record is AMENDED via storage for ${testData.nhsNumberAmend}`, async () => {
await processFileViaStorage(testData.runTimeParquetFileSecondAmend);
});

await test.step(`Then the record should end up in exception management`, async () => {
await validateSqlDatabaseFromAPI(request, testData.checkInDatabaseSecondAmend);
});

});

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"validations": [
{
"validations": {
"apiEndpoint": "api/CohortDistributionDataService",
"NHSNumber":9997322886,
"expectedCount": 1
}
}
],
"inputParticipantRecord": [
{
"record_type": "ADD",
"change_time_stamp": null,
"serial_change_number": 1,
"nhs_number": 9997322886,
"superseded_by_nhs_number": null,
"primary_care_provider": "E85121",
"primary_care_effective_from_date": "20130319",
"current_posting": "DMS",
"current_posting_effective_from_date": "20130319",
"name_prefix": "A.ML",
"given_name": "NewTest1",
"other_given_name": "Test",
"family_name": "Adani1",
"previous_family_name": "Test2",
"date_of_birth": "19700101",
"gender": 1,
"address_line_1": "247 SpaightSpaightSpTeeeeeeest Road",
"address_line_2": "Eastbourne",
"address_line_3": "Test",
"address_line_4": "Chelmsford",
"address_line_5": "United Kingdom",
"postcode": "B20 1AF",
"paf_key": "Z3S4Q5X8",
"address_effective_from_date": "20240501",
"reason_for_removal": null,
"reason_for_removal_effective_from_date": null,
"date_of_death": null,
"death_status": null,
"home_telephone_number": "01619999999",
"home_telephone_effective_from_date": "20240501",
"mobile_telephone_number": "07888888888",
"mobile_telephone_effective_from_date": "20240501",
"email_address": "bturneux0@soup.io",
"email_address_effective_from_date": "20240501",
"preferred_language": "en",
"is_interpreter_required": false,
"invalid_flag": false,
"eligibility": true
}
],
"nhsNumbers": [
"9997322886"
]
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"validations": [
{
"validations": {
"apiEndpoint": "api/CohortDistributionDataService",
"NHSNumber":9997322886,
"PrimaryCareProvider": null,
"ReasonForRemoval": "SDN",
"expectedCount": 2
}
}
],
"inputParticipantRecord": [
{
"record_type": "AMENDED",
"change_time_stamp": null,
"serial_change_number": 2,
"nhs_number": 9997322886,
"superseded_by_nhs_number": null,
"primary_care_provider": null,
"primary_care_effective_from_date": null,
"current_posting": "DMS",
"current_posting_effective_from_date": "20130319",
"name_prefix": "A.ML",
"given_name": "NewTest1",
"other_given_name": "Test",
"family_name": "Adani1",
"previous_family_name": "Test2",
"date_of_birth": "19710101",
"gender": 1,
"address_line_1": "247 SpaightSpaightSpTeeeeeeest Road",
"address_line_2": "Eastbourne",
"address_line_3": "Test",
"address_line_4": "Chelmsford",
"address_line_5": "United Kingdom",
"postcode": "B20 1AF",
"paf_key": "Z3S4Q5X8",
"address_effective_from_date": "20240501",
"reason_for_removal": "SDN",
"reason_for_removal_effective_from_date": "20250801",
"date_of_death": null,
"death_status": null,
"home_telephone_number": "016199999990",
"home_telephone_effective_from_date": "20240501",
"mobile_telephone_number": "07888888888",
"mobile_telephone_effective_from_date": "20240501",
"email_address": "bturneux0@soup.io",
"email_address_effective_from_date": "20240501",
"preferred_language": "en",
"is_interpreter_required": false,
"invalid_flag": false,
"eligibility": true
}
],
"nhsNumbers": [
"9997322886"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"validations": [
{
"validations": {
"apiEndpoint": "api/ExceptionManagementDataService",
"NhsNumber":"9997322886",
"RuleId":54,
"RuleDescription":"ValidateBsoCode"
}
}
],
"inputParticipantRecord": [
{
"record_type": "AMENDED",
"change_time_stamp": null,
"serial_change_number": 3,
"nhs_number": 9997322886,
"superseded_by_nhs_number": null,
"primary_care_provider": null,
"primary_care_effective_from_date": null,
"current_posting": "DMS",
"current_posting_effective_from_date": "20130319",
"name_prefix": "A.ML",
"given_name": "NewTest1",
"other_given_name": "Test",
"family_name": "Adani1",
"previous_family_name": "Test2",
"date_of_birth": "19710101",
"gender": 1,
"address_line_1": "247 SpaightSpaightSpTeeeeeeest Road",
"address_line_2": "Eastbourne",
"address_line_3": "Test",
"address_line_4": "Chelmsford",
"address_line_5": "United Kingdom",
"postcode": null,
"paf_key": "Z3S4Q5X8",
"address_effective_from_date": "20240501",
"reason_for_removal": "RDR",
"reason_for_removal_effective_from_date": "20250802",
"date_of_death": null,
"death_status": null,
"home_telephone_number": "016199999990",
"home_telephone_effective_from_date": "20240501",
"mobile_telephone_number": "07888888888",
"mobile_telephone_effective_from_date": "20240501",
"email_address": "bturneux0@soup.io",
"email_address_effective_from_date": "20240501",
"preferred_language": "en",
"is_interpreter_required": false,
"invalid_flag": false,
"eligibility": true
}
],
"nhsNumbers": [
"9997322886"
]
}

This file was deleted.

Loading