Skip to content

Commit 3632462

Browse files
authored
fix: DTOSS-11868 updated rule numbers (#1793)
* fix: rule 17 changed to rule 71 as it was mapping to incorrect error text * fix:Updated unit tests to accomodate new number * fix:Updated unit tests t remove uneeded rule numbers
1 parent 5faab4f commit 3632462

File tree

4 files changed

+3
-39
lines changed

4 files changed

+3
-39
lines changed

application/CohortManager/src/Functions/ScreeningValidationService/LookupValidation/Breast_Screening_lookupRules.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"Expression": "!(reasonForRemoval AND postcode AND primaryCareProvider)"
6363
},
6464
{
65-
"RuleName": "17.AddressLinesNullAndPostcodeDoesNotMatchExisting.NBO.NonFatal",
65+
"RuleName": "71.AddressLinesNullAndPostcodeDoesNotMatchExisting.NBO.NonFatal",
6666
"LocalParams": [
6767
{
6868
"Name": "addressLines",

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

Lines changed: 1 addition & 11 deletions
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, 39, 40, 54, 66, 69, 71,
7+
3, 8, 17, 18, 30, 35, 39, 40, 54, 66, 71
88
];
99
const actualRuleIds = Object.keys(ruleIdMappings).map(Number);
1010

@@ -153,15 +153,5 @@ describe("ruleMapping", () => {
153153
expect(mapping.ruleDescription.trim()).not.toBe("");
154154
});
155155
});
156-
157-
it("should handle rules with empty moreDetails", () => {
158-
// Rule 21 has empty moreDetails in the mapping
159-
const result = getRuleMapping(21);
160-
expect(result.moreDetails).toBe("");
161-
expect(result.ruleDescription).toBe(
162-
"The 'Superseded by NHS number' field has been populated with an NHS number by NBO."
163-
);
164-
expect(result.reportingId).toBe("CMR33");
165-
});
166156
});
167157
});

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ export const ruleIdMappings: Record<number, RuleMapping> = {
1515
reportingId: "CMR4",
1616
portalFormTitle: "Raise with Cohorting as a Service (CaaS)",
1717
},
18-
10: {
19-
ruleDescription:
20-
"Update received for NHS number with reason for removal of ‘DEA’.",
21-
moreDetails: "An update has been received for a record marked as deceased.",
22-
reportingId: "CMR36",
23-
},
2418
17: {
2519
ruleDescription:
2620
"Date of birth is either missing, in the wrong format, or is in the future.",
@@ -35,20 +29,6 @@ export const ruleIdMappings: Record<number, RuleMapping> = {
3529
"Enter the date of death in the correct format. The date cannot be in the future.",
3630
reportingId: "CMR22",
3731
},
38-
21: {
39-
ruleDescription:
40-
"The 'Superseded by NHS number' field has been populated with an NHS number by NBO.",
41-
moreDetails: "",
42-
reportingId: "CMR33",
43-
},
44-
22: {
45-
ruleDescription:
46-
"Amendment received for an NHS number that is not in this cohort.",
47-
moreDetails:
48-
"Raise with Cohorting as a Service (CaaS). An amendment cannot be applied as the record has not yet been added to the cohort. There may have been a delay in adding the new record to Cohort Manager. ",
49-
reportingId: "CMR39",
50-
portalFormTitle: "Raise with Cohorting as a Service (CaaS)",
51-
},
5232
30: {
5333
ruleDescription: "Postcode is in the wrong format.",
5434
moreDetails: "Enter a valid UK postcode.",
@@ -104,12 +84,6 @@ export const ruleIdMappings: Record<number, RuleMapping> = {
10484
reportingId: "CMR20",
10585
portalFormTitle: "Confused NHS numbers",
10686
},
107-
69: {
108-
ruleDescription: "NHS number’s invalid flag is set to true.",
109-
moreDetails:
110-
"An update has been received for the record with the NHS Number now flagged as invalid.",
111-
reportingId: "CMR29",
112-
},
11387
71: {
11488
ruleDescription: "Address is blank (postcode may be blank too).",
11589
moreDetails: "Enter the patient's full address and postcode.",

tests/UnitTests/ScreeningValidationServiceTests/LookupValidation/LookupValidationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public async Task Run_AddressLinesNullAndPostcodeDoesNotMatchExisting_ReturnVali
327327
string body = await AssertionHelper.ReadResponseBodyAsync(response);
328328

329329
// Assert
330-
StringAssert.Contains(body, "17.AddressLinesNullAndPostcodeDoesNotMatchExisting.NBO.NonFatal");
330+
StringAssert.Contains(body, "71.AddressLinesNullAndPostcodeDoesNotMatchExisting.NBO.NonFatal");
331331
}
332332

333333
[DataRow(null, null, null, null, null, "RG2 5TX", "Existing Address 1", "Existing Address 2", "Existing Address 3", "Existing Address 4", "Existing Address 5", "RG2 5TX")] // All New Address Fields Blank, Postcode exists, Existing Address fields full

0 commit comments

Comments
 (0)