Skip to content

Commit ba754d4

Browse files
chrimesdevstephhou
authored andcommitted
fix: add the new rules to the ruleMappings to match spreadsheet (#1586)
* fix: add the new rules to the ruleMappings to match spreadsheet * fix: add exceptions for the new rules * fix: fix broken test by removing old id
1 parent 8ecfebf commit ba754d4

3 files changed

Lines changed: 84 additions & 8 deletions

File tree

application/CohortManager/src/Web/app/data/mockExceptions.json

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@
613613
"NhsNumber": "2847593061",
614614
"DateCreated": "2025-05-14T12:35:16.73",
615615
"DateResolved": "9999-12-31T00:00:00",
616-
"RuleId": 36,
616+
"RuleId": 45,
617617
"RuleDescription": "GP practice code does not exist in the BSS cohort organisation table",
618618
"Category": 5,
619619
"ScreeningName": "Breast Screening",
@@ -640,6 +640,70 @@
640640
"ServiceNowCreatedDate": "",
641641
"RecordUpdatedDate": "2025-05-16T09:18:54.41"
642642
},
643+
"2035": {
644+
"ExceptionId": 2035,
645+
"NhsNumber": "2847593072",
646+
"DateCreated": "2025-05-14T12:35:16.73",
647+
"DateResolved": "9999-12-31T00:00:00",
648+
"RuleId": 49,
649+
"RuleDescription": "Interpreter Required information is not valid",
650+
"Category": 5,
651+
"ScreeningName": "Breast Screening",
652+
"ExceptionDate": "2025-05-12T00:00:00",
653+
"CohortName": "",
654+
"Fatal": 1,
655+
"ExceptionDetails": {
656+
"GivenName": "Maya",
657+
"FamilyName": "Patel",
658+
"DateOfBirth": "19921103",
659+
"ParticipantAddressLine1": "74 Riverbank Close",
660+
"ParticipantAddressLine2": "Flat 12",
661+
"ParticipantAddressLine3": "Kings Heath",
662+
"ParticipantAddressLine4": "Birmingham",
663+
"ParticipantAddressLine5": "UK",
664+
"ParticipantPostCode": "B14 7QP",
665+
"TelephoneNumberHome": "07412345678",
666+
"EmailAddressHome": "maya.patel@example.com",
667+
"PrimaryCareProvider": "E50231",
668+
"Gender": 2,
669+
"SupersededByNhsNumber": ""
670+
},
671+
"ServiceNowId": "",
672+
"ServiceNowCreatedDate": "",
673+
"RecordUpdatedDate": "2025-05-16T09:18:54.41"
674+
},
675+
"2036": {
676+
"ExceptionId": 2036,
677+
"NhsNumber": "2847599972",
678+
"DateCreated": "2025-05-14T12:35:16.73",
679+
"DateResolved": "9999-12-31T00:00:00",
680+
"RuleId": 53,
681+
"RuleDescription": "Participant has re-registered and PDS has been updated with new GP practice code but has not yet received a new current posting.",
682+
"Category": 5,
683+
"ScreeningName": "Breast Screening",
684+
"ExceptionDate": "2025-05-12T00:00:00",
685+
"CohortName": "",
686+
"Fatal": 1,
687+
"ExceptionDetails": {
688+
"GivenName": "Noah",
689+
"FamilyName": "Ahmed",
690+
"DateOfBirth": "19890921",
691+
"ParticipantAddressLine1": "29 Hawthorn Close",
692+
"ParticipantAddressLine2": "House 3",
693+
"ParticipantAddressLine3": "Didsbury",
694+
"ParticipantAddressLine4": "Manchester",
695+
"ParticipantAddressLine5": "UK",
696+
"ParticipantPostCode": "M20 4BQ",
697+
"TelephoneNumberHome": "07987654321",
698+
"EmailAddressHome": "noah.ahmed@example.com",
699+
"PrimaryCareProvider": "E74120",
700+
"Gender": 1,
701+
"SupersededByNhsNumber": ""
702+
},
703+
"ServiceNowId": "",
704+
"ServiceNowCreatedDate": "",
705+
"RecordUpdatedDate": "2025-05-16T09:18:54.41"
706+
},
643707
"4001": {
644708
"ExceptionId": 4001,
645709
"NhsNumber": "3333333333",

application/CohortManager/src/Web/app/lib/ruleMapping.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe("ruleMapping", () => {
44
describe("ruleIdMappings", () => {
55
it("should contain all expected rule IDs", () => {
66
const expectedRuleIds = [
7-
3, 8, 10, 17, 18, 21, 22, 30, 35, 36, 39, 40, 54, 66, 69, 71,
7+
3, 8, 10, 17, 18, 21, 22, 30, 35, 39, 40, 54, 66, 69, 71,
88
];
99
const actualRuleIds = Object.keys(ruleIdMappings).map(Number);
1010

application/CohortManager/src/Web/app/lib/ruleMapping.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ export const ruleIdMappings: Record<number, RuleMapping> = {
6161
"Verify that the changes are correct, and that the NHS number is not involved in a confusion case.",
6262
reportingId: "CMR38",
6363
},
64-
36: {
65-
ruleDescription: "GP practice code does not exist.",
66-
moreDetails: "Raise with Breast Screening Select (BSS).",
67-
reportingId: "CMR45",
68-
portalFormTitle: "Raise with Breast Screening Select (BSS)",
69-
},
7064
39: {
7165
ruleDescription: "Missing surname.",
7266
moreDetails: "Enter the patient's surname.",
@@ -77,6 +71,24 @@ export const ruleIdMappings: Record<number, RuleMapping> = {
7771
moreDetails: "Enter the patient's forename.",
7872
reportingId: "CMR16",
7973
},
74+
45: {
75+
ruleDescription: "GP practice code does not exist",
76+
moreDetails: "Raise with Breast Screening Select (BSS)",
77+
reportingId: "CMR45",
78+
portalFormTitle: "Raise with Breast Screening Select (BSS)",
79+
},
80+
49: {
81+
ruleDescription: "Interpreter required information is not valid",
82+
moreDetails:
83+
"The interpreter required details must be entered as numbers 0 or 1. Check if an interpreter is needed for the participant: enter 0 if an interpreter is not required. Enter 1 if an interpreter is required",
84+
reportingId: "CMR49",
85+
},
86+
53: {
87+
ruleDescription: "Current posting awaiting update",
88+
moreDetails:
89+
"The patient’s GP practice code has been updated, but the current posting is yet to be updated",
90+
reportingId: "CMR53",
91+
},
8092
54: {
8193
ruleDescription:
8294
"A dummy GP practice code could not be generated. An English postcode must be entered.",

0 commit comments

Comments
 (0)