-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathruleMapping.ts
More file actions
130 lines (128 loc) · 4.79 KB
/
ruleMapping.ts
File metadata and controls
130 lines (128 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import { RuleMapping } from "@/app/types";
export const ruleIdMappings: Record<number, RuleMapping> = {
3: {
ruleDescription:
"It's not possible to have both a current GP practice code and a current reason for removal (RfR), or neither.",
moreDetails:
"Either: enter a GP practice code, or enter a reason for removal. Information must only be entered for one of these fields. Both fields cannot be empty.",
reportingId: "CMR13",
},
8: {
ruleDescription:
"Record from CaaS is either missing from or is not recognised by Cohort Manager.",
moreDetails: "Raise with Cohorting as a Service (CaaS).",
reportingId: "CMR4",
portalFormTitle: "Raise with Cohorting as a Service (CaaS)",
},
10: {
ruleDescription:
"Update received for NHS number with reason for removal of ‘DEA’.",
moreDetails: "An update has been received for a record marked as deceased.",
reportingId: "CMR36",
},
17: {
ruleDescription:
"Date of birth is either missing, in the wrong format, or is in the future.",
moreDetails:
"Enter the date of birth in the correct format. The date must not be in the future. ",
reportingId: "CMR14",
},
18: {
ruleDescription:
"Date of death is in the wrong format or is in the future.",
moreDetails:
"Enter the date of death in the correct format. The date cannot be in the future.",
reportingId: "CMR22",
},
21: {
ruleDescription:
"The 'Superseded by NHS number' field has been populated with an NHS number by NBO.",
moreDetails: "",
reportingId: "CMR33",
},
22: {
ruleDescription:
"Amendment received for an NHS number that is not in this cohort.",
moreDetails:
"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. ",
reportingId: "CMR39",
portalFormTitle: "Raise with Cohorting as a Service (CaaS)",
},
30: {
ruleDescription: "Postcode is in the wrong format.",
moreDetails: "Enter a valid UK postcode.",
reportingId: "CMR12",
},
35: {
ruleDescription:
"Possible confusion. At least 2 of the following have changed: family name, gender or date of birth",
moreDetails:
"Verify that the changes are correct, and that the NHS number is not involved in a confusion case.",
reportingId: "CMR38",
},
39: {
ruleDescription: "Missing surname.",
moreDetails: "Enter the patient's surname.",
reportingId: "CMR15",
},
40: {
ruleDescription: "Missing forename.",
moreDetails: "Enter the patient's forename.",
reportingId: "CMR16",
},
45: {
ruleDescription: "GP practice code does not exist",
moreDetails: "Raise with Breast Screening Select (BSS)",
reportingId: "CMR45",
portalFormTitle: "Raise with Breast Screening Select (BSS)",
},
49: {
ruleDescription: "Interpreter required information is not valid",
moreDetails:
"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",
reportingId: "CMR49",
},
53: {
ruleDescription: "Current posting awaiting update",
moreDetails:
"The patient’s GP practice code has been updated, but the current posting is yet to be updated",
reportingId: "CMR53",
},
54: {
ruleDescription:
"A dummy GP practice code could not be generated. An English postcode must be entered.",
moreDetails:
"A dummy GP practice code is used by breast screening offices when a participant’s actual GP practice information is unknown. The relevant dummy GP practice code will be generated when a postcode is added to the record.",
reportingId: "CMR34",
},
66: {
ruleDescription:
"NHS number has been marked as formally dead, but the reason for removal (RfR) is not ‘DEA’.",
moreDetails:
"To update a record with a formal death status, ensure that the reason for removal field contains a compatible death-related value.",
reportingId: "CMR20",
},
69: {
ruleDescription: "NHS number’s invalid flag is set to true.",
moreDetails:
"An update has been received for the record with the NHS Number now flagged as invalid.",
reportingId: "CMR29",
},
71: {
ruleDescription: "Address is blank (postcode may be blank too).",
moreDetails: "Enter the patient's full address and postcode.",
reportingId: "CMR17",
},
};
export function getRuleMapping(
ruleId: number,
fallbackDescription?: string
): RuleMapping {
return (
ruleIdMappings[ruleId] || {
ruleDescription: fallbackDescription,
moreDetails: fallbackDescription,
reportingId: undefined,
}
);
}