Read the above data and gadd the mocosoties management step wise approach and dose of drug Composition of magic mouth wajs and modified magic mouth washh
python3 -c " from docx import Document doc = Document('/tmp/workspace/attachments/46d39c54-5d4e-4ce4-99d6-f33910739ce6/Mucositis_ESMO_Guideline_Summary.docx') for p in doc.paragraphs: style = p.style.name if p.style else 'None' if p.text.strip(): print(f'[{style}] {p.text}') "
| Grade | WHO Description | NCI CTCAE Description |
|---|---|---|
| 0 | No mucositis | None |
| 1 | Soreness/erythema | Asymptomatic or mild symptoms |
| 2 | Erythema, ulcers, can eat solids | Moderate pain, not interfering with oral intake |
| 3 | Ulcers, requires liquid diet only | Severe pain, interfering with oral intake |
| 4 | Alimentation not possible | Life-threatening; urgent intervention required |
| Component | Role | Concentration |
|---|---|---|
| 2% Viscous Lidocaine | Topical anesthetic | 2% solution |
| Diphenhydramine elixir (12.5 mg/5 mL) | Antihistamine, mild anesthetic, anti-inflammatory | 12.5 mg/5 mL |
| Maalox (Magnesium + Aluminum hydroxide) | Antacid/coating agent, suspending medium | Standard suspension |
Source: Roberts and Hedges' Clinical Procedures in Emergency Medicine; Dermatology 2-Volume Set 5e
| Component | Role |
|---|---|
| Tetracycline | Antibacterial |
| Diphenhydramine | Antihistamine / mild anesthetic |
| Nystatin | Antifungal |
| Hydrocortisone | Anti-inflammatory / mucosal healing |
Source: Cummings Otolaryngology Head and Neck Surgery
| Component | Dose |
|---|---|
| Diphenhydramine | Standard elixir concentration |
| 2% Lidocaine | Viscous solution |
| Antacid (Maalox/Mylanta) | Standard suspension |
| ± Dexamethasone | 0.5 mg/5 mL (dexamethasone elixir) - especially for mTOR inhibitor-induced mucositis |
Source: Goldman-Cecil Medicine; Harrison's Principles of Internal Medicine 22E
| Feature | Classic Magic Mouthwash | Modified Magic Mouthwash |
|---|---|---|
| Components | Lidocaine + Diphenhydramine + Maalox | Tetracycline + Diphenhydramine + Nystatin + Hydrocortisone |
| Antifungal | No | Yes (Nystatin) |
| Antibacterial | No | Yes (Tetracycline) |
| Anti-inflammatory | Mild (diphenhydramine) | Yes (Hydrocortisone) |
| Topical anesthetic | Yes (Lidocaine) | Indirect (Diphenhydramine) |
| Preparation | Equal parts (1:1:1) | Compounded by pharmacy |
| Dose | 5 mL, swish 1-2 min, expectorate | 10 mL (2 tsp), swish + gargle 3x/day, swallow |
| Best for | General mucositis pain relief, emergency use | Radiation-induced stomatitis + pharyngitis |
| Drug | Indication | Dose/Instructions |
|---|---|---|
| Benzydamine oral rinse | Prevention, moderate-dose RT to H&N | Rinse per product label |
| Palifermin (KGF-1) | Prevention, HSCT with TBI | 60 µg/kg/day IV x3 days pre + 3 days post-transplant |
| 2% Viscous Lidocaine | Topical analgesia | 5 mL swish and spit; max 250-300 mg total dose |
| Morphine (PCA) | Severe pain, HSCT | PCA - patient-controlled dosing |
| Dexamethasone elixir | mTOR inhibitor mucositis | 0.5 mg/5 mL; swish and spit 5 mL BID-TID x 5 min |
| Nystatin suspension | Secondary candidal infection | 400,000-600,000 units, swish and swallow 4x/day |
| Clotrimazole troches | Secondary candidal infection | 10 mg troches 4x/day |
| Chlorhexidine 0.12% | Secondary infection support | Swish and spit BID (not recommended for mucositis prevention) |
| Octreotide | Loperamide-refractory diarrhea | ≥100 µg SC twice daily |
| Sulfasalazine | Prevention of radiation enteropathy | 500 mg orally twice daily |
| Sucralfate enema | Chronic radiation proctitis with bleeding | Per enema preparation |
| Clobetasol 0.05% gel | Topical anti-inflammatory | Apply to lesions BID-TID |
| Triamcinolone 0.1% paste | Topical anti-inflammatory | Apply to lesions BID-TID |
| Recommendation | Evidence Level | Grade |
|---|---|---|
| PCA morphine for HSCT mucositis pain | I | A |
| Benzydamine rinse for moderate-dose H&N RT | I | A |
| Palifermin for HSCT with TBI | I | A |
| Oral cryotherapy for bolus 5-FU | II | A |
| Oral cryotherapy for high-dose melphalan | II | A |
| Ranitidine/omeprazole for 5-FU epigastric pain | II | A |
| Basic oral care protocols (saline rinses) | III | B |
| Low-level laser therapy (HSCT) | II | B |
| Octreotide for loperamide-refractory diarrhea | II | A |
| Sulfasalazine for pelvic RT enteropathy | II | B |
| Chlorhexidine NOT recommended for prevention | II | B (against) |
| Sucralfate NOT recommended for RT oral mucositis | II | A (against) |
Generate a quick reference pocket card (PDF) for mucositis grading and drug dosing
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && ls -la /tmp/workspace/
mkdir -p /tmp/workspace/mucositis-card && python3 << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import mm, cm from reportlab.platypus import ( SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, HRFlowable, KeepTogether ) from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT from reportlab.lib.colors import HexColor # ── colour palette ────────────────────────────────────────────────────────── NAVY = HexColor("#1a3a5c") TEAL = HexColor("#0d7377") TEAL_LT = HexColor("#e0f4f4") AMBER = HexColor("#f59e0b") AMBER_LT = HexColor("#fef3c7") RED = HexColor("#dc2626") RED_LT = HexColor("#fee2e2") GREEN = HexColor("#16a34a") GREEN_LT = HexColor("#dcfce7") ORANGE = HexColor("#ea580c") ORANGE_LT = HexColor("#ffedd5") GREY_LT = HexColor("#f1f5f9") GREY_MED = HexColor("#cbd5e1") WHITE = colors.white BLACK = colors.black # ── document ──────────────────────────────────────────────────────────────── OUT = "/tmp/workspace/mucositis-card/Mucositis_Pocket_Card.pdf" doc = SimpleDocTemplate( OUT, pagesize=A4, leftMargin=12*mm, rightMargin=12*mm, topMargin=10*mm, bottomMargin=10*mm ) W = A4[0] - 24*mm # usable width styles = getSampleStyleSheet() def S(name, **kw): """Quick style builder.""" base = styles.get(name, styles["Normal"]) return ParagraphStyle(name + str(id(kw)), parent=base, **kw) # shared paragraph styles hdr_style = S("Normal", fontSize=7, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, leading=9) body_style = S("Normal", fontSize=6.8, textColor=BLACK, fontName="Helvetica", leading=8.5) body_bold = S("Normal", fontSize=6.8, textColor=BLACK, fontName="Helvetica-Bold", leading=8.5) body_small = S("Normal", fontSize=6.2, textColor=BLACK, fontName="Helvetica", leading=7.8) note_style = S("Normal", fontSize=5.8, textColor=HexColor("#475569"), fontName="Helvetica-Oblique", leading=7) def P(txt, style=None): return Paragraph(txt, style or body_style) def PB(txt): return Paragraph(txt, body_bold) # ============================================================ # HELPER: section header row spanning all columns # ============================================================ def sec_hdr(text, bg=NAVY, cols=1): return [Paragraph(f"<b>{text}</b>", hdr_style)] + [""] * (cols - 1) # ============================================================ # TITLE BANNER # ============================================================ title_data = [[ Paragraph( "<font color='white'><b>MUCOSITIS</b></font> " "<font color='#fbbf24' size=11><b>QUICK REFERENCE POCKET CARD</b></font>", ParagraphStyle("title", fontSize=13, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER, leading=16) ) ]] title_tbl = Table(title_data, colWidths=[W]) title_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), NAVY), ("ROWPADDING", (0,0), (-1,-1), 7), ("TOPPADDING", (0,0), (-1,-1), 8), ("BOTTOMPADDING", (0,0), (-1,-1), 8), ("ROUNDEDCORNERS", [4]), ])) subtitle_data = [[ Paragraph( "ESMO Guidelines 2011 | MASCC/ISOO | For clinical reference only", ParagraphStyle("sub", fontSize=7, fontName="Helvetica-Oblique", textColor=HexColor("#64748b"), alignment=TA_CENTER) ) ]] subtitle_tbl = Table(subtitle_data, colWidths=[W]) # ============================================================ # TABLE 1 — GRADING (WHO + NCI CTCAE) # ============================================================ G = [ [sec_hdr("MUCOSITIS GRADING (WHO Oral Toxicity Scale + NCI CTCAE v4.0)", NAVY, 4)], [PB("Grade"), PB("WHO Description"), PB("NCI CTCAE v4.0 Description"), PB("Action")], [P("0"), P("No mucositis"), P("None"), P("Routine oral care")], [P("1"), P("Soreness / erythema only"), P("Asymptomatic or mild symptoms"), P("Saline/bicarb rinses, soft diet")], [P("2"), P("Erythema + ulcers; can eat solids"), P("Moderate pain, not interfering with oral intake"), P("Add topical analgesia, Magic Mouthwash")], [P("3"), P("Ulcers; liquid diet required"), P("Severe pain, interfering with oral intake"), P("Opioids, consider PCA morphine, nutrition support")], [P("4"), P("Alimentation impossible"), P("Life-threatening; urgent intervention"), P("ICU/HDU, IV fluids, hospitalise, IV opioids")], ] grade_col = [14*mm, 46*mm, 65*mm, W - 14*mm - 46*mm - 65*mm] grade_tbl = Table(G, colWidths=grade_col, repeatRows=2) grade_colors = [RED_LT, ORANGE_LT, AMBER_LT, GREEN_LT, TEAL_LT] grade_bg = [RED, ORANGE, AMBER, GREEN, TEAL ] grade_tbl.setStyle(TableStyle([ # header ("SPAN", (0,0), (3,0)), ("BACKGROUND", (0,0), (3,0), NAVY), ("BACKGROUND", (0,1), (3,1), HexColor("#334155")), ("TEXTCOLOR", (0,1), (3,1), WHITE), ("FONTNAME", (0,1), (3,1), "Helvetica-Bold"), ("FONTSIZE", (0,1), (3,1), 7), ("ALIGN", (0,0), (-1,-1), "LEFT"), ("VALIGN", (0,0), (-1,-1), "MIDDLE"), ("ROWPADDING", (0,0), (-1,-1), 4), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ("GRID", (0,1), (-1,-1), 0.4, GREY_MED), ("LINEBELOW", (0,0), (-1,0), 0, WHITE), # grade row colours ("BACKGROUND", (0,2), (0,2), RED_LT), ("BACKGROUND", (0,3), (0,3), ORANGE_LT), ("BACKGROUND", (0,4), (0,4), AMBER_LT), ("BACKGROUND", (0,5), (0,5), GREEN_LT), ("BACKGROUND", (0,6), (0,6), TEAL_LT), ("FONTNAME", (0,2), (0,-1), "Helvetica-Bold"), ("FONTSIZE", (0,2), (0,-1), 8), ("ALIGN", (0,2), (0,-1), "CENTER"), ])) # ============================================================ # TABLE 2 — STEP-WISE MANAGEMENT # ============================================================ mgmt_cw = [18*mm, W - 18*mm] M = [ [sec_hdr("STEP-WISE MANAGEMENT APPROACH", TEAL, 2)], [PB("Step"), PB("Action")], [P("STEP 1\nAssess & Grade"), P("Use WHO or NCI CTCAE scale. Check CBC, hydration status, nutritional risk.")], [P("STEP 2\nBasic Oral Care\n(ALL grades)"), P("• Saline / sodium bicarbonate rinse 4–6×/day [III, B]\n" "• Soft toothbrush; NO alcohol-based rinse\n" "• Nutritional screening; enteral nutrition if swallowing impaired\n" "• Adequate oral hydration")], [P("STEP 3\nTopical Analgesia\n(Grade 2+)"), P("• 2% Viscous Lidocaine added to saline rinse – swish & spit\n" "• Magic Mouthwash (see box) – 5 mL, swish 1–2 min, expectorate\n" "• Topical protectants: Gelclair / Caphosol / Biotene\n" "• Doxepin mouthrinse for severe mucositis")], [P("STEP 4\nSystemic Analgesia\n(Grade 3–4)"), P("• PCA Morphine – treatment of choice in HSCT [I, A]\n" "• Regular pain assessment with validated self-report tools\n" "• Consider hospitalisation if: severe pain, dehydration, neutropenic fever, infection")], [P("STEP 5\nNutritional\nSupport"), P("• Early enteral nutrition (NG tube / gastrostomy) if oral intake impossible\n" "• Screen for malnutrition at each visit")], [P("STEP 6\nPrevention\n(Context-specific)"), P("• H&N RT: Benzydamine rinse [I, A] | 3D conformal planning [II, B]\n" "• Bolus 5-FU: Oral cryotherapy (ice chips) [II, A]\n" "• HSCT + TBI: Palifermin 60 µg/kg/day IV ×3 pre + ×3 post [I, A]\n" "• High-dose melphalan: Oral cryotherapy [II, A]\n" "• HSCT: Low-level laser therapy (where available) [II, B]")], [P("STEP 7\nGI Mucositis"), P("• First-line diarrhea: Loperamide\n" "• Loperamide failure: Octreotide ≥100 µg SC BD [II, A]\n" "• Pelvic RT enteropathy prevention: Sulfasalazine 500 mg BD [II, B]\n" "• Radiation proctitis + bleeding: Sucralfate enemas [III, B]")], ] mgmt_tbl = Table(M, colWidths=mgmt_cw, repeatRows=2) mgmt_tbl.setStyle(TableStyle([ ("SPAN", (0,0), (1,0)), ("BACKGROUND", (0,0), (-1,0), TEAL), ("BACKGROUND", (0,1), (-1,1), HexColor("#0f766e")), ("TEXTCOLOR", (0,1), (-1,1), WHITE), ("FONTNAME", (0,1), (-1,1), "Helvetica-Bold"), ("FONTSIZE", (0,1), (-1,1), 7), ("ALIGN", (0,0), (-1,-1), "LEFT"), ("VALIGN", (0,0), (-1,-1), "TOP"), ("ROWPADDING", (0,0), (-1,-1), 4), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("GRID", (0,1), (-1,-1), 0.4, GREY_MED), ("LINEBELOW", (0,0), (-1,0), 0, WHITE), ("BACKGROUND", (0,2), (0,-1), TEAL_LT), ("FONTNAME", (0,2), (0,-1), "Helvetica-Bold"), ("FONTSIZE", (0,2), (0,-1), 6.5), ("ALIGN", (0,2), (0,-1), "CENTER"), ("VALIGN", (0,2), (0,-1), "MIDDLE"), # alternate row tints for readability ("BACKGROUND", (1,3), (1,3), GREY_LT), ("BACKGROUND", (1,5), (1,5), GREY_LT), ("BACKGROUND", (1,7), (1,7), GREY_LT), ("BACKGROUND", (1,9), (1,9), GREY_LT), ])) # ============================================================ # TABLE 3 — MAGIC MOUTHWASH (left) + MODIFIED (right) # ============================================================ mw_cw = [(W - 3*mm) / 2, (W - 3*mm) / 2] def mw_hdr(txt, bg): return Paragraph(f"<b>{txt}</b>", hdr_style) MWL = [ # Classic [mw_hdr("CLASSIC MAGIC MOUTHWASH", NAVY)], [P("<b>Components (1:1:1 equal parts)</b>")], [P("1. 2% Viscous Lidocaine")], [P("2. Diphenhydramine elixir 12.5 mg/5 mL")], [P("3. Maalox® (Mg + Al hydroxide suspension)")], [P("<b>Dose:</b> 5 mL per use")], [P("<b>Lidocaine per dose:</b> <50 mg (safe range)")], [P("<b>Method:</b> Swish & hold 1–2 min → EXPECTORATE")], [P("<b>Frequency:</b> Every 4–6 h as needed")], [P("<b>Use:</b> General mucositis pain relief; emergency use")], [P("<b>⚠ Do not swallow</b> – systemic toxicity risk,\nespecially in children", body_small)], ] MWR = [ # Modified [mw_hdr("MODIFIED MAGIC MOUTHWASH", HexColor("#7c3aed"))], [P("<b>Components (compounded by pharmacy)</b>")], [P("1. Tetracycline (antibacterial)")], [P("2. Diphenhydramine (antihistamine/anesthetic)")], [P("3. Nystatin (antifungal)")], [P("4. Hydrocortisone (anti-inflammatory)")], [P("<b>Dose:</b> 10 mL (2 teaspoons)")], [P("<b>Method:</b> Swish + gargle → SWALLOW")], [P("<b>Frequency:</b> 3 times daily")], [P("<b>Use:</b> Radiation-induced stomatitis & pharyngitis")], [P("Requires pharmacy compounding; covers\nbacterial + fungal secondary infection", body_small)], ] left_tbl = Table(MWL, colWidths=[mw_cw[0]]) right_tbl = Table(MWR, colWidths=[mw_cw[1]]) def mw_style(bg_hdr): return TableStyle([ ("BACKGROUND", (0,0), (-1,0), bg_hdr), ("ROWPADDING", (0,0), (-1,-1), 3), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3), ("ALIGN", (0,0), (-1,-1), "LEFT"), ("VALIGN", (0,0), (-1,-1), "TOP"), ("BACKGROUND", (0,1), (-1,1), HexColor("#f8fafc")), ("GRID", (0,0), (-1,-1), 0.4, GREY_MED), ("LINEBELOW", (0,0), (-1,0), 0, WHITE), ]) left_tbl.setStyle(mw_style(NAVY)) right_tbl.setStyle(mw_style(HexColor("#7c3aed"))) mw_outer = Table([[left_tbl, right_tbl]], colWidths=mw_cw, hAlign="LEFT", spaceBefore=0) mw_outer_hdr = Table( [[Paragraph("<b>MAGIC MOUTHWASH COMPOSITIONS</b>", hdr_style)]], colWidths=[W] ) mw_outer_hdr.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), NAVY), ("ROWPADDING", (0,0), (-1,-1), 5), ])) mw_outer.setStyle(TableStyle([ ("VALIGN", (0,0), (-1,-1), "TOP"), ("LEFTPADDING", (0,0), (-1,-1), 0), ("RIGHTPADDING", (0,0), (-1,-1), 0), ("TOPPADDING", (0,0), (-1,-1), 0), ("BOTTOMPADDING",(0,0), (-1,-1), 0), ("INNERGRID", (0,0), (-1,-1), 2, WHITE), ])) # ============================================================ # TABLE 4 — DRUG DOSING QUICK REFERENCE # ============================================================ drug_cw = [40*mm, 32*mm, W - 40*mm - 32*mm] D = [ [sec_hdr("DRUG DOSING QUICK REFERENCE", HexColor("#b45309"), 3)], [PB("Drug"), PB("Dose / Route"), PB("Indication & Evidence")], # Topical [P("<i>─ TOPICAL ─</i>"), P(""), P("")], [P("2% Viscous Lidocaine"), P("5 mL, swish & spit\nMax 250–300 mg total"), P("Grade 2+ oral mucositis topical analgesia")], [P("Magic Mouthwash (classic)"), P("5 mL q4–6h, expectorate"), P("Grade 2–3 pain relief; <50 mg lidocaine/dose")], [P("Modified Magic Mouthwash"), P("10 mL (2 tsp) TID, swallow"), P("Radiation stomatitis/pharyngitis (compounded)")], [P("Benzydamine oral rinse"), P("Per product label"), P("Prevention – moderate-dose H&N RT [I, A]")], [P("Dexamethasone elixir"), P("0.5 mg/5 mL; 5 mL BID–TID\nswish & spit, hold 5 min"), P("mTOR inhibitor-induced mucositis; anti-inflammatory")], [P("Nystatin suspension"), P("400,000–600,000 U\nswish & swallow QID"), P("Secondary oral candidiasis")], [P("Clotrimazole troches"), P("10 mg troche QID"), P("Secondary oral candidiasis")], [P("Chlorhexidine 0.12%"), P("5 mL swish & spit BID"), P("Secondary infection support (NOT for prevention [II, B])")], [P("Clobetasol 0.05% gel"), P("Apply BID–TID"), P("Topical anti-inflammatory for erosions/ulcers")], [P("Triamcinolone 0.1% paste"), P("Apply BID–TID"), P("Topical anti-inflammatory for oral ulcers")], # Systemic [P("<i>─ SYSTEMIC ─</i>"), P(""), P("")], [P("Morphine PCA"), P("Patient-controlled dosing"), P("Severe mucositis pain, HSCT patients [I, A]")], [P("Palifermin (KGF-1)"), P("60 µg/kg/day IV ×3 days\npre + ×3 days post-HSCT"), P("Prevention – HSCT + TBI, haematologic malignancy [I, A]")], [P("Octreotide"), P("≥100 µg SC BD"), P("Loperamide-refractory chemo-diarrhea [II, A]")], [P("Sulfasalazine"), P("500 mg orally BD"), P("Prevention – radiation-induced enteropathy, pelvic EBRT [II, B]")], [P("Ranitidine / Omeprazole"), P("Standard oral doses"), P("Prevention – epigastric pain with 5-FU/CMF regimens [II, A]")], [P("Amifostine (IV)"), P("Standard IV infusion"), P("Reduce esophagitis – concurrent chemoRT in NSCLC [III, C]")], [P("Amifostine (intrarectal)"), P("≥340 mg/m² IR"), P("Prevention – radiation proctitis, rectal cancer RT [III, B]")], # NOT recommended [P("<i>─ NOT RECOMMENDED ─</i>"), P(""), P("")], [P("Chlorhexidine (prophylaxis)"), P("—"), P("NOT for prevention in H&N RT patients [II, B]")], [P("Oral sucralfate"), P("—"), P("NOT for RT oral mucositis; more GI side-effects [II, A]")], [P("5-ASA / Mesalazine"), P("—"), P("NOT for GI mucositis prevention [I, A]")], [P("Systemic glutamine"), P("—"), P("NOT recommended for GI mucositis prevention [II, C]")], ] drug_tbl = Table(D, colWidths=drug_cw, repeatRows=2) drug_tbl.setStyle(TableStyle([ ("SPAN", (0,0), (2,0)), ("BACKGROUND", (0,0), (-1,0), HexColor("#b45309")), ("BACKGROUND", (0,1), (-1,1), HexColor("#92400e")), ("TEXTCOLOR", (0,1), (-1,1), WHITE), ("FONTNAME", (0,1), (-1,1), "Helvetica-Bold"), ("FONTSIZE", (0,1), (-1,1), 7), ("ALIGN", (0,0), (-1,-1), "LEFT"), ("VALIGN", (0,0), (-1,-1), "TOP"), ("ROWPADDING", (0,0), (-1,-1), 3), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3), ("GRID", (0,1), (-1,-1), 0.4, GREY_MED), ("LINEBELOW", (0,0), (-1,0), 0, WHITE), # separator rows ("BACKGROUND", (0,2), (-1,2), HexColor("#f0fdf4")), ("FONTNAME", (0,2), (-1,2), "Helvetica-Oblique"), ("FONTSIZE", (0,2), (-1,2), 6.5), ("BACKGROUND", (0,12), (-1,12), HexColor("#f0fdf4")), ("FONTNAME", (0,12), (-1,12), "Helvetica-Oblique"), ("FONTSIZE", (0,12), (-1,12), 6.5), ("BACKGROUND", (0,19), (-1,19), RED_LT), ("FONTNAME", (0,19), (-1,19), "Helvetica-Oblique"), ("FONTSIZE", (0,19), (-1,19), 6.5), # alternate row tint ("BACKGROUND", (0,4), (-1,4), GREY_LT), ("BACKGROUND", (0,6), (-1,6), GREY_LT), ("BACKGROUND", (0,8), (-1,8), GREY_LT), ("BACKGROUND", (0,10), (-1,10), GREY_LT), ("BACKGROUND", (0,13), (-1,13), GREY_LT), ("BACKGROUND", (0,15), (-1,15), GREY_LT), ("BACKGROUND", (0,17), (-1,17), GREY_LT), ("BACKGROUND", (0,20), (-1,20), GREY_LT), ("BACKGROUND", (0,22), (-1,22), GREY_LT), # NOT recommended - red tint ("TEXTCOLOR", (0,20), (-1,23), RED), ("BACKGROUND", (0,20), (-1,23), RED_LT), ])) # ============================================================ # FOOTER # ============================================================ footer = Table([[ Paragraph( "Evidence grades: [I–V] level of evidence, [A–D] recommendation grade (ASCO convention) | " "Source: ESMO Clinical Practice Guidelines 2011 (Peterson DE et al., Ann Oncol 22:vi78–vi84) | " "For clinical reference only – verify doses before prescribing", note_style ) ]], colWidths=[W]) footer.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), HexColor("#1e293b")), ("ROWPADDING", (0,0), (-1,-1), 5), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("TEXTCOLOR", (0,0), (-1,-1), HexColor("#94a3b8")), ])) # ============================================================ # BUILD # ============================================================ story = [ title_tbl, Spacer(1, 1.5*mm), subtitle_tbl, Spacer(1, 2*mm), grade_tbl, Spacer(1, 2.5*mm), mgmt_tbl, Spacer(1, 2.5*mm), mw_outer_hdr, mw_outer, Spacer(1, 2.5*mm), drug_tbl, Spacer(1, 3*mm), footer, ] doc.build(story) print("PDF generated:", OUT) PYEOF
python3 << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import mm from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT from reportlab.lib.colors import HexColor # ── colour palette ────────────────────────────────────────────────────────── NAVY = HexColor("#1a3a5c") TEAL = HexColor("#0d7377") TEAL_LT = HexColor("#e0f4f4") AMBER_LT = HexColor("#fef3c7") RED = HexColor("#dc2626") RED_LT = HexColor("#fee2e2") GREEN_LT = HexColor("#dcfce7") ORANGE_LT = HexColor("#ffedd5") GREY_LT = HexColor("#f1f5f9") GREY_MED = HexColor("#cbd5e1") PURPLE = HexColor("#7c3aed") AMBER_DK = HexColor("#b45309") WHITE = colors.white BLACK = colors.black SLATE = HexColor("#334155") OUT = "/tmp/workspace/mucositis-card/Mucositis_Pocket_Card.pdf" doc = SimpleDocTemplate(OUT, pagesize=A4, leftMargin=12*mm, rightMargin=12*mm, topMargin=10*mm, bottomMargin=10*mm) W = A4[0] - 24*mm styles = getSampleStyleSheet() def S(base_name, **kw): import random return ParagraphStyle("s"+str(random.random()), parent=styles.get(base_name, styles["Normal"]), **kw) hdr_st = S("Normal", fontSize=7, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER, leading=9) body_st = S("Normal", fontSize=6.8, fontName="Helvetica", textColor=BLACK, leading=8.5) bold_st = S("Normal", fontSize=6.8, fontName="Helvetica-Bold", textColor=BLACK, leading=8.5) sml_st = S("Normal", fontSize=6.2, fontName="Helvetica", textColor=BLACK, leading=7.5) note_st = S("Normal", fontSize=5.8, fontName="Helvetica-Oblique", textColor=HexColor("#94a3b8"), leading=7) def P(t, st=None): return Paragraph(t, st or body_st) def PB(t): return Paragraph(t, bold_st) def PE(): return Paragraph("", body_st) # empty placeholder # ─── TITLE ─────────────────────────────────────────────────────────────────── title_st = S("Normal", fontSize=13, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER, leading=17) sub_st = S("Normal", fontSize=7, fontName="Helvetica-Oblique", textColor=HexColor("#64748b"), alignment=TA_CENTER) title_tbl = Table([[Paragraph( "<font color='white'><b>MUCOSITIS</b></font> " "<font color='#fbbf24'><b>QUICK REFERENCE POCKET CARD</b></font>", title_st) ]], colWidths=[W]) title_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), NAVY), ("TOPPADDING", (0,0),(-1,-1), 8), ("BOTTOMPADDING", (0,0),(-1,-1), 8), ])) sub_tbl = Table([[Paragraph( "ESMO Guidelines 2011 | MASCC/ISOO | For clinical reference only", sub_st) ]], colWidths=[W]) # ─── GRADING ──────────────────────────────────────────────────────────────── gc = [13*mm, 44*mm, 62*mm, W-119*mm] grade_data = [ # row 0: section header [Paragraph("<b>MUCOSITIS GRADING — WHO Oral Toxicity Scale + NCI CTCAE v4.0</b>", hdr_st), PE(), PE(), PE()], # row 1: col headers [PB("Grade"), PB("WHO Description"), PB("NCI CTCAE v4.0 Description"), PB("Immediate Action")], [P("0"), P("No mucositis"), P("None"), P("Routine oral care")], [P("1"), P("Soreness/erythema"), P("Asymptomatic or mild symptoms"), P("Saline/bicarb rinses, soft diet")], [P("2"), P("Erythema + ulcers; can eat"),P("Moderate pain; not interfering with intake"), P("Add Magic Mouthwash, topical analgesia")], [P("3"), P("Ulcers; liquid diet only"), P("Severe pain; interfering with intake"), P("PCA morphine, nutrition support")], [P("4"), P("Alimentation impossible"), P("Life-threatening; urgent intervention needed"), P("Hospitalise, IV opioids, IV fluids")], ] grade_tbl = Table(grade_data, colWidths=gc, repeatRows=2) grade_tbl.setStyle(TableStyle([ ("SPAN", (0,0),(3,0)), ("BACKGROUND", (0,0),(3,0), NAVY), ("BACKGROUND", (0,1),(3,1), SLATE), ("TEXTCOLOR", (0,1),(3,1), WHITE), ("FONTNAME", (0,1),(3,1), "Helvetica-Bold"), ("ALIGN", (0,0),(-1,-1), "LEFT"), ("VALIGN", (0,0),(-1,-1), "MIDDLE"), ("TOPPADDING", (0,0),(-1,-1), 4), ("BOTTOMPADDING", (0,0),(-1,-1), 4), ("LEFTPADDING", (0,0),(-1,-1), 4), ("GRID", (0,1),(-1,-1), 0.4, GREY_MED), # grade cell backgrounds ("BACKGROUND", (0,2),(0,2), GREY_LT), ("BACKGROUND", (0,3),(0,3), GREEN_LT), ("BACKGROUND", (0,4),(0,4), AMBER_LT), ("BACKGROUND", (0,5),(0,5), ORANGE_LT), ("BACKGROUND", (0,6),(0,6), RED_LT), ("FONTNAME", (0,2),(0,-1), "Helvetica-Bold"), ("FONTSIZE", (0,2),(0,-1), 9), ("ALIGN", (0,2),(0,-1), "CENTER"), ])) # ─── STEP-WISE MANAGEMENT ─────────────────────────────────────────────────── mc = [20*mm, W-20*mm] mgmt_data = [ [Paragraph("<b>STEP-WISE MANAGEMENT APPROACH</b>", hdr_st), PE()], [PB("Step"), PB("Actions")], [P("STEP 1\nAssess\n& Grade"), P("Use WHO or NCI CTCAE scale | Check: CBC, hydration, nutritional status, pain score")], [P("STEP 2\nBasic Oral\nCare (ALL)"), P("• Saline / sodium bicarbonate rinse 4–6×/day [III, B]<br/>" "• Soft toothbrush, replace regularly; NO alcohol-based rinses<br/>" "• Screen for malnutrition; start enteral nutrition early if swallowing impaired<br/>" "• Maintain adequate oral hydration")], [P("STEP 3\nGrade 2+\nTopical Rx"), P("• 2% Viscous Lidocaine in saline/bicarb rinse – swish & spit<br/>" "• <b>Magic Mouthwash</b> (classic) – 5 mL, hold 1–2 min, expectorate<br/>" "• Mucosal protectants: Gelclair / Caphosol / Biotene (limited evidence, good safety)<br/>" "• Doxepin mouthrinse for severe mucositis")], [P("STEP 4\nGrade 3–4\nSystemic Rx"), P("• <b>PCA Morphine</b> – treatment of choice for HSCT mucositis pain [I, A]<br/>" "• Regular pain scoring with validated self-report tool<br/>" "• Consider hospitalisation if: severe pain, dehydration, neutropenic fever, or infection")], [P("STEP 5\nNutrition"), P("• Early enteral nutrition (NG tube / gastrostomy) when oral intake is impossible<br/>" "• Nutritional screening at every visit; opioid analgesia to preserve diet intake")], [P("STEP 6\nPrevention"), P("• <b>H&N RT:</b> Benzydamine rinse [I, A] | 3D conformal/VMAT planning [II, B]<br/>" "• <b>Bolus 5-FU / edatrexate:</b> Oral cryotherapy (ice chips) [II, A]<br/>" "• <b>HSCT + TBI:</b> Palifermin 60 µg/kg/day IV ×3 pre + ×3 post-transplant [I, A]<br/>" "• <b>High-dose melphalan:</b> Oral cryotherapy [II, A]<br/>" "• <b>HSCT centres:</b> Low-level laser therapy (LLLT) where available [II, B]")], [P("STEP 7\nGI Mucositis"), P("• First-line diarrhoea: Loperamide (standard dose)<br/>" "• Loperamide failure: <b>Octreotide ≥100 µg SC BD</b> [II, A]<br/>" "• Pelvic RT prevention: <b>Sulfasalazine 500 mg BD</b> [II, B]<br/>" "• Radiation proctitis + bleeding: <b>Sucralfate enemas</b> [III, B]<br/>" "• IV amifostine for chemoRT esophagitis (NSCLC) [III, C]")], ] mgmt_tbl = Table(mgmt_data, colWidths=mc, repeatRows=2) mgmt_tbl.setStyle(TableStyle([ ("SPAN", (0,0),(1,0)), ("BACKGROUND", (0,0),(1,0), TEAL), ("BACKGROUND", (0,1),(1,1), HexColor("#0f766e")), ("TEXTCOLOR", (0,1),(1,1), WHITE), ("FONTNAME", (0,1),(1,1), "Helvetica-Bold"), ("ALIGN", (0,0),(-1,-1), "LEFT"), ("VALIGN", (0,0),(-1,-1), "TOP"), ("TOPPADDING", (0,0),(-1,-1), 4), ("BOTTOMPADDING", (0,0),(-1,-1), 4), ("LEFTPADDING", (0,0),(-1,-1), 4), ("GRID", (0,1),(-1,-1), 0.4, GREY_MED), ("BACKGROUND", (0,2),(0,-1), TEAL_LT), ("FONTNAME", (0,2),(0,-1), "Helvetica-Bold"), ("FONTSIZE", (0,2),(0,-1), 6.2), ("ALIGN", (0,2),(0,-1), "CENTER"), ("VALIGN", (0,2),(0,-1), "MIDDLE"), # alternate rows ("BACKGROUND", (1,3),(1,3), GREY_LT), ("BACKGROUND", (1,5),(1,5), GREY_LT), ("BACKGROUND", (1,7),(1,7), GREY_LT), ("BACKGROUND", (1,9),(1,9), GREY_LT), ])) # ─── MAGIC MOUTHWASH BOXES ────────────────────────────────────────────────── hw = (W - 3*mm) / 2 mw_hdr_tbl = Table( [[Paragraph("<b>MAGIC MOUTHWASH COMPOSITIONS</b>", hdr_st)]], colWidths=[W]) mw_hdr_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), NAVY), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1),5), ])) def mw_box(rows, bg_hdr): t = Table([[P(r, sml_st)] for r in rows], colWidths=[hw]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), bg_hdr), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING", (0,0),(-1,-1), 3), ("LEFTPADDING", (0,0),(-1,-1), 4), ("GRID", (0,0),(-1,-1), 0.4, GREY_MED), ("BACKGROUND", (0,1),(-1,1), HexColor("#f8fafc")), ("FONTNAME", (0,1),(-1,1), "Helvetica-Bold"), ("FONTSIZE", (0,1),(-1,1), 6.5), ])) return t classic_rows = [ "<font color='white'><b>CLASSIC MAGIC MOUTHWASH</b></font>", "<b>Components (1 : 1 : 1 equal parts)</b>", "1. 2% Viscous Lidocaine", "2. Diphenhydramine elixir 12.5 mg/5 mL", "3. Maalox® (Mg + Al hydroxide suspension)", "<b>Dose:</b> 5 mL per use | Lidocaine/dose: <50 mg", "<b>Method:</b> Swish & hold 1–2 min → EXPECTORATE (do NOT swallow)", "<b>Frequency:</b> Every 4–6 h as needed for pain", "<b>Use:</b> Grade 2–3 oral mucositis; emergency pain relief", "<font color='#dc2626'><b>⚠ Do NOT swallow</b></font> – systemic toxicity risk (esp. children)", ] modified_rows = [ "<font color='white'><b>MODIFIED MAGIC MOUTHWASH</b></font>", "<b>Components (pharmacy-compounded)</b>", "1. Tetracycline (antibacterial)", "2. Diphenhydramine (antihistamine / mild anaesthetic)", "3. Nystatin (antifungal)", "4. Hydrocortisone (anti-inflammatory)", "<b>Dose:</b> 10 mL (2 teaspoons)", "<b>Method:</b> Swish + gargle → SWALLOW", "<b>Frequency:</b> 3 times daily", "<b>Use:</b> Radiation stomatitis & pharyngitis; covers bacterial + fungal infection", ] classic_tbl = mw_box(classic_rows, NAVY) modified_tbl = mw_box(modified_rows, PURPLE) mw_side_by_side = Table([[classic_tbl, modified_tbl]], colWidths=[hw, hw]) mw_side_by_side.setStyle(TableStyle([ ("VALIGN", (0,0),(-1,-1), "TOP"), ("LEFTPADDING", (0,0),(-1,-1), 0), ("RIGHTPADDING", (0,0),(-1,-1), 0), ("TOPPADDING", (0,0),(-1,-1), 0), ("BOTTOMPADDING", (0,0),(-1,-1), 0), ("INNERGRID", (0,0),(-1,-1), 3, WHITE), ])) # ─── DRUG DOSING TABLE ────────────────────────────────────────────────────── dc = [42*mm, 35*mm, W-77*mm] drug_data = [ [Paragraph("<b>DRUG DOSING QUICK REFERENCE</b>", hdr_st), PE(), PE()], [PB("Drug / Agent"), PB("Dose & Route"), PB("Indication [Evidence Grade]")], # TOPICAL header [P("<b>── TOPICAL ──</b>", sml_st), PE(), PE()], [P("2% Viscous Lidocaine"), P("5 mL swish & spit\nMax total 250–300 mg"), P("Oral mucositis analgesia, Grade 2+")], [P("Magic Mouthwash (classic)"), P("5 mL q4–6h, expectorate"), P("Pain relief; <50 mg lidocaine/dose")], [P("Modified Magic Mouthwash"), P("10 mL (2 tsp) TID, swallow"), P("Radiation stomatitis/pharyngitis (compounded)")], [P("Benzydamine oral rinse"), P("Per product label"), P("Prevention – moderate-dose H&N RT [I, A]")], [P("Dexamethasone elixir"), P("0.5 mg/5 mL; 5 mL BID–TID\nSwish & spit, hold 5 min"), P("mTOR inhibitor-induced mucositis")], [P("Nystatin suspension"), P("400,000–600,000 U\nSwish & swallow QID"), P("Secondary oral candidiasis")], [P("Clotrimazole troche"), P("10 mg QID"), P("Secondary oral candidiasis")], [P("Chlorhexidine 0.12%"), P("5 mL swish & spit BID"), P("Secondary infection support (NOT prevention [II, B])") ], [P("Clobetasol 0.05% gel"), P("Apply BID–TID"), P("Topical anti-inflammatory, erosions/ulcers")], [P("Triamcinolone 0.1% paste"), P("Apply BID–TID"), P("Topical anti-inflammatory, oral ulcers")], # SYSTEMIC header [P("<b>── SYSTEMIC ──</b>", sml_st), PE(), PE()], [P("Morphine (PCA)"), P("Patient-controlled dosing"), P("Severe mucositis pain, HSCT [I, A]")], [P("Palifermin (KGF-1)"), P("60 µg/kg/day IV\n×3 pre + ×3 post-HSCT"), P("Prevention – HSCT + TBI, haematologic malignancy [I, A]")], [P("Octreotide"), P("≥100 µg SC BD"), P("Loperamide-refractory chemo-diarrhoea [II, A]")], [P("Sulfasalazine"), P("500 mg orally BD"), P("Prevention – radiation enteropathy, pelvic EBRT [II, B]")], [P("Ranitidine / Omeprazole"), P("Standard oral doses"), P("Epigastric pain prevention – 5-FU/CMF regimens [II, A]")], [P("Amifostine IV"), P("Standard IV infusion"), P("Esophagitis – concurrent chemoRT, NSCLC [III, C]")], [P("Amifostine intrarectal"), P("≥340 mg/m² IR"), P("Radiation proctitis prevention, rectal cancer RT [III, B]")], # NOT RECOMMENDED header [P("<b>── NOT RECOMMENDED ──</b>", sml_st), PE(), PE()], [P("Chlorhexidine prophylaxis"),P("—"), P("H&N RT prevention: NOT recommended [II, B]")], [P("Oral sucralfate"), P("—"), P("RT oral mucositis: NOT recommended (↑GI SEs) [II, A]")], [P("5-ASA / Mesalazine"), P("—"), P("GI mucositis prevention: NOT recommended [I, A]")], [P("Systemic glutamine"), P("—"), P("GI mucositis prevention: NOT recommended [II, C]")], ] drug_tbl = Table(drug_data, colWidths=dc, repeatRows=2) drug_tbl.setStyle(TableStyle([ ("SPAN", (0,0),(2,0)), ("BACKGROUND", (0,0),(2,0), AMBER_DK), ("BACKGROUND", (0,1),(2,1), HexColor("#92400e")), ("TEXTCOLOR", (0,1),(2,1), WHITE), ("FONTNAME", (0,1),(2,1), "Helvetica-Bold"), ("ALIGN", (0,0),(-1,-1), "LEFT"), ("VALIGN", (0,0),(-1,-1), "TOP"), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING", (0,0),(-1,-1), 3), ("LEFTPADDING", (0,0),(-1,-1), 4), ("GRID", (0,1),(-1,-1), 0.4, GREY_MED), # section separator rows ("SPAN", (0,2),(2,2)), ("BACKGROUND", (0,2),(2,2), GREEN_LT), ("FONTNAME", (0,2),(2,2), "Helvetica-BoldOblique"), ("SPAN", (0,12),(2,12)), ("BACKGROUND", (0,12),(2,12), TEAL_LT), ("FONTNAME", (0,12),(2,12), "Helvetica-BoldOblique"), ("SPAN", (0,19),(2,19)), ("BACKGROUND", (0,19),(2,19), RED_LT), ("FONTNAME", (0,19),(2,19), "Helvetica-BoldOblique"), # NOT recommended rows – red text ("TEXTCOLOR", (0,20),(-1,23), RED), ("BACKGROUND", (0,20),(-1,23), RED_LT), # alternate row tint (non-separator rows) ("BACKGROUND", (0,4),(-1,4), GREY_LT), ("BACKGROUND", (0,6),(-1,6), GREY_LT), ("BACKGROUND", (0,8),(-1,8), GREY_LT), ("BACKGROUND", (0,10),(-1,10), GREY_LT), ("BACKGROUND", (0,13),(-1,13), GREY_LT), ("BACKGROUND", (0,15),(-1,15), GREY_LT), ("BACKGROUND", (0,17),(-1,17), GREY_LT), ])) # ─── FOOTER ────────────────────────────────────────────────────────────────── footer_tbl = Table([[Paragraph( "Evidence: [I–V] level of evidence, [A–D] recommendation grade (ASCO convention) | " "Source: ESMO Clinical Practice Guidelines 2011 – Peterson DE et al., Ann Oncol 22:vi78–vi84 | " "For clinical reference only. Always verify doses before prescribing.", note_st)]], colWidths=[W]) footer_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), HexColor("#1e293b")), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 6), ])) # ─── ASSEMBLE ──────────────────────────────────────────────────────────────── story = [ title_tbl, Spacer(1, 1.5*mm), sub_tbl, Spacer(1, 2*mm), grade_tbl, Spacer(1, 2.5*mm), mgmt_tbl, Spacer(1, 2.5*mm), mw_hdr_tbl, mw_side_by_side, Spacer(1, 2.5*mm), drug_tbl, Spacer(1, 3*mm), footer_tbl, ] doc.build(story) print("SUCCESS:", OUT) PYEOF
Generate