File size: 29,237 Bytes
234f3a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
"""
Comprehensive NICE Guidelines and NHS Primary Care Knowledge Base
Curated clinical summaries covering major high-frequency UK GP presentations:
- Hypertension (NICE NG136)
- Type 2 Diabetes in Adults (NICE NG28)
- Suspected Cancer: 2-Week Wait (2WW) recognition & referral (NICE NG12)
- Asthma Diagnosis, Monitoring & Chronic Management (NICE NG80 / BTS-SIGN)
- Chronic Kidney Disease (CKD) Assessment & Management (NICE NG203)
- Depression in Adults (NICE NG222)
- Lower Urinary Tract Symptoms / UTI in Adults (NICE NG109 / UKHSA)
- Atrial Fibrillation Management & Anticoagulation (NICE NG196)
- Dyspepsia & Gastro-oesophageal Reflux (NICE CG184)
- Chest Pain of Recent Onset (NICE CG95)
"""

NICE_GUIDELINES_DB = [
    {
        "id": "NICE-NG136",
        "title": "Hypertension in adults: diagnosis and management",
        "guideline_code": "NICE NG136",
        "category": "Cardiovascular",
        "keywords": ["hypertension", "high blood pressure", "bp", "ramipril", "amlodipine", "losartan", "acei", "arb", "ccb", "thiazide", "indapamide", "abpm", "hbpm", "clinic bp"],
        "diagnostic_criteria": (
            "Diagnosis requires Clinic BP >=140/90 mmHg followed by Ambulatory Blood Pressure Monitoring (ABPM) "
            "or Home Blood Pressure Monitoring (HBPM) daytime average >=135/85 mmHg.\n"
            "Stage 1: Clinic 140/90 to 159/99 AND ABPM/HBPM 135/85 to 149/89.\n"
            "Stage 2: Clinic >=160/100 AND ABPM/HBPM >=150/95.\n"
            "Severe / Stage 3: Clinic systolic >=180 or diastolic >=120 (check for papilloedema/retinal haemorrhage or red-flag target organ damage; refer same-day if acute chest pain, heart failure, confusion, or visual loss)."
        ),
        "management_pathway": (
            "Treatment targets (<80 years): Clinic <140/90 mmHg; ABPM/HBPM <135/85 mmHg.\n"
            "Treatment targets (>=80 years): Clinic <150/90 mmHg; ABPM/HBPM <145/85 mmHg.\n\n"
            "Step 1 Pharmacotherapy:\n"
            "• Under 55 years and NOT of black African or African-Caribbean family origin: Offer ACE inhibitor (e.g., Ramipril 2.5-10mg OD) OR Angiotensin Receptor Blocker (ARB, e.g., Losartan 50-100mg OD or Candesartan).\n"
            "• Aged >=55 years OR of black African or African-Caribbean origin of any age: Offer Calcium Channel Blocker (CCB, e.g., Amlodipine 5-10mg OD).\n"
            "• If CCB not tolerated or heart failure/high oedema risk: Offer thiazide-like diuretic (Indapamide 1.5mg MR or 2.5mg OD).\n\n"
            "Step 2:\n"
            "• Combine ACEi/ARB + CCB (or Indapamide if CCB not tolerated).\n"
            "• In black African/Caribbean origin: Offer ARB in preference to ACEi.\n\n"
            "Step 3:\n"
            "• Triple therapy: ACEi/ARB + CCB + Thiazide-like diuretic (Indapamide).\n\n"
            "Step 4 (Resistant Hypertension):\n"
            "• Confirm true resistant hypertension with repeat ABPM/HBPM and adherence check.\n"
            "• If blood potassium <=4.5 mmol/L: Add low-dose Spironolactone (25mg OD) - monitor U&Es closely.\n"
            "• If blood potassium >4.5 mmol/L: Add Alpha-blocker (Doxazosin) or Beta-blocker (Bisoprolol).\n"
            "• If uncontrolled, refer to specialist hypertension clinic."
        ),
        "red_flags": [
            "Clinic BP >=180/120 mmHg with new confusion, altered mental state, or visual disturbance (hypertensive encephalopathy).",
            "Severe hypertension with papilloedema or retinal haemorrhages (malignant/accelerated hypertension) - emergency admission.",
            "Chest pain, acute breathlessness, or signs of acute heart failure/aortic dissection.",
            "Suspected phaeochromocytoma (labile BP, headache, diaphoresis, tachycardia)."
        ],
        "monitoring": "U&Es (eGFR, creatinine, potassium) before starting ACEi/ARB/diuretic and repeat within 2-4 weeks after dose titration. Routine annual review once controlled."
    },
    {
        "id": "NICE-NG28",
        "title": "Type 2 diabetes in adults: management",
        "guideline_code": "NICE NG28",
        "category": "Endocrine / Metabolic",
        "keywords": ["diabetes", "t2dm", "type 2 diabetes", "hyperglycaemia", "metformin", "sglt2", "dpp4", "glp1", "hba1c", "dapagliflozin", "empagliflozin", "sitagliptin", "gliclazide", "diabetic kidney disease", "diabetic nephropathy", "ng28", "urine acr", "microalbuminuria", "dka", "euglycaemic dka", "metformin contraindicated"],
        "diagnostic_criteria": (
            "HbA1c >= 48 mmol/mol (6.5%) confirms diagnosis.\n"
            "If patient is symptomatic (polyuria, polydipsia, weight loss), a single test suffices.\n"
            "If asymptomatic, repeat HbA1c in 2-4 weeks for confirmation.\n"
            "Prediabetes / Impaired fasting glucose: HbA1c 42-47 mmol/mol (refer to NHS Diabetes Prevention Programme)."
        ),
        "management_pathway": (
            "Target HbA1c:\n"
            "• 48 mmol/mol (6.5%) on lifestyle or monotherapy without hypoglycaemia risk (e.g. Metformin).\n"
            "• 53 mmol/mol (7.0%) on drug associated with hypoglycaemia (e.g., sulfonylurea, insulin).\n\n"
            "First-line Pharmacotherapy:\n"
            "• Standard-release Metformin (titrate from 500mg OD up to 1g BD with meals to minimize GI side-effects). If GI intolerant, switch to Metformin MR.\n"
            "• If established Atherosclerotic Cardiovascular Disease (ASCVD) or high risk (QRISK3 >10%) OR Heart Failure (HF) OR Chronic Kidney Disease (CKD with eGFR 20-60 or uACR >3mg/mmol): Add SGLT2 inhibitor (e.g. Dapagliflozin 10mg OD or Empagliflozin 10mg OD) concurrently or as dual first-line.\n\n"
            "Metformin Renal Dosing Adjustments:\n"
            "• Review dose if eGFR <45 mL/min/1.73m2 (max 1000mg/day); stop / discontinue metformin if eGFR <30 mL/min/1.73m2 (contraindicated <30 due to risk of lactic acidosis).\n\n"
            "SGLT2 Inhibitor Safety (Euglycaemic DKA Alert):\n"
            "• Warn patients of risk of euglycaemic DKA (diabetic ketoacidosis with normal/near-normal glucose). If patient presents with nausea, abdominal pain, deep rapid breathing: urgently test blood ketones, stop SGLT2i immediately, and arrange emergency hospital admission.\n\n"
            "Diabetic Kidney Disease Monitoring (NICE NG28):\n"
            "• Routine baseline blood and urine monitoring: measure annual urine albumin to creatinine ratio (uACR / ACR) and serum creatinine / eGFR.\n\n"
            "Second-line / Dual Therapy (if HbA1c rises to >=58 mmol/mol):\n"
            "• If Metformin + SGLT2i already used: Consider DPP-4 inhibitor (e.g. Sitagliptin 100mg OD, linagliptin), Pioglitazone, or Sulfonylurea (Gliclazide 40-160mg daily).\n"
            "• GLP-1 receptor agonists (e.g. Semaglutide/Dulaglutide): Recommended if BMI >=35 kg/m2 (or <35 if insulin would have significant occupational/psychological consequences, or weight loss would benefit comorbidities)."
        ),
        "red_flags": [
            "Diabetic Ketoacidosis (DKA) or Hyperosmolar Hyperglycaemic State (HHS): marked dehydration, drowsiness, Kussmaul breathing, blood ketones >3.0 mmol/L, or glucose >30 mmol/L.",
            "Diabetic foot ulceration with systemic sepsis, ascending cellulitis, or limb ischaemia (refer to multidisciplinary foot service within 24h or same-day admission).",
            "Suspected new Type 1 Diabetes (rapid weight loss, young age, ketosis)."
        ],
        "monitoring": "Review HbA1c every 3-6 months until stable, then every 6 months. Annual diabetic review: fundus photography, foot risk stratification, urine ACR (microalbuminuria), lipid profile, eGFR."
    },
    {
        "id": "NICE-NG12",
        "title": "Suspected cancer: recognition and referral (2-Week Wait / Urgent Cancer Pathway)",
        "guideline_code": "NICE NG12",
        "category": "Oncology / Urgent Referral",
        "keywords": ["2ww", "2-week wait", "cancer", "referral", "haematuria", "haemoptysis", "dysphagia", "weight loss", "breast lump", "postmenopausal bleeding", "post-menopausal bleeding", "vaginal bleeding", "bleeding", "menopause", "pmb", "rectal bleeding", "iron deficiency anaemia", "ida", "hoarseness", "fit test", "mole", "melanoma", "skin lesion", "abcde", "dermatology", "excision", "ng12", "2ww dermatology", "asymmetric borders"],
        "diagnostic_criteria": (
            "Clinical threshold: Symptoms or signs with a positive predictive value (PPV) >= 3% for underlying malignancy require an urgent suspected cancer referral for appointment within 2 weeks."
        ),
        "management_pathway": (
            "Key 2-Week Wait Referral Criteria by Site:\n"
            "1. Colorectal / Lower GI:\n"
            "   • Faecal Immunochemical Test (FIT): Offer FIT testing in primary care for unexplained bowel habit change, abdominal pain, or weight loss without rectal bleeding.\n"
            "   • Urgent 2WW Colonoscopy/Referral if: FIT >= 10 ug Hb/g faeces, OR age >=40 with unexplained weight loss and abdominal pain, OR age >=50 with unexplained rectal bleeding, OR age >=60 with iron deficiency anaemia (IDA).\n"
            "2. Upper GI (Oesophageal / Gastric):\n"
            "   • Urgent 2WW direct access endoscopy if: Dysphagia (difficulty swallowing at any age), OR age >=55 with weight loss AND upper abdominal pain/reflux/dyspepsia.\n"
            "3. Gynaecological (Endometrial / Cervical / Ovarian):\n"
            "   • Post-Menopausal Bleeding (PMB, unexplained bleeding >12 months after menopause): Urgent 2WW ultrasound/hysteroscopy.\n"
            "   • Suspicious cervical mass or ulcer: Urgent 2WW.\n"
            "   • Ovarian cancer: Measure serum CA125 in women age >=50 with persistent bloating, early satiety, pelvic pain, or increased urinary urgency; if CA125 >=35 IU/mL, arrange urgent ultrasound.\n"
            "4. Breast:\n"
            "   • Age >=30 with unexplained breast lump.\n"
            "   • Age >=50 with discharge or skin changes / retraction.\n"
            "5. Urological (Bladder / Renal / Prostate):\n"
            "   • Age >=45 with unexplained visible haematuria without UTI, or persisting after successful treatment of UTI.\n"
            "   • Age >=60 with unexplained non-visible haematuria AND dysuria or raised WCC.\n"
            "   • Prostate: Hard, irregular prostate on DRE or age-specific elevated PSA.\n"
            "6. Respiratory (Lung):\n"
            "   • Urgent CXR within 2 weeks if age >=40 with unexplained haemoptysis, or 2+ of: cough, fatigue, shortness of breath, chest pain, weight loss, appetite loss (especially smokers/asbestos exposure).\n"
            "7. Skin / Melanoma:\n"
            "   • Suspicious pigmented skin lesion or mole with ABCDE features (Asymmetry, Border irregularity, Colour variation, Diameter >6mm, Evolution) -> Urgent 2WW dermatology referral for specialist excision / biopsy."
        ),
        "red_flags": [
            "Stridor, superior vena cava obstruction (SVCO), spinal cord compression: require SAME-DAY emergency hospital admission, not routine 2WW."
        ],
        "monitoring": "Ensure safety-netting: inform patient about 2WW purpose, confirm patient is available within next 14 days, track referral in GP clinical system (EMIS/SystmOne)."
    },
    {
        "id": "NICE-NG80",
        "title": "Asthma: diagnosis, monitoring and chronic asthma management",
        "guideline_code": "NICE NG80 / BTS-SIGN",
        "category": "Respiratory",
        "keywords": ["asthma", "wheeze", "salbutamol", "inhaler", "fev1", "feno", "peak flow", "ics", "laba", "beclometasone", "budesonide", "fluticasone", "mart", "ng80", "acute severe asthma", "severe asthma", "life-threatening", "life-threatening asthma", "feno 40", "prednisolone", "nebulised salbutamol", "short phrases", "silent chest", "asthmatic", "asthma maintenance", "dry cough", "cough", "worse at night", "nocturnal"],
        "diagnostic_criteria": (
            "Objective testing required for diagnosis in age >=5:\n"
            "• Fractional exhaled nitric oxide (FeNO) test: FeNO >=40 ppb in adults (>=35 ppb in children) confirms eosinophilic airway inflammation and supports asthma diagnosis.\n"
            "• Spirometry with bronchodilator reversibility (BDR): FEV1/FVC < 0.70 with improvement >=12% and >=200 ml post-salbutamol.\n"
            "• Peak Expiratory Flow (PEF) variability: >=20% diurnal variability over 2-4 weeks diary."
        ),
        "management_pathway": (
            "Stepwise Pharmacotherapy (BTS/NICE/GINA):\n"
            "• Step 1: Low-dose inhaled corticosteroid (ICS, e.g. Beclometasone 100-200mcg/day or Budesonide) PLUS short-acting beta2 agonist (SABA, Salbutamol 100mcg prn).\n"
            "  * Note: Modern guidelines discourage SABA-only monotherapy due to risk of severe exacerbations.\n"
            "• Step 2: Add Long-Acting Beta2 Agonist (LABA) in fixed combination with ICS (e.g. Formoterol/Budesonide or Fostair). MART (Maintenance and Reliever Therapy) regimen preferred.\n"
            "• Step 3: Increase ICS to moderate dose, OR add Leukotriene Receptor Antagonist (LTRA, Montelukast 10mg OD nocte).\n"
            "• Step 4: High-dose ICS/LABA, add Long-Acting Muscarinic Antagonist (LAMA, Tiotropium), or refer to difficult asthma / biologics clinic.\n\n"
            "Always check inhaler technique and adherence before escalating any step.\n\n"
            "Acute Adult Asthma Exacerbation Protocol:\n"
            "• Moderate exacerbation: PEFR 50-75% best/predicted -> Inhaled SABA (Salbutamol) via spacer + Oral Prednisolone 40-50mg daily for 5 days.\n"
            "• Acute severe asthma (RR >=25, HR >=110, speaking in short phrases, PEFR 33-50%): High-dose nebulised salbutamol 5mg with oxygen, oral prednisolone 40-50mg, and urgent hospital admission.\n"
            "• Life-threatening asthma exacerbation (PEFR <33%, SpO2 <92%, silent chest, cyanosis, exhaustion): Immediate 999 ambulance blue-light emergency transfer, high-flow oxygen, nebulised salbutamol + ipratropium, and IV hydrocortisone or oral prednisolone."
        ),
        "red_flags": [
            "Acute Severe Asthma: PEF 33-50% predicted, inability to complete sentences in one breath, RR >=25/min, HR >=110 bpm -> High-dose SABA via spacer or nebuliser + oral prednisolone 40-50mg + arrange emergency transfer if not rapidly resolving.",
            "Life-Threatening Asthma: PEF <33% predicted, SpO2 <92%, silent chest, cyanosis, bradycardia, confusion/exhaustion -> 999 Immediate blue-light transfer, high-flow O2, nebulised Salbutamol + Ipratropium, IV access."
        ],
        "monitoring": "Annual asthma review using Asthma Control Test (ACT) score, check inhaler technique, issue Personalised Asthma Action Plan (PAAP)."
    },
    {
        "id": "NICE-NG203",
        "title": "Chronic kidney disease: assessment and management",
        "guideline_code": "NICE NG203",
        "category": "Renal",
        "keywords": ["ckd", "kidney", "egfr", "creatinine", "proteinuria", "uacr", "urine acr", "dapagliflozin", "ramipril", "losartan", "potassium"],
        "diagnostic_criteria": (
            "CKD diagnosed if eGFR <60 ml/min/1.73m2 OR urine albumin-to-creatinine ratio (uACR) >= 3 mg/mmol sustained on repeat test for >=3 months.\n"
            "Staging: G1 (>=90), G2 (60-89), G3a (45-59), G3b (30-44), G4 (15-29), G5 (<15 / kidney failure).\n"
            "Albuminuria: A1 (<3 mg/mmol, normal), A2 (3-30 mg/mmol, microalbuminuria), A3 (>30 mg/mmol, severe)."
        ),
        "management_pathway": (
            "Blood pressure target: Clinic <140/90 mmHg (or <130/80 mmHg if uACR >=70 mg/mmol or in diabetes with uACR >=3 mg/mmol).\n\n"
            "Renoprotection:\n"
            "• ACE inhibitor or ARB: Offer if uACR >=30 mg/mmol (or >=3 mg/mmol in patients with diabetes and hypertension). Titrate to maximum tolerated dose.\n"
            "• SGLT2 Inhibitor (Dapagliflozin 10mg OD or Empagliflozin 10mg OD): Recommended by NICE for adults with CKD (eGFR 20-45 ml/min/1.73m2, or eGFR 45-60 with uACR >=22.6 mg/mmol, or with T2DM) to slow progression and reduce cardiovascular death.\n"
            "• Statin: Offer Atorvastatin 20mg OD for primary/secondary prevention of CVD in all CKD patients."
        ),
        "red_flags": [
            "Acute Kidney Injury (AKI): rapid rise in serum creatinine by >=50% in 7 days or >=26 umol/L in 48h.",
            "eGFR <15 ml/min/1.73m2 (G5) or sustained drop in eGFR >=25% within 12 months.",
            "uACR >=70 mg/mmol without diabetes (unless known to be caused by diabetic nephropathy and previously investigated).",
            "CKD with severe hyperkalaemia (K+ >=6.5 mmol/L or >=6.0 with ECG changes): emergency admission."
        ],
        "monitoring": "Monitor eGFR and uACR at least annually (G3a A1) up to 4 times a year for high risk (G4/G5 or A3). Check U&Es 1-2 weeks after starting or titrating ACEi/ARB."
    },
    {
        "id": "NICE-NG222",
        "title": "Depression in adults: treatment and management",
        "guideline_code": "NICE NG222",
        "category": "Mental Health",
        "keywords": ["depression", "low mood", "anxiety", "phq9", "ssri", "sertraline", "citalopram", "fluoxetine", "cbt", "talking therapy", "suicide"],
        "diagnostic_criteria": (
            "DSM-5 / ICD-11 core symptoms: persistent sadness or low mood, and/or loss of interest or pleasure (anhedonia) for >=2 weeks.\n"
            "Assess severity using validated tool (e.g. PHQ-9: 5-9 mild, 10-14 moderate, 15-19 moderately severe, 20-27 severe)."
        ),
        "management_pathway": (
            "Less severe / Mild depression:\n"
            "• Do NOT routinely offer antidepressant medication as first-line unless patient explicitly prefers it, has past history of moderate/severe depression, or symptoms persist >=3 months.\n"
            "• First-line: High-intensity/low-intensity psychological interventions (NHS Talking Therapies / self-help CBT, behavioural activation, group exercise).\n\n"
            "Moderate to Severe depression:\n"
            "• Offer a choice of evidence-based psychological therapy (individual CBT) OR an antidepressant (SSRI), or combination.\n"
            "• First-line SSRI: Sertraline (50mg OD, titrate to max 200mg) or Citalopram (20mg OD, max 40mg, max 20mg in elderly/cardiac risk).\n"
            "• Sertraline is preferred first-line in patients with concurrent physical illness (e.g. post-MI / cardiovascular disease).\n"
            "• Advise that onset of therapeutic benefit takes 2-4 weeks; continue treatment for at least 6 months after full remission to prevent relapse."
        ),
        "red_flags": [
            "Active suicidal ideation with intent, plan, or recent self-harm: urgent mental health crisis team assessment (NHS Crisis Resolution Team / A&E psychiatric liaison).",
            "Psychotic depression (delusions, auditory hallucinations) or severe self-neglect / refusal of food/fluids: emergency psychiatric admission.",
            "Suspected bipolar depression (history of hypomania/mania): avoid antidepressant monotherapy without mood stabilizer due to risk of manic switch."
        ],
        "monitoring": "Review patient within 1-2 weeks of starting antidepressant (or 1 week if aged <25 years or increased suicide risk). Assess side effects, suicidal ideation, and early response."
    },
    {
        "id": "NICE-NG109",
        "title": "Urinary tract infection (lower): antimicrobial prescribing",
        "guideline_code": "NICE NG109 / UKHSA",
        "category": "Infectious Disease / Primary Care",
        "keywords": ["uti", "cystitis", "dysuria", "nitrofurantoin", "trimethoprim", "dipstick", "urine culture", "pyelonephritis"],
        "diagnostic_criteria": (
            "Non-pregnant women <65 with >=2 key symptoms (dysuria, new nocturia, cloudy urine) and no vaginal discharge: diagnosis can be made without urine dipstick.\n"
            "Urine culture indicated in: pregnancy, men, children, recurrent UTI (>=2 in 6 months or >=3 in 12 months), treatment failure, or suspected pyelonephritis."
        ),
        "management_pathway": (
            "First-line empirical antimicrobial (adult non-pregnant women):\n"
            "• Nitrofurantoin: 100mg modified-release BD for 3 days (caution if eGFR <45 ml/min).\n"
            "• Alternative first-line: Trimethoprim 200mg BD for 3 days (only if low risk of resistance or known sensitive).\n\n"
            "Men with uncomplicated lower UTI:\n"
            "• Nitrofurantoin 100mg MR BD for 7 days (or Trimethoprim 200mg BD for 7 days). Always send midstream urine (MSU) culture.\n\n"
            "Pregnant women:\n"
            "• Nitrofurantoin 100mg MR BD for 7 days (avoid at term / 36+ weeks due to risk of neonatal haemolysis), or Amoxicillin/Cefalexin based on sensitivities. Always send MSU."
        ),
        "red_flags": [
            "Upper UTI / Acute Pyelonephritis: flank/loin pain, fever, rigors, nausea/vomiting -> require oral Ciprofloxacin or Co-amoxiclav for 7-14 days; hospital admission if sepsis, vomiting, or pregnant.",
            "Urosepsis: NEWS2 score >=5, confusion, tachypnoea, tachycardia, hypotensive -> immediate emergency transfer."
        ],
        "monitoring": "Advise safety netting: seek medical attention if symptoms worsen, do not improve within 48 hours, or systemic features develop."
    },
    {
        "id": "NICE-NG196",
        "title": "Atrial fibrillation: diagnosis and management",
        "guideline_code": "NICE NG196",
        "category": "Cardiovascular",
        "keywords": ["af", "atrial fibrillation", "irregular pulse", "chadsvasc", "hasbled", "orbit", "doac", "apixaban", "edoxaban", "rivaroxaban", "bisoprolol"],
        "diagnostic_criteria": (
            "Suspected in irregular pulse; confirm diagnosis with 12-lead ECG (absence of P waves, irregular RR intervals)."
        ),
        "management_pathway": (
            "Stroke Risk Stratification:\n"
            "• Calculate CHA2DS2-VASc score (Congestive heart failure, Hypertension, Age >=75 [2 pts], Diabetes, Stroke/TIA [2 pts], Vascular disease, Age 65-74, Sex category female [1 pt]).\n"
            "• Offer anticoagulation if score >=2 (men or women), or consider if score 1 in men.\n\n"
            "Anticoagulation Choice:\n"
            "• First-line: Direct-acting oral anticoagulant (DOAC, e.g. Apixaban 5mg BD, Edoxaban 60mg OD, or Rivaroxaban 20mg OD) in preference to Warfarin.\n"
            "• Assess bleeding risk using ORBIT (or HAS-BLED) score to address modifiable bleeding risks (uncontrolled BP, alcohol, concurrent NSAIDs/antiplatelets).\n\n"
            "Rate Control (First-line in non-acute setting):\n"
            "• Standard monotherapy: Beta-blocker (Bisoprolol 2.5-10mg OD) OR rate-limiting CCB (Diltiazem or Verapamil - avoid in heart failure).\n"
            "• Target resting heart rate: <90 bpm (or <110 bpm if asymptomatic and preserved LV function)."
        ),
        "red_flags": [
            "Haemodynamically unstable AF (SBP <90 mmHg, acute pulmonary oedema, ongoing ischaemia, altered consciousness): emergency 999 hospital admission for urgent DC cardioversion.",
            "Suspected new stroke or TIA: emergency stroke assessment / same-day TIA clinic referral."
        ],
        "monitoring": "Review anticoagulation adherence, bleeding events, renal function (eGFR to adjust DOAC dose), and liver function annually (or every 3-6 months if frail/elderly)."
    },
    {
        "id": "NICE-CG95",
        "title": "Recent-onset chest pain of suspected cardiac origin: assessment and diagnosis",
        "guideline_code": "NICE CG95",
        "category": "Cardiovascular / Emergency Assessment",
        "keywords": ["chest pain", "angina", "mi", "myocardial infarction", "acs", "acute coronary syndrome", "ecg", "troponin", "gtn", "aspirin", "retrosternal", "chest tightness", "walking uphill", "exertion", "exertional", "racpc", "ctca", "cg95"],
        "diagnostic_criteria": (
            "Assessment for Acute Coronary Syndrome (ACS) vs. Stable Angina:\n"
            "• Acute chest pain: Central constricting/heavy chest pain radiating to neck/jaw/left arm, associated with diaphoresis, nausea, or shortness of breath."
        ),
        "management_pathway": (
            "Acute Suspected ACS Pathway:\n"
            "• Immediately call 999 for emergency blue-light ambulance transfer to nearest Cardiac Catheterisation Centre / ED.\n"
            "• Immediate primary care management while awaiting ambulance:\n"
            "  - Soluble Aspirin 300mg chewed (unless known true anaphylaxis).\n"
            "  - Sublingual GTN spray 1-2 puffs (unless SBP <90 mmHg or phosphodiesterase-5 inhibitor used within 24h).\n"
            "  - Perform 12-lead ECG immediately if equipment available (do NOT delay transfer).\n"
            "  - Supplemental O2 only if SpO2 <94% (or <88% in hypercapnic COPD).\n\n"
            "Stable Chest Pain (Suspected Angina):\n"
            "• Characterise pain: (1) Constricting discomfort in front of chest/neck/shoulders/jaw/arms; (2) Precipitated by physical exertion; (3) Relieved by rest or GTN within 5 minutes.\n"
            "  - 3 features: Typical angina.\n"
            "  - 2 features: Atypical angina.\n"
            "  - 0-1 feature: Non-anginal chest pain.\n"
            "• Urgent Rapid Access Chest Pain Clinic (RACPC) referral for CT coronary angiography (CTCA) within 2 weeks if typical or atypical angina."
        ),
        "red_flags": [
            "Pain persisting >15 minutes at rest or newly accelerating in frequency/severity (Unstable Angina / STEMI / NSTEMI) -> 999 Emergency.",
            "Tearing chest pain radiating through to back (Suspected Aortic Dissection) -> 999 Emergency (avoid Aspirin).",
            "Pleuritic chest pain with acute breathlessness and tachycardia (Suspected Pulmonary Embolism - Wells score)."
        ],
        "monitoring": "For confirmed stable angina: start secondary prevention (Aspirin 75mg OD, Atorvastatin 80mg OD) + anti-anginal (Bisoprolol or Amlodipine) + PRN sublingual GTN."
    },
    {
        "id": "NICE-CG184",
        "title": "Gastro-oesophageal reflux disease and dyspepsia in adults: investigation and management",
        "guideline_code": "NICE CG184",
        "category": "Gastroenterology",
        "keywords": ["dyspepsia", "indigestion", "heartburn", "gerd", "gord", "reflux", "ppi", "omeprazole", "lansoprazole", "h pylori", "helicobacter", "cg184", "haematemesis", "melaena", "vomiting blood", "tarry stools", "upper gi bleed", "burning retrosternal", "burning retrosternal pain", "acid taste", "antacids", "peptic ulcer", "nsaid", "naproxen", "endoscopy"],
        "diagnostic_criteria": (
            "First step: Check for RED FLAG cancer alarm features (age >=55 with unexplained weight loss AND upper abdominal pain/reflux; or dysphagia at any age -> 2WW urgent endoscopy).\n"
            "In uninvestigated dyspepsia without red flags: offer lifestyle advice + test-and-treat for Helicobacter pylori (urea breath test or stool antigen test)."
        ),
        "management_pathway": (
            "Management of H. pylori negative or uncomplicated GORD:\n"
            "• Full-dose Proton Pump Inhibitor (PPI, e.g. Omeprazole 20mg OD or Lansoprazole 30mg OD) for 4 weeks (GORD requires 4-8 weeks).\n"
            "• If symptoms recur after stopping, step down to lowest effective maintenance dose PRN.\n\n"
            "If H. pylori positive:\n"
            "• First-line 7-day eradication triple therapy: PPI (e.g. Omeprazole 20mg BD) + Amoxicillin 1g BD + Clarithromycin 500mg BD (or Metronidazole 400mg BD if penicillin allergic).\n"
            "• Re-test for eradication only if symptoms persist or patient has high ulcer recurrence risk (at least 2 weeks after stopping PPI and 4 weeks after stopping antibiotics).\n\n"
            "Upper GI Bleeding & Acute Peptic Ulcer Emergencies:\n"
            "• Sudden haematemesis (vomiting blood), melaena (black tarry stools), or collapse (e.g. from high-dose NSAID/Naproxen-induced ulcer): Call 999 for immediate emergency hospital admission, urgent IV fluid resuscitation, and inpatient endoscopy.\n\n"
            "Endoscopy Referral Criteria:\n"
            "• Urgent 2WW endoscopy: if alarm features (dysphagia at any age, or age >=55 with weight loss + dyspepsia/reflux, or upper GI bleed/mass).\n"
            "• Non-urgent endoscopy: consider for patients with refractory symptoms unresponsive to full-dose PPI trials or recurrent vomiting."
        ),
        "red_flags": [
            "Dysphagia (difficulty swallowing) at any age -> immediate 2-week wait referral.",
            "Unexplained upper abdominal mass or persistent vomiting -> urgent 2WW.",
            "Haematemesis or melaena (acute upper GI bleed) -> same-day emergency hospital admission."
        ],
        "monitoring": "Review long-term PPI indications annually to reduce risks of hypomagnesaemia, Clostridioides difficile, and bone fractures."
    }
]