From f87ee126520d24f3efcda7f24c546186fe36f57e Mon Sep 17 00:00:00 2001 From: will-larkin <160748088+will-larkin-nhs@users.noreply.github.com> Date: Fri, 29 Aug 2025 09:47:51 +0100 Subject: [PATCH 1/5] test: VHR flag tests --- .../epic4c-testsuite-migrated.ts | 2 +- ...1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json diff --git a/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts b/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts index bb9d1b191f..d73da6ecb3 100644 --- a/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts +++ b/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts @@ -30,6 +30,6 @@ export const runnerBasedEpic4cTestScenariosAdd = "@DTOSS-9337-01"; export const runnerBasedEpic4cTestScenariosAmend = "@DTOSS-9337-01"; // export const runnerBasedEpic4cTestScenariosManualAdd = ""; -export const runnerBasedEpic4cTestScenariosManualAdd = "@DTOSS-3883-01|@DTOSS-8484-01|@DTOSS-9614-01|@DTOSS-8375-01"; +export const runnerBasedEpic4cTestScenariosManualAdd = "@DTOSS-3883-01|@DTOSS-8484-01|@DTOSS-9614-01|@DTOSS-8375-01|@DTOSS-9706-01"; export const runnerBasedEpic4cTestScenariosManualAmend = "@DTOSS-8483-01|@DTOSS-9614-01"; //export const runnerBasedEpic4cTestScenariosManualAmend = ""; diff --git a/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json new file mode 100644 index 0000000000..59ce4f162f --- /dev/null +++ b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json @@ -0,0 +1,33 @@ +{ + "validations": [ + { + "validations": { + "apiEndpoint": "api/ParticipantManagementDataService", + "NHSNumber": 9994045571, + "IsHigherRisk": "1" + }, + "meta": { + "testJiraId": "@DTOSS-9706-01", + "requirementJiraId": "@DTOSS-9706-01", + "additionalTags": "@DTOSS-9706-01 @e2e @epic4c- Verify that VHR flag is set to true in the participant management table when reason_for_adding is set to eligible_for_very_high_risk_breast_screening_referral_form_must_be_attached" + } + } + ], + "inputParticipantRecord": [ + { + "number": "CS0573848", + "u_case_variable_data": { + "nhs_number": "9994045571", + "forename_": "Jane", + "surname_family_name": "Smith", + "date_of_birth": "1980-10-22", + "enter_dummy_gp_code": "ZZZDKL", + "BSO_code": "NORTH NOTTINGHAMSHIRE BREAST SCREENING OFFICE", + "reason_for_adding": "eligible_for_very_high_risk_breast_screening_referral_form_must_be_attached" + } + } + ], + "nhsNumbers": [ + "9994045571" + ] +} From 4b0ce4318a41523db31cd99f55f2bdd6765de897 Mon Sep 17 00:00:00 2001 From: will-larkin <160748088+will-larkin-nhs@users.noreply.github.com> Date: Fri, 29 Aug 2025 17:22:16 +0100 Subject: [PATCH 2/5] test: VHR flag tests --- .../complete-patient-9990841780.json | 390 ++++++++++++++++++ .../complete-patient-9992886412.json | 390 ++++++++++++++++++ .../ManageParticipant/ManageParticipant.cs | 5 +- .../src/Functions/Shared/Model/Participant.cs | 26 ++ .../epic4c-testsuite-migrated.ts | 4 +- ...1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json | 8 +- ...1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json | 61 +++ ...1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json | 33 ++ 8 files changed, 907 insertions(+), 10 deletions(-) create mode 100644 application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9990841780.json create mode 100644 application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9992886412.json create mode 100644 tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/AMENDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json create mode 100644 tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json diff --git a/application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9990841780.json b/application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9990841780.json new file mode 100644 index 0000000000..e9bc7c3af5 --- /dev/null +++ b/application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9990841780.json @@ -0,0 +1,390 @@ +{ + "resourceType": "Patient", + "id": "9990841780", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9990841780", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatus", + "version": "1.0.0", + "code": "01", + "display": "Number present and verified" + } + ] + } + } + ] + } + ], + "meta": { + "versionId": "2", + "security": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code": "U", + "display": "unrestricted" + } + ] + }, + "name": [ + { + "id": "123", + "use": "usual", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "given": [ + "Jane" + ], + "family": "Smith", + "prefix": [ + "Mrs" + ] + } + ], + "gender": "female", + "birthDate": "1980-10-22", + "multipleBirthInteger": 1, + "deceasedDateTime": "2010-10-22T00:00:00+00:00", + "generalPractitioner": [ + { + "id": "254406A3", + "type": "Organization", + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y12345", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + } + } + } + ], + "managingOrganization": { + "type": "Organization", + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y12345", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + } + } + }, + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NominatedPharmacy", + "valueReference": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y12345" + } + } + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-PreferredDispenserOrganization", + "valueReference": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y23456" + } + } + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MedicalApplianceSupplier", + "valueReference": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y34567" + } + } + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus", + "extension": [ + { + "url": "deathNotificationStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-DeathNotificationStatus", + "version": "1.0.0", + "code": "2", + "display": "Formal - death notice received from Registrar of Deaths" + } + ] + } + }, + { + "url": "systemEffectiveDate", + "valueDateTime": "2010-10-22T00:00:00+00:00" + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSCommunication", + "extension": [ + { + "url": "language", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-HumanLanguage", + "version": "1.0.0", + "code": "fr", + "display": "French" + } + ] + } + }, + { + "url": "interpreterRequired", + "valueBoolean": true + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference", + "extension": [ + { + "url": "PreferredWrittenCommunicationFormat", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredWrittenCommunicationFormat", + "code": "12", + "display": "Braille" + } + ] + } + }, + { + "url": "PreferredContactMethod", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredContactMethod", + "code": "1", + "display": "Letter" + } + ] + } + }, + { + "url": "PreferredContactTimes", + "valueString": "Not after 7pm" + } + ] + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + "valueAddress": { + "city": "Manchester", + "district": "Greater Manchester", + "country": "GBR" + } + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-PDS-RemovalFromRegistration", + "extension": [ + { + "url": "removalFromRegistrationCode", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/PDS-RemovalReasonExitCode", + "code": "SCT", + "display": "Transferred to Scotland" + } + ] + } + }, + { + "url": "effectiveTime", + "valuePeriod": { + "start": "2020-01-01T00:00:00+00:00", + "end": "2021-12-31T00:00:00+00:00" + } + } + ] + } + ], + "telecom": [ + { + "id": "789", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "system": "phone", + "value": "01632960587", + "use": "home" + }, + { + "id": "790", + "period": { + "start": "2019-01-01", + "end": "2022-12-31" + }, + "system": "email", + "value": "jane.smith@example.com", + "use": "home" + }, + { + "id": "OC789", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "system": "other", + "value": "01632960587", + "use": "home", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-OtherContactSystem", + "code": "textphone", + "display": "Minicom (Textphone)" + } + } + ] + } + ], + "contact": [ + { + "id": "C123", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "C", + "display": "Emergency Contact" + } + ] + } + ], + "telecom": [ + { + "system": "phone", + "value": "01632960587" + } + ] + } + ], + "address": [ + { + "id": "456", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "use": "home", + "line": [ + "1 Trevelyan Square", + "Boar Lane", + "City Centre", + "Leeds", + "West Yorkshire" + ], + "postalCode": "LS1 6AE", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "PAF" + } + }, + { + "url": "value", + "valueString": "12345678" + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "UPRN" + } + }, + { + "url": "value", + "valueString": "123456789012" + } + ] + } + ] + }, + { + "id": "T456", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "use": "temp", + "text": "Student Accommodation", + "line": [ + "1 Trevelyan Square", + "Boar Lane", + "City Centre", + "Leeds", + "West Yorkshire" + ], + "postalCode": "LS1 6AE", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "PAF" + } + }, + { + "url": "value", + "valueString": "12345678" + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "UPRN" + } + }, + { + "url": "value", + "valueString": "123456789012" + } + ] + } + ] + } + ] +} diff --git a/application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9992886412.json b/application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9992886412.json new file mode 100644 index 0000000000..90c72a2ec1 --- /dev/null +++ b/application/CohortManager/src/Functions/DemographicServices/RetrievePDSDemographic/MockedPDSData/complete-patient-9992886412.json @@ -0,0 +1,390 @@ +{ + "resourceType": "Patient", + "id": "9992886412", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9992886412", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatus", + "version": "1.0.0", + "code": "01", + "display": "Number present and verified" + } + ] + } + } + ] + } + ], + "meta": { + "versionId": "2", + "security": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality", + "code": "U", + "display": "unrestricted" + } + ] + }, + "name": [ + { + "id": "123", + "use": "usual", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "given": [ + "Jane" + ], + "family": "Smith", + "prefix": [ + "Mrs" + ] + } + ], + "gender": "female", + "birthDate": "1980-10-22", + "multipleBirthInteger": 1, + "deceasedDateTime": "2010-10-22T00:00:00+00:00", + "generalPractitioner": [ + { + "id": "254406A3", + "type": "Organization", + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y12345", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + } + } + } + ], + "managingOrganization": { + "type": "Organization", + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y12345", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + } + } + }, + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NominatedPharmacy", + "valueReference": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y12345" + } + } + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-PreferredDispenserOrganization", + "valueReference": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y23456" + } + } + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MedicalApplianceSupplier", + "valueReference": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y34567" + } + } + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus", + "extension": [ + { + "url": "deathNotificationStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-DeathNotificationStatus", + "version": "1.0.0", + "code": "2", + "display": "Formal - death notice received from Registrar of Deaths" + } + ] + } + }, + { + "url": "systemEffectiveDate", + "valueDateTime": "2010-10-22T00:00:00+00:00" + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSCommunication", + "extension": [ + { + "url": "language", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-HumanLanguage", + "version": "1.0.0", + "code": "fr", + "display": "French" + } + ] + } + }, + { + "url": "interpreterRequired", + "valueBoolean": true + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference", + "extension": [ + { + "url": "PreferredWrittenCommunicationFormat", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredWrittenCommunicationFormat", + "code": "12", + "display": "Braille" + } + ] + } + }, + { + "url": "PreferredContactMethod", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredContactMethod", + "code": "1", + "display": "Letter" + } + ] + } + }, + { + "url": "PreferredContactTimes", + "valueString": "Not after 7pm" + } + ] + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + "valueAddress": { + "city": "Manchester", + "district": "Greater Manchester", + "country": "GBR" + } + }, + { + "url": "https://fhir.nhs.uk/StructureDefinition/Extension-PDS-RemovalFromRegistration", + "extension": [ + { + "url": "removalFromRegistrationCode", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://fhir.nhs.uk/CodeSystem/PDS-RemovalReasonExitCode", + "code": "SCT", + "display": "Transferred to Scotland" + } + ] + } + }, + { + "url": "effectiveTime", + "valuePeriod": { + "start": "2020-01-01T00:00:00+00:00", + "end": "2021-12-31T00:00:00+00:00" + } + } + ] + } + ], + "telecom": [ + { + "id": "789", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "system": "phone", + "value": "01632960587", + "use": "home" + }, + { + "id": "790", + "period": { + "start": "2019-01-01", + "end": "2022-12-31" + }, + "system": "email", + "value": "jane.smith@example.com", + "use": "home" + }, + { + "id": "OC789", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "system": "other", + "value": "01632960587", + "use": "home", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-OtherContactSystem", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-OtherContactSystem", + "code": "textphone", + "display": "Minicom (Textphone)" + } + } + ] + } + ], + "contact": [ + { + "id": "C123", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "C", + "display": "Emergency Contact" + } + ] + } + ], + "telecom": [ + { + "system": "phone", + "value": "01632960587" + } + ] + } + ], + "address": [ + { + "id": "456", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "use": "home", + "line": [ + "1 Trevelyan Square", + "Boar Lane", + "City Centre", + "Leeds", + "West Yorkshire" + ], + "postalCode": "LS1 6AE", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "PAF" + } + }, + { + "url": "value", + "valueString": "12345678" + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "UPRN" + } + }, + { + "url": "value", + "valueString": "123456789012" + } + ] + } + ] + }, + { + "id": "T456", + "period": { + "start": "2020-01-01", + "end": "2021-12-31" + }, + "use": "temp", + "text": "Student Accommodation", + "line": [ + "1 Trevelyan Square", + "Boar Lane", + "City Centre", + "Leeds", + "West Yorkshire" + ], + "postalCode": "LS1 6AE", + "extension": [ + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "PAF" + } + }, + { + "url": "value", + "valueString": "12345678" + } + ] + }, + { + "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", + "extension": [ + { + "url": "type", + "valueCoding": { + "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", + "code": "UPRN" + } + }, + { + "url": "value", + "valueString": "123456789012" + } + ] + } + ] + } + ] +} diff --git a/application/CohortManager/src/Functions/ParticipantManagementServices/ManageParticipant/ManageParticipant.cs b/application/CohortManager/src/Functions/ParticipantManagementServices/ManageParticipant/ManageParticipant.cs index b8f565b715..89ef60bb06 100644 --- a/application/CohortManager/src/Functions/ParticipantManagementServices/ManageParticipant/ManageParticipant.cs +++ b/application/CohortManager/src/Functions/ParticipantManagementServices/ManageParticipant/ManageParticipant.cs @@ -73,11 +73,8 @@ public async Task Run([ServiceBusTrigger(topicName: "%ParticipantManagementTopic else { _logger.LogInformation("Existing participant management record found, updating record {ParticipantId}", databaseParticipant.ParticipantId); - var participantManagement = participant.ToParticipantManagement(); - participantManagement.ParticipantId = databaseParticipant.ParticipantId; + var participantManagement = participant.ToParticipantManagement(databaseParticipant); participantManagement.RecordUpdateDateTime = DateTime.UtcNow; - participantManagement.RecordInsertDateTime = databaseParticipant.RecordInsertDateTime; - participantManagement.ReferralFlag = databaseParticipant.ReferralFlag; dataServiceResponse = await _participantManagementClient.Update(participantManagement); } diff --git a/application/CohortManager/src/Functions/Shared/Model/Participant.cs b/application/CohortManager/src/Functions/Shared/Model/Participant.cs index 901deb0a18..53c357e403 100644 --- a/application/CohortManager/src/Functions/Shared/Model/Participant.cs +++ b/application/CohortManager/src/Functions/Shared/Model/Participant.cs @@ -183,6 +183,32 @@ public ParticipantManagement ToParticipantManagement() return participantManagement; } + public ParticipantManagement ToParticipantManagement(ParticipantManagement existingRecord) + { + var participantManagement = new ParticipantManagement + { + ParticipantId = existingRecord.ParticipantId, + ScreeningId = long.Parse(ScreeningId), + NHSNumber = long.Parse(NhsNumber), + RecordType = RecordType, + EligibilityFlag = MappingUtilities.ParseStringFlag(EligibilityFlag ?? "1"), + ReasonForRemoval = ReasonForRemoval, + ReasonForRemovalDate = MappingUtilities.ParseDates(ReasonForRemovalEffectiveFromDate), + BusinessRuleVersion = BusinessRuleVersion, + ExceptionFlag = MappingUtilities.ParseStringFlag(ExceptionFlag ?? "0"), + BlockedFlag = MappingUtilities.ParseStringFlag(BlockedFlag ?? "0"), + ReferralFlag = existingRecord.ReferralFlag, + RecordInsertDateTime = MappingUtilities.ParseDates(RecordInsertDateTime), + RecordUpdateDateTime = existingRecord.RecordInsertDateTime, + IsHigherRisk = existingRecord.IsHigherRisk + }; + + if (ParticipantId != null) + participantManagement.ParticipantId = long.Parse(ParticipantId); + + return participantManagement; + } + private int GetInvalidFlag() { int result = 0; diff --git a/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts b/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts index d73da6ecb3..a340c871b8 100644 --- a/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts +++ b/tests/playwright-tests/src/tests/e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated.ts @@ -30,6 +30,6 @@ export const runnerBasedEpic4cTestScenariosAdd = "@DTOSS-9337-01"; export const runnerBasedEpic4cTestScenariosAmend = "@DTOSS-9337-01"; // export const runnerBasedEpic4cTestScenariosManualAdd = ""; -export const runnerBasedEpic4cTestScenariosManualAdd = "@DTOSS-3883-01|@DTOSS-8484-01|@DTOSS-9614-01|@DTOSS-8375-01|@DTOSS-9706-01"; -export const runnerBasedEpic4cTestScenariosManualAmend = "@DTOSS-8483-01|@DTOSS-9614-01"; +export const runnerBasedEpic4cTestScenariosManualAdd = "@DTOSS-3883-01|@DTOSS-8484-01|@DTOSS-9614-01|@DTOSS-8375-01|@DTOSS-9706-01|@DTOSS-9706-02"; +export const runnerBasedEpic4cTestScenariosManualAmend = "@DTOSS-8483-01|@DTOSS-9614-01|@DTOSS-9706-01"; //export const runnerBasedEpic4cTestScenariosManualAmend = ""; diff --git a/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json index 59ce4f162f..a2493322ad 100644 --- a/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json +++ b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json @@ -3,8 +3,8 @@ { "validations": { "apiEndpoint": "api/ParticipantManagementDataService", - "NHSNumber": 9994045571, - "IsHigherRisk": "1" + "NHSNumber": 9992886412, + "IsHigherRisk": 1 }, "meta": { "testJiraId": "@DTOSS-9706-01", @@ -17,7 +17,7 @@ { "number": "CS0573848", "u_case_variable_data": { - "nhs_number": "9994045571", + "nhs_number": "9992886412", "forename_": "Jane", "surname_family_name": "Smith", "date_of_birth": "1980-10-22", @@ -28,6 +28,6 @@ } ], "nhsNumbers": [ - "9994045571" + "9992886412" ] } diff --git a/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/AMENDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/AMENDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json new file mode 100644 index 0000000000..9479397f17 --- /dev/null +++ b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-01/AMENDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json @@ -0,0 +1,61 @@ +{ + "validations": [ + { + "validations": { + "apiEndpoint": "api/ParticipantManagementDataService", + "NHSNumber": 9992886412, + "IsHigherRisk": 1 + }, + "meta": { + "testJiraId": "@DTOSS-9706-01", + "requirementJiraId": "@DTOSS-9706-01", + "additionalTags": "@DTOSS-9706-01 @e2e @epic4c- Verify that the VHR flag is not overwritten when a participant is amended" + } + } + ], + "inputParticipantRecord": [ + { + "record_type": "AMENDED", + "change_time_stamp": null, + "serial_change_number": null, + "nhs_number": 9992886412, + "superseded_by_nhs_number": null, + "primary_care_provider": "B86019", + "primary_care_effective_from_date": "20030318", + "current_posting": "WGA", + "current_posting_effective_from_date": "20130319", + "name_prefix": "Mrs", + "given_name": "9497 update", + "other_given_name": "OtherGivenName", + "family_name": "FamiliyName", + "previous_family_name": "PreviousFamilyName", + "date_of_birth": "19700101", + "gender": 1, + "address_line_1": "98 Spaight Road", + "address_line_2": "Eastbourne", + "address_line_3": "Test", + "address_line_4": "Brighton", + "address_line_5": "United Kingdom", + "postcode": "BT1 1NN", + "paf_key": "Z3S4Q5X9", + "address_effective_from_date": "20130319", + "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": "20200818", + "mobile_telephone_number": "07888888888", + "mobile_telephone_effective_from_date": "20200818", + "email_address": "bturneux0@soup.io", + "email_address_effective_from_date": "20200818", + "preferred_language": "en", + "is_interpreter_required": false, + "invalid_flag": false, + "eligibility": true + } + ], + "nhsNumbers": [ + "9992886412" + ] +} diff --git a/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json new file mode 100644 index 0000000000..69a3d4b722 --- /dev/null +++ b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json @@ -0,0 +1,33 @@ +{ + "validations": [ + { + "validations": { + "apiEndpoint": "api/ParticipantManagementDataService", + "NHSNumber": 9990841780, + "IsHigherRisk": 0 + }, + "meta": { + "testJiraId": "@DTOSS-9706-02", + "requirementJiraId": "@DTOSS-9706-02", + "additionalTags": "@DTOSS-9706-02 @e2e @epic4c- Verify that VHR flag is set to false in the participant management table when reason_for_adding is not eligible_for_very_high_risk_breast_screening_referral_form_must_be_attached" + } + } + ], + "inputParticipantRecord": [ + { + "number": "CS0573848", + "u_case_variable_data": { + "nhs_number": "9990841780", + "forename_": "Jane", + "surname_family_name": "Smith", + "date_of_birth": "1980-10-22", + "enter_dummy_gp_code": "ZZZDKL", + "BSO_code": "NORTH NOTTINGHAMSHIRE BREAST SCREENING OFFICE", + "reason_for_adding": "requires_ceasing_following_surgery_bilateral_mastectomy" + } + } + ], + "nhsNumbers": [ + "9990841780" + ] +} From 1fb092e0c77df5af4417c8be5841e4f9f352d964 Mon Sep 17 00:00:00 2001 From: Michael Clayson Date: Tue, 2 Sep 2025 10:14:28 +0100 Subject: [PATCH 3/5] fix Is higher risk flag and add package runner --- tests/playwright-tests/package.json | 3 ++- .../ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/playwright-tests/package.json b/tests/playwright-tests/package.json index 32f45c40b3..196de1a6f2 100644 --- a/tests/playwright-tests/package.json +++ b/tests/playwright-tests/package.json @@ -11,7 +11,8 @@ "test:regression_e2e_epic1Med": "cross-env TEST_TYPE=RegressionEpic1Med npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic1-med", "test:regression_e2e_epic2Med": "cross-env TEST_TYPE=RegressionEpic2Med npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic2-med", "test:regression_e2e_epic3Med": "cross-env TEST_TYPE=RegressionEpic3Med npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic3-med", - "test:regression_e2e_epic4c": "cross-env TEST_TYPE=RegressionEpic4c npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic4c-", + "test:regression_e2e_epic4c": "cross-env TEST_TYPE=RegressionEpic4c npx playwright test --project=dev --config=src/config/playwright.config.ts", + "test:regression_e2e_epic4c_specific": "cross-env TEST_TYPE=RegressionEpic4c npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic4c-", "test:regression_e2e_epic4d": "cross-env TEST_TYPE=RegressionEpic4d npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic4d-", "test": "cross-env TEST_TYPE=SMOKE npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=\"@smoke @e2e\"", "test:validation-exceptions": "cross-env TEST_TYPE=VALIDATION npx playwright test tests/api/bsselect/validationExceptions/ --project=dev --config=src/config/playwright.config.ts", diff --git a/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json index 69a3d4b722..9352986bfb 100644 --- a/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json +++ b/tests/playwright-tests/src/tests/e2e/testFiles/@DTOSS-9706-02/ADDMANUAL1_1B8F53_-_CAAS_BREAST_SCREENING_COHORT.json @@ -4,7 +4,7 @@ "validations": { "apiEndpoint": "api/ParticipantManagementDataService", "NHSNumber": 9990841780, - "IsHigherRisk": 0 + "IsHigherRisk": null }, "meta": { "testJiraId": "@DTOSS-9706-02", From 07f9218535d7ed6cc1cf7066a90ca5c6b0e9210b Mon Sep 17 00:00:00 2001 From: Michael Clayson Date: Tue, 2 Sep 2025 12:03:20 +0100 Subject: [PATCH 4/5] spec test --- tests/playwright-tests/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/playwright-tests/package.json b/tests/playwright-tests/package.json index 196de1a6f2..b6089f06ea 100644 --- a/tests/playwright-tests/package.json +++ b/tests/playwright-tests/package.json @@ -11,8 +11,8 @@ "test:regression_e2e_epic1Med": "cross-env TEST_TYPE=RegressionEpic1Med npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic1-med", "test:regression_e2e_epic2Med": "cross-env TEST_TYPE=RegressionEpic2Med npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic2-med", "test:regression_e2e_epic3Med": "cross-env TEST_TYPE=RegressionEpic3Med npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic3-med", - "test:regression_e2e_epic4c": "cross-env TEST_TYPE=RegressionEpic4c npx playwright test --project=dev --config=src/config/playwright.config.ts", - "test:regression_e2e_epic4c_specific": "cross-env TEST_TYPE=RegressionEpic4c npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic4c-", + "test:regression_e2e_epic4c": "cross-env TEST_TYPE=RegressionEpic4c npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic4c-", + "test:regression_e2e_epic4c:dtoss_8483": "cross-env TEST_TYPE=RegressionEpic4c npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@DTOSS-8483-", "test:regression_e2e_epic4d": "cross-env TEST_TYPE=RegressionEpic4d npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=@epic4d-", "test": "cross-env TEST_TYPE=SMOKE npx playwright test --project=dev --config=src/config/playwright.config.ts --grep=\"@smoke @e2e\"", "test:validation-exceptions": "cross-env TEST_TYPE=VALIDATION npx playwright test tests/api/bsselect/validationExceptions/ --project=dev --config=src/config/playwright.config.ts", From 7ee571eb04b92e14b4afa04f8ecb97dce8e9924d Mon Sep 17 00:00:00 2001 From: Michael Clayson Date: Wed, 3 Sep 2025 11:00:49 +0100 Subject: [PATCH 5/5] null sonar qube issues --- .../src/Functions/Shared/Model/Participant.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/CohortManager/src/Functions/Shared/Model/Participant.cs b/application/CohortManager/src/Functions/Shared/Model/Participant.cs index 53c357e403..b4be041164 100644 --- a/application/CohortManager/src/Functions/Shared/Model/Participant.cs +++ b/application/CohortManager/src/Functions/Shared/Model/Participant.cs @@ -163,18 +163,18 @@ public ParticipantManagement ToParticipantManagement() { var participantManagement = new ParticipantManagement { - ScreeningId = long.Parse(ScreeningId), - NHSNumber = long.Parse(NhsNumber), - RecordType = RecordType, + ScreeningId = long.Parse(ScreeningId!), + NHSNumber = long.Parse(NhsNumber!), + RecordType = RecordType!, EligibilityFlag = MappingUtilities.ParseStringFlag(EligibilityFlag ?? "1"), ReasonForRemoval = ReasonForRemoval, - ReasonForRemovalDate = MappingUtilities.ParseDates(ReasonForRemovalEffectiveFromDate), + ReasonForRemovalDate = MappingUtilities.ParseDates(ReasonForRemovalEffectiveFromDate!), BusinessRuleVersion = BusinessRuleVersion, ExceptionFlag = MappingUtilities.ParseStringFlag(ExceptionFlag ?? "0"), BlockedFlag = MappingUtilities.ParseStringFlag(BlockedFlag ?? "0"), ReferralFlag = MappingUtilities.ParseStringFlag(ReferralFlag ?? "0"), - RecordInsertDateTime = MappingUtilities.ParseDates(RecordInsertDateTime), - RecordUpdateDateTime = MappingUtilities.ParseDates(RecordUpdateDateTime), + RecordInsertDateTime = MappingUtilities.ParseDates(RecordInsertDateTime!), + RecordUpdateDateTime = MappingUtilities.ParseDates(RecordUpdateDateTime!), }; if (ParticipantId != null)