What should I know about ugi bleed as SHO in nhs, give in points
"Gastrointestinal Hemorrhage"[MeSH Terms] AND "upper"
NICE NG141 acute upper gastrointestinal bleeding management Glasgow-Blatchford transfusion threshold endoscopy timing
Make a one-page PDF quick reference card for UGIB
ls -la /tmp/workspace/
mkdir -p /tmp/workspace/ugib-card && cat > /tmp/workspace/ugib-card/make.py << 'EOF' from reportlab.lib.pagesizes import A4 from reportlab.pdfgen import canvas from reportlab.lib import colors from reportlab.platypus import Paragraph, Frame, KeepInFrame from reportlab.lib.styles import ParagraphStyle W, H = A4 M = 24 out = "/tmp/workspace/ugib-card/UGIB_Quick_Reference_Card.pdf" c = canvas.Canvas(out, pagesize=A4) c.setTitle("UGIB Quick Reference Card (NHS SHO)") NAVY = colors.HexColor("#1F3A5F"); RED = colors.HexColor("#B3261E"); LIGHT = colors.HexColor("#EEF2F7") # Header c.setFillColor(NAVY); c.rect(0, H-52, W, 52, fill=1, stroke=0) c.setFillColor(colors.white); c.setFont("Helvetica-Bold", 18) c.drawString(M, H-33, "Upper GI Bleed: SHO Quick Reference") c.setFont("Helvetica", 8.5) c.drawRightString(W-M, H-24, "Based on NICE CG141 + standard UK practice") c.drawRightString(W-M, H-37, "Check local trust policy for doses/thresholds") body = ParagraphStyle("b", fontName="Helvetica", fontSize=7.8, leading=9.6, spaceAfter=1.2, leftIndent=7, bulletIndent=0) def B(items): return "".join(f"<bullet>•</bullet>{i}<br/>" for i in items) sections = { "1. ABCDE and first 15 min": [ "Senior/registrar aware early. NEWS2, <b>2 x 14-16G cannulae</b>, NBM", "Bloods: FBC, U&E (urea up), LFT, clotting + fibrinogen, <b>group & save/crossmatch</b>, VBG + lactate, glucose", "ECG +/- troponin if cardiac risk. Catheter if unstable", "Hx: anticoagulant/antiplatelet (DOAC type, last dose), NSAIDs, steroids, SSRI, alcohol, liver disease, prior ulcer", "Exam: melaena on PR, liver stigmata, abdomen", "<b>Traps:</b> Hb may be normal early; beta-blockers mask tachycardia; elderly look well until they crash", ], "2. Risk score": [ "<b>Glasgow-Blatchford (GBS)</b> at first assessment (urea, Hb, SBP, HR, melaena, syncope, liver disease, heart failure)", "GBS <b>0</b>: consider early/outpatient management (some guidelines use 0-1)", "Anything higher, unstable, active haematemesis, varices suspected, or significant comorbidity: <b>admit</b>", "<b>Rockall</b> after endoscopy", ], "3. Fluids and blood": [ "Cautious crystalloid for shock. <b>Avoid over-filling</b>, esp. cirrhosis and heart failure", "Massive bleed: activate <b>Major Haemorrhage Protocol</b>", "Restrictive transfusion: commonly <b>Hb <70 g/L, target 70-90</b> (slightly higher in IHD). <i>Confirm local threshold</i>", "Platelets if actively bleeding and <50. FFP if fibrinogen <1 g/L or PT/APTT >1.5x normal", "<b>Warfarin:</b> PCC + IV vitamin K. <b>Dabigatran:</b> idarucizumab. <b>Apixaban/rivaroxaban</b> (life-threatening): andexanet alfa is a NICE option. Discuss with haematology", ], "4. Drugs": [ "<b>PPI before endoscopy:</b> NICE says do not offer in suspected non-variceal UGIB (many wards still do; follow local practice)", "<b>PPI after endoscopy</b> if stigmata of recent haemorrhage; high-dose IV for high-risk lesions per endoscopist", "<b>Hold:</b> NSAIDs, anticoagulants, antihypertensives if hypotensive. Consider metformin if AKI", "Secondary-prevention <b>aspirin:</b> do not stop long term; restart once haemostasis secure (senior/GI input)", "VTE prophylaxis: mechanical only while bleeding", ], "5. Suspected VARICES (chronic liver disease / alcohol)": [ "Start <b>before</b> endoscopy: <b>terlipressin</b> (check IHD/PVD) + <b>IV prophylactic antibiotics</b> (local policy, often ceftriaxone)", "Endoscopy within ~12 h of resus: <b>band ligation</b>. Gastric varices: cyanoacrylate glue", "Uncontrolled: balloon tamponade (Sengstaken/Linton) as bridge, then <b>TIPS</b>. Needs senior + ITU", "Alcohol withdrawal: chlordiazepoxide + Pabrinex. Lactulose/enema for encephalopathy risk", "INR is unreliable in cirrhosis. Don't over-transfuse", ], "6. Endoscopy timing (NICE CG141)": [ "<b>Unstable, severe bleed:</b> endoscopy immediately after resuscitation", "<b>All others:</b> within <b>24 h</b> of admission", "Refer clearly: GBS, haemodynamics, anticoagulants, comorbidity, what you have given", ], "7. After endoscopy / rebleed": [ "Follow report: PPI plan, diet, drug restart. Test and treat <b>H. pylori</b>. Avoid NSAIDs", "<b>Rebleed:</b> repeat endoscopy. Unstable after endoscopic therapy: <b>interventional radiology</b> embolisation. Then surgery", "Repeat Hb/FBC after resus and each transfusion", ], "8. Escalate NOW if": [ "SBP <100 or HR >100, ongoing haematemesis, raised lactate, >2 units needed", "Cirrhosis, anticoagulated, or multiple comorbidities", "Airway risk (big haematemesis, low GCS): call ITU/outreach", "Document TEP/ceiling of care early in frail patients. Hourly obs and fluid balance while unstable", ], "9. Common mistakes": [ "One small cannula; late group & save", "Over-fluiding cirrhotics", "Not starting terlipressin + antibiotics for possible varices", "Forgetting to hold anticoagulants/NSAIDs", "Trusting a normal Hb; vague handover with no Hb trigger, repeat bloods or escalation plan", ], } colw = (W - 2*M - 10)/2 left = ["1. ABCDE and first 15 min","2. Risk score","3. Fluids and blood","4. Drugs"] right = ["5. Suspected VARICES (chronic liver disease / alcohol)","6. Endoscopy timing (NICE CG141)","7. After endoscopy / rebleed","8. Escalate NOW if","9. Common mistakes"] def draw_col(x, keys, ytop, ybottom): y = ytop for k in keys: items = sections[k] p = Paragraph(B(items), body) w, h = p.wrap(colw-12, 2000) hdr = 14 boxh = hdr + h + 8 col = RED if ("Escalate" in k or "VARICES" in k) else NAVY c.setFillColor(LIGHT); c.roundRect(x, y-boxh, colw, boxh, 4, fill=1, stroke=0) c.setFillColor(col); c.roundRect(x, y-hdr, colw, hdr, 4, fill=1, stroke=0) c.rect(x, y-hdr, colw, 5, fill=1, stroke=0) c.setFillColor(colors.white); c.setFont("Helvetica-Bold", 8.8) c.drawString(x+6, y-10.5, k) p.drawOn(c, x+6, y-hdr-3-h) y -= boxh + 6 return y ytop = H-62 y1 = draw_col(M, left, ytop, 40) y2 = draw_col(M+colw+10, right, ytop, 40) print("left bottom", y1, "right bottom", y2) c.setFont("Helvetica-Oblique", 6.8); c.setFillColor(colors.HexColor("#555555")) c.drawString(M, 22, "Educational aid only, not a substitute for local guidelines or senior advice. Source: NICE CG141 (acute UGIB in over 16s); Tintinalli's Emergency Medicine.") c.drawString(M, 13, "Verify doses, transfusion thresholds and antibiotic choice against your trust UGIB pathway and BNF.") c.save() EOF python3 /tmp/workspace/ugib-card/make.py
cd /tmp/workspace/ugib-card && python3 - << 'EOF' s = open("make.py").read() s = s.replace('''def B(items): return "".join(f"<bullet>•</bullet>{i}<br/>" for i in items)''', '''def B(items): return [Paragraph(i, body, bulletText="\\u2022") for i in items]''') s = s.replace(''' p = Paragraph(B(items), body) w, h = p.wrap(colw-12, 2000)''',''' ps = B(items) h = 0 hs = [] for p in ps: w, ph = p.wrap(colw-12, 2000); hs.append(ph); h += ph''') s = s.replace(''' p.drawOn(c, x+6, y-hdr-3-h)''',''' yy = y-hdr-3 for p, ph in zip(ps, hs): yy -= ph p.drawOn(c, x+6, yy)''') open("make.py","w").write(s) EOF python3 make.py && python3 -c " import pdfplumber p=pdfplumber.open('/tmp/workspace/ugib-card/UGIB_Quick_Reference_Card.pdf');print(len(p.pages)) p.pages[0].to_image(resolution=80).save('/tmp/workspace/ugib-card/prev.png')"
cd /tmp/workspace/ugib-card && sed -i 's/fontSize=7.8, leading=9.6, spaceAfter=1.2/fontSize=9.6, leading=11.8, spaceAfter=2.2/; s/"Helvetica-Bold", 8.8/"Helvetica-Bold", 10.5/; s/hdr = 14$/hdr = 17/; s/y-10.5, k/y-12.5, k/' make.py && python3 make.py && python3 -c " import pdfplumber p=pdfplumber.open('/tmp/workspace/ugib-card/UGIB_Quick_Reference_Card.pdf');print(len(p.pages)) p.pages[0].to_image(resolution=90).save('/tmp/workspace/ugib-card/prev.png')"
cd /tmp/workspace/ugib-card && sed -i 's/5. Suspected VARICES (chronic liver disease \/ alcohol)/5. Suspected VARICES (liver disease)/g; s/fontSize=9.6, leading=11.8, spaceAfter=2.2/fontSize=10.6, leading=13, spaceAfter=3/' make.py && python3 make.py && python3 -c " import pdfplumber p=pdfplumber.open('/tmp/workspace/ugib-card/UGIB_Quick_Reference_Card.pdf');print(len(p.pages)) p.pages[0].to_image(resolution=90).save('/tmp/workspace/ugib-card/prev.png')"
cd /tmp/workspace/ugib-card && python3 -c " import pdfplumber p=pdfplumber.open('UGIB_Quick_Reference_Card.pdf');print(len(p.pages)) p.pages[0].to_image(resolution=90).save('prev2.png')"
UGIB Quick Reference Card
PDF Document · PDF