Create me pdf of disaster management based on tintinalli , include out hospital management field triage, in hospital triage and management in tertiary centre referral criteria, include a 10 marks short on on Triage too Based on tintinalli book of emergency medicine

Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Running Command

mkdir -p /tmp/workspace/disaster-management && ls /tmp/workspace/

Writing File

~/disaster-management/generate_pdf.py


from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib.colors import HexColor, black, white, Color
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY, TA_RIGHT
from reportlab.pdfgen import canvas as pdfcanvas

OUTPUT = "/tmp/workspace/disaster-management/Disaster_Management_Tintinalli.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
NAVY    = HexColor("#1B3A5C")
TEAL    = HexColor("#1A7A7A")
RED_BOX = HexColor("#C0392B")
AMBER   = HexColor("#D4830A")
GREEN_  = HexColor("#1A7A3A")
LIGHT_BG= HexColor("#EAF4FB")
AMBER_BG= HexColor("#FFF8E7")
RED_BG  = HexColor("#FDECEA")
GREEN_BG= HexColor("#E8F8EC")
GREY    = HexColor("#F5F5F5")
DARK_TEXT=HexColor("#1A1A2E")

def build_styles():
    styles = getSampleStyleSheet()

    styles.add(ParagraphStyle(name='DocTitle',
        fontName='Helvetica-Bold', fontSize=22, textColor=white,
        alignment=TA_CENTER, spaceAfter=4))
    styles.add(ParagraphStyle(name='DocSubtitle',
        fontName='Helvetica', fontSize=12, textColor=HexColor("#BFD7EE"),
        alignment=TA_CENTER, spaceAfter=2))
    styles.add(ParagraphStyle(name='DocRef',
        fontName='Helvetica-Oblique', fontSize=9, textColor=HexColor("#90C4E4"),
        alignment=TA_CENTER, spaceAfter=2))

    styles.add(ParagraphStyle(name='H1',
        fontName='Helvetica-Bold', fontSize=15, textColor=white,
        spaceBefore=14, spaceAfter=6, leading=20))
    styles.add(ParagraphStyle(name='H2',
        fontName='Helvetica-Bold', fontSize=12, textColor=NAVY,
        spaceBefore=10, spaceAfter=4, leading=16))
    styles.add(ParagraphStyle(name='H3',
        fontName='Helvetica-Bold', fontSize=10.5, textColor=TEAL,
        spaceBefore=7, spaceAfter=3, leading=14))

    styles.add(ParagraphStyle(name='Body',
        fontName='Helvetica', fontSize=9.5, textColor=DARK_TEXT,
        spaceBefore=3, spaceAfter=3, leading=14, alignment=TA_JUSTIFY))
    styles.add(ParagraphStyle(name='Bullet',
        fontName='Helvetica', fontSize=9.5, textColor=DARK_TEXT,
        spaceBefore=2, spaceAfter=2, leading=13,
        leftIndent=14, firstLineIndent=-10))
    styles.add(ParagraphStyle(name='SmallBody',
        fontName='Helvetica', fontSize=8.5, textColor=DARK_TEXT,
        spaceBefore=2, spaceAfter=2, leading=12, alignment=TA_JUSTIFY))
    styles.add(ParagraphStyle(name='TableCell',
        fontName='Helvetica', fontSize=8.5, textColor=DARK_TEXT,
        spaceBefore=1, spaceAfter=1, leading=11))
    styles.add(ParagraphStyle(name='TableHdr',
        fontName='Helvetica-Bold', fontSize=8.5, textColor=white,
        spaceBefore=1, spaceAfter=1, leading=11, alignment=TA_CENTER))
    styles.add(ParagraphStyle(name='BoxText',
        fontName='Helvetica', fontSize=9, textColor=DARK_TEXT,
        spaceBefore=2, spaceAfter=2, leading=12, leftIndent=6))
    styles.add(ParagraphStyle(name='BoxTitle',
        fontName='Helvetica-Bold', fontSize=10, textColor=NAVY,
        spaceBefore=2, spaceAfter=3, leading=13))
    styles.add(ParagraphStyle(name='QTitle',
        fontName='Helvetica-Bold', fontSize=11, textColor=NAVY,
        spaceBefore=6, spaceAfter=4, leading=14))
    styles.add(ParagraphStyle(name='MarkScheme',
        fontName='Helvetica', fontSize=9, textColor=DARK_TEXT,
        spaceBefore=2, spaceAfter=2, leading=12, leftIndent=12))
    return styles

S = build_styles()

def section_header(title, color=NAVY):
    """Returns a coloured section header block."""
    data = [[Paragraph(title, S['H1'])]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), color),
        ('TOPPADDING',  (0,0), (-1,-1), 8),
        ('BOTTOMPADDING',(0,0),(-1,-1), 8),
        ('LEFTPADDING', (0,0), (-1,-1), 12),
        ('RIGHTPADDING',(0,0), (-1,-1), 8),
        ('ROUNDEDCORNERS', [4]),
    ]))
    return t

def color_box(title, items, bg=LIGHT_BG, border=TEAL, title_color=TEAL):
    """Coloured info box with bullet items."""
    elems = []
    if title:
        elems.append(Paragraph(title, S['BoxTitle'] if title_color == TEAL else
            ParagraphStyle('bt2', fontName='Helvetica-Bold', fontSize=10,
                           textColor=title_color, spaceBefore=2, spaceAfter=3)))
    for item in items:
        elems.append(Paragraph(f"\u2022  {item}", S['BoxText']))
    inner = Table([[e] for e in elems], colWidths=[15.6*cm])
    inner.setStyle(TableStyle([
        ('BACKGROUND', (0,0),(-1,-1), bg),
        ('BOX', (0,0),(-1,-1), 1, border),
        ('TOPPADDING',(0,0),(-1,-1),2),
        ('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),8),
        ('RIGHTPADDING',(0,0),(-1,-1),6),
    ]))
    return inner

def two_col_table(headers, rows, col_w=None):
    if col_w is None:
        col_w = [5*cm, 12*cm]
    data = [[Paragraph(h, S['TableHdr']) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(c), S['TableCell']) for c in row])
    t = Table(data, colWidths=col_w, repeatRows=1)
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0),(-1,0), NAVY),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white, GREY]),
        ('GRID',(0,0),(-1,-1),0.4,HexColor("#BBBBBB")),
        ('TOPPADDING',(0,0),(-1,-1),4),
        ('BOTTOMPADDING',(0,0),(-1,-1),4),
        ('LEFTPADDING',(0,0),(-1,-1),5),
        ('RIGHTPADDING',(0,0),(-1,-1),5),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    return t

def triage_color_table():
    """4-colour triage categories table"""
    colors_map = {
        'RED'   : (HexColor("#C0392B"), white, 'IMMEDIATE (Priority I)',
                   'Life-threatening but survivable injuries.\nAirway compromise, severe hemorrhage, tension pneumothorax, major burns 20-60% BSA.\nNeeds care within minutes.'),
        'YELLOW': (HexColor("#D4830A"), white, 'DELAYED (Priority II)',
                   'Serious injuries but can wait 45–60 min.\nFractures, moderate burns, abdominal injuries without shock.\nSystemic decline possible but not imminent.'),
        'GREEN' : (HexColor("#1A7A3A"), white, 'MINIMAL (Priority III)',
                   '"Walking wounded." Minor lacerations, contusions, minor fractures.\nAmbulatory patients who can wait several hours.\nSelf-care or minimal aid needed.'),
        'BLACK' : (HexColor("#1A1A1A"), white, 'EXPECTANT / DEAD (Priority 0)',
                   'Dead, or unsurvivable injuries despite optimal care.\nIncludes: unresponsive + apneic, burns >95% BSA, cardiac arrest.\nGoal: comfort measures only.'),
    }
    rows = []
    for tag, (bg, fg, priority, desc) in colors_map.items():
        tag_cell = Table([[Paragraph(tag, ParagraphStyle('tg',
            fontName='Helvetica-Bold', fontSize=13, textColor=fg,
            alignment=TA_CENTER))]],
            colWidths=[2.2*cm])
        tag_cell.setStyle(TableStyle([
            ('BACKGROUND',(0,0),(-1,-1), bg),
            ('TOPPADDING',(0,0),(-1,-1),10),('BOTTOMPADDING',(0,0),(-1,-1),10),
        ]))
        pri_para = Paragraph(f"<b>{priority}</b>", S['TableCell'])
        desc_para = Paragraph(desc.replace('\n','<br/>'), S['SmallBody'])
        rows.append([tag_cell, pri_para, desc_para])
    t = Table(rows, colWidths=[2.2*cm, 4.5*cm, 10.3*cm])
    t.setStyle(TableStyle([
        ('GRID',(0,0),(-1,-1),0.4,HexColor("#CCCCCC")),
        ('ROWBACKGROUNDS',(0,0),(-1,-1),[GREY, white, GREY, white]),
        ('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
        ('LEFTPADDING',(1,0),(-1,-1),6),
        ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
    ]))
    return t

# ── Custom Canvas (header + footer) ─────────────────────────────────────────
class HeaderFooterCanvas(pdfcanvas.Canvas):
    def __init__(self, *args, **kwargs):
        pdfcanvas.Canvas.__init__(self, *args, **kwargs)
        self._saved_page_states = []

    def showPage(self):
        self._saved_page_states.append(dict(self.__dict__))
        self._startPage()

    def save(self):
        num_pages = len(self._saved_page_states)
        for state in self._saved_page_states:
            self.__dict__.update(state)
            self.draw_header_footer(num_pages)
            pdfcanvas.Canvas.showPage(self)
        pdfcanvas.Canvas.save(self)

    def draw_header_footer(self, page_count):
        self.saveState()
        w, h = A4
        page_num = self._saved_page_states.index(dict(self.__dict__)) + 1 \
                   if dict(self.__dict__) in self._saved_page_states else 1

        # Header (skip page 1 – cover)
        if page_num > 1:
            self.setFillColor(NAVY)
            self.rect(0, h - 1.1*cm, w, 1.1*cm, fill=1, stroke=0)
            self.setFont('Helvetica-Bold', 8)
            self.setFillColor(white)
            self.drawString(1.5*cm, h - 0.72*cm, "DISASTER MANAGEMENT")
            self.setFont('Helvetica', 8)
            self.drawRightString(w - 1.5*cm, h - 0.72*cm,
                                 "Based on Tintinalli's Emergency Medicine")

        # Footer
        self.setFillColor(NAVY)
        self.rect(0, 0, w, 0.85*cm, fill=1, stroke=0)
        self.setFont('Helvetica', 7.5)
        self.setFillColor(white)
        self.drawString(1.5*cm, 0.3*cm, "Tintinalli's Emergency Medicine – A Comprehensive Study Guide, 9th Ed.")
        self.drawRightString(w - 1.5*cm, 0.3*cm, f"Page {page_num} of {page_count}")
        self.restoreState()

def build_pdf():
    doc = SimpleDocTemplate(
        OUTPUT, pagesize=A4,
        topMargin=1.6*cm, bottomMargin=1.4*cm,
        leftMargin=2*cm, rightMargin=2*cm,
        title="Disaster Management – Tintinalli",
        author="Tintinalli's Emergency Medicine"
    )

    story = []
    W = 17*cm   # usable width

    # ════════════════════════════════════════════════════════════════
    # COVER PAGE
    # ════════════════════════════════════════════════════════════════
    cover_bg = Table(
        [[Paragraph("", S['Body'])]],
        colWidths=[W], rowHeights=[2.5*cm]
    )
    cover_bg.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1), NAVY)]))
    story.append(cover_bg)
    story.append(Spacer(1, 0.5*cm))

    cover_data = [[
        Paragraph("DISASTER MANAGEMENT", S['DocTitle']),
        Paragraph("", S['DocTitle'])
    ]]
    cover_title = Table(
        [[Paragraph("DISASTER MANAGEMENT", ParagraphStyle('CT',
            fontName='Helvetica-Bold', fontSize=26, textColor=white,
            alignment=TA_CENTER, spaceAfter=6))]],
        colWidths=[W]
    )
    cover_title.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1), NAVY),
        ('TOPPADDING',(0,0),(-1,-1),18),
        ('BOTTOMPADDING',(0,0),(-1,-1),6),
    ]))
    story.append(cover_title)

    sub_table = Table(
        [[Paragraph("Field Triage · In-Hospital Triage · Tertiary Centre Management · Referral Criteria",
                    ParagraphStyle('sub', fontName='Helvetica', fontSize=12,
                                   textColor=HexColor("#BFD7EE"), alignment=TA_CENTER))],
         [Paragraph("Based on Tintinalli's Emergency Medicine – A Comprehensive Study Guide, 9th Edition",
                    ParagraphStyle('ref', fontName='Helvetica-Oblique', fontSize=9.5,
                                   textColor=HexColor("#90C4E4"), alignment=TA_CENTER,
                                   spaceBefore=4))]],
        colWidths=[W]
    )
    sub_table.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1), NAVY),
        ('TOPPADDING',(0,0),(-1,-1),4),
        ('BOTTOMPADDING',(0,0),(-1,-1),16),
    ]))
    story.append(sub_table)
    story.append(Spacer(1, 0.6*cm))

    # Cover TOC box
    toc_items = [
        "1.  Disaster: Definition, Types, and Characteristics",
        "2.  Disaster Preparedness and Planning",
        "3.  Out-of-Hospital (Field) Management",
        "4.  Field Triage – START Algorithm",
        "5.  In-Hospital Triage – Color-Coded Categories",
        "6.  In-Hospital Management and Treatment Areas",
        "7.  Management in Tertiary Centre",
        "8.  Referral Criteria",
        "9.  Short Answer Question – Triage (10 Marks)",
    ]
    story.append(color_box("CONTENTS", toc_items, bg=LIGHT_BG, border=TEAL))
    story.append(PageBreak())

    # ════════════════════════════════════════════════════════════════
    # SECTION 1 – DEFINITION, TYPES, CHARACTERISTICS
    # ════════════════════════════════════════════════════════════════
    story.append(section_header("1.  DISASTER: DEFINITION, TYPES & CHARACTERISTICS"))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph("Definition", S['H2']))
    story.append(Paragraph(
        "The <b>World Health Organization</b> defines a disaster as a sudden ecologic phenomenon of "
        "sufficient magnitude to require external assistance. A disaster is an event that <b>overwhelms "
        "the resources of the region</b> or location in which it occurs. A hospital disaster may be "
        "defined as any event that overwhelms the resources of the receiving hospital — this is not "
        "limited to mass casualty incidents. Even a single patient (e.g., organophosphate poisoning, "
        "suspected smallpox, a celebrity patient) can constitute a hospital disaster.",
        S['Body']))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("Types of Disasters", S['H2']))
    story.append(two_col_table(
        ["Type", "Definition / Examples"],
        [
            ["Natural", "Earthquakes, tsunamis, tornadoes, hurricanes, volcanic eruptions, pandemic influenza"],
            ["Technological / Industrial", "Chemical plant explosions, radiation releases, transportation accidents, infrastructure failure"],
            ["Intentional (Man-made)", "Terrorism (CBRN), active shooter, war, civil unrest, bioterrorism"],
            ["External", "Event physically separate from hospital (e.g., transport accident, industrial accident)"],
            ["Internal", "Event within hospital confines (e.g., bomb scare, radiation lab accident, power failure)"],
            ["Combination", "Event causing mass casualties AND hospital structural damage (e.g., earthquake)"],
        ],
        col_w=[3.5*cm, 13.5*cm]
    ))
    story.append(Spacer(1, 0.3*cm))

    story.append(Paragraph("Disaster Characteristics", S['H2']))
    story.append(Paragraph(
        "Regardless of cause, most acute disasters share common features important for preparedness:",
        S['Body']))
    char_items = [
        "Large numbers of <b>minimally injured patients</b> arrive at the nearest hospital first — usually <b>without prehospital triage</b>.",
        "~<b>80%</b> of patients <b>self-transport</b> (car, van, foot, cab) rather than via EMS — early surge is unpredictable.",
        "Initial patients can be expected within <b>minutes</b>; peak volumes at <b>2–3 hours</b> post-event.",
        "ED volumes remain elevated for <b>days to weeks</b> even after the acute phase.",
        "Non-acute disasters (e.g., pandemics) have <b>slower onset</b> but <b>prolonged</b> elevated volumes.",
        "Hospital overcrowding significantly limits <b>surge capacity</b>.",
        "Prehospital transport of the most severely injured follows the initial wave of self-presenting patients.",
    ]
    for item in char_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))
    story.append(Spacer(1, 0.3*cm))

    # ════════════════════════════════════════════════════════════════
    # SECTION 2 – PREPAREDNESS
    # ════════════════════════════════════════════════════════════════
    story.append(section_header("2.  DISASTER PREPAREDNESS AND PLANNING", color=TEAL))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph(
        "A <b>hospital disaster planning group</b> (comprising diverse hospital staff and decision-makers) "
        "generates the Hospital Emergency Operations Plan (HEOP). Components include:",
        S['Body']))
    prep_items = [
        "<b>Hazard Vulnerability Analysis (HVA)</b> – identify community-specific risks (geography, proximity to chemical sites, transportation hubs, terrorist targets).",
        "<b>Hospital–Community Coordination</b> – liaison with EMS, fire service, public health, police, Red Cross, and emergency management agencies.",
        "<b>Integration with National Response Assets</b> – FEMA, NDMS, CDC, Metropolitan Medical Response System.",
        "<b>Training and Disaster Exercises</b> – regular drills with after-action reports to correct deficiencies.",
        "<b>Specific Plans</b> – mass casualties, decontamination, radiation, bioterrorism, CBRN, active shooter.",
    ]
    for item in prep_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph(
        "The HEOP must address: staff call-in trees, patient discharge/transfer protocols, decontamination "
        "procedures, security, family/media/volunteer centres, supply logistics, blood banking (up to 50 units "
        "and mobilisable donors), mental health resources, morgue expansion, and post-event critical incident "
        "stress debriefing.", S['Body']))
    story.append(Spacer(1, 0.3*cm))

    # ════════════════════════════════════════════════════════════════
    # SECTION 3 – OUT-OF-HOSPITAL / FIELD MANAGEMENT
    # ════════════════════════════════════════════════════════════════
    story.append(PageBreak())
    story.append(section_header("3.  OUT-OF-HOSPITAL (FIELD) MANAGEMENT", color=RED_BOX))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph(
        "Field disaster response comprises: field triage and medical care, communications, "
        "casualty distribution, and management of on-site disaster medical teams.",
        S['Body']))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("Key Principles of Field Medical Care", S['H2']))
    field_items = [
        "If patient numbers are <b>small</b> and resources sufficient: on-site stabilisation and rapid transport to nearby hospitals.",
        "If <b>extrication is prolonged</b>: institute fluid resuscitation and pain control in the field.",
        "If there is <b>ongoing danger</b> (fire, explosives, hazmat, falling structures): practise <b>early rapid transport with minimum treatment</b>.",
        "Establish <b>Incident Command System (ICS)</b>: incident commander, medical branch director, triage officer, treatment officer, transportation officer.",
        "Establish a <b>casualty collection point (CCP)</b> — a designated, protected area where patients are consolidated for triage.",
        "Establish <b>treatment sectors</b>: Immediate (Red), Delayed (Yellow), Minimal (Green), Expectant/Dead (Black).",
        "Initiate <b>casualty distribution</b>: spread patients across regional hospitals to avoid overwhelming any single centre.",
        "Communicate hospital capacity/status via regional emergency communications centre.",
        "Field medical teams should carry <b>disaster triage kits</b> with essential resuscitation and stabilisation equipment.",
        "At least one institution per region should maintain an <b>on-site triage team</b> of physicians and nurses.",
    ]
    for item in field_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    story.append(Spacer(1, 0.3*cm))
    story.append(Paragraph("Field Decontamination (CBRN Events)", S['H2']))
    decon_items = [
        "Perform decontamination <b>external to the ED / clinical care area</b>.",
        "<b>Disrobe</b> patients — remove clothing, jewellery, contact lenses; bag and label belongings.",
        "<b>Warm water</b> is the universal decontamination fluid: head-to-toe wash/shower for ≥5 minutes.",
        "Level C PPE minimum for hospital decontamination personnel; rotate every 30 min.",
        "<b>Contain runoff water</b> to prevent environmental contamination.",
        "For radiological events: radiation survey (Geiger–Müller counter) before and after decontamination.",
        "Re-triage after decontamination — especially patients with eye pain (irrigate with normal saline).",
        "Call <b>Poison Center (1-800-222-1222)</b> for chemical agent guidance; CDC for biological agents.",
    ]
    for item in decon_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    # ════════════════════════════════════════════════════════════════
    # SECTION 4 – FIELD TRIAGE / START
    # ════════════════════════════════════════════════════════════════
    story.append(Spacer(1, 0.3*cm))
    story.append(section_header("4.  FIELD TRIAGE – START AND SALT ALGORITHMS", color=AMBER))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph(
        "In the field, rescue personnel use a <b>Simple Triage and Rapid Treatment (START)</b> technique "
        "based on rapid assessment of respiratory status, perfusion, haemorrhage control, and mental "
        "status. The newer <b>SALT algorithm</b> (Sort, Assess, Lifesaving interventions, Treat/Transport) "
        "is evidence-supported and best balances sensitivity and specificity.",
        S['Body']))

    story.append(Spacer(1, 0.2*cm))
    story.append(Paragraph("START Algorithm – 30-Second Assessment Per Patient", S['H2']))

    start_rows = [
        ["Step", "Assessment", "Action / Outcome"],
        ["1. RESPIRATIONS",
         "Is the patient breathing?",
         "NOT breathing → open airway → still not breathing → BLACK (Expectant)\n"
         "Breathing >30/min or <30/min → proceed to step 2"],
        ["2. PERFUSION",
         "Radial pulse present?\nOR capillary refill <2 sec?",
         "No pulse / cap refill >2 sec → control bleeding → RED (Immediate)\n"
         "Pulse present → proceed to step 3"],
        ["3. MENTAL STATUS",
         "Can patient follow simple commands?",
         "Cannot obey commands → RED (Immediate)\n"
         "Can obey commands → YELLOW (Delayed)"],
        ["4. WALK",
         "Can the patient walk?",
         "Walking wounded → GREEN (Minimal)\n(Assessed last in global sort)"],
    ]
    t = Table([[Paragraph(c if i==0 else c, S['TableHdr'] if i==0 else S['TableCell'])
                for c in row]
               for i, row in enumerate(start_rows)],
              colWidths=[3.5*cm, 5*cm, 8.5*cm], repeatRows=1)
    t.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0), AMBER),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white, AMBER_BG]),
        ('GRID',(0,0),(-1,-1),0.4,HexColor("#CCCCCC")),
        ('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    story.append(t)

    story.append(Spacer(1, 0.3*cm))
    story.append(Paragraph("SALT Algorithm", S['H2']))
    story.append(Paragraph(
        "SALT = <b>S</b>ort, <b>A</b>ssess, <b>L</b>ifesaving interventions, <b>T</b>reat/Transport", S['Body']))
    salt_items = [
        "<b>Step 1 – Global Sort (Three Tiers):</b> Direct casualties to walk to designated area (lowest priority); ask remaining to wave / purposeful movement (next priority); motionless / obvious life-threat assessed first.",
        "<b>Step 2 – Individual Assessment and Lifesaving Interventions (LSI):</b> LSI must be quick, greatly improve survival, not require provider to stay, within scope, and use available equipment. LSI includes: massive haemorrhage control, airway opening.",
        "<b>Step 3 – Prioritisation:</b> After LSI, assign category — Immediate, Delayed, Minimal, or Expectant (DIME). Triage is dynamic and ongoing through each level of care.",
        "<b>Triage Officer</b> required: provider with triage-specific training improves accuracy. Dedicated command-and-control structure and single triage point essential.",
    ]
    for item in salt_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    story.append(Spacer(1, 0.2*cm))
    story.append(Paragraph("Mass Casualty Triage Algorithm (Tintinalli Table 302-5)", S['H3']))
    mcal_rows = [
        ["AIRWAY", "Moving air?",
         "Yes → assess breathing\nNo → open airway; moving air? Yes → assess breathing; No → EXPECTANT"],
        ["BREATHING", "Breathing?",
         "Yes → assess bleeding\nNo (after airway open) → EXPECTANT"],
        ["BLEEDING", "Life-threatening haemorrhage?",
         "Yes → control → assess perfusion\nNo → assess perfusion"],
        ["PERFUSION", "Peripheral pulse present?",
         "No pulse → IMMEDIATE\nPulse present → assess mental status"],
        ["MENTAL STATUS", "Obeys commands?",
         "No → IMMEDIATE\nYes → DELAYED\nMinor injuries only → MINIMAL"],
    ]
    mt = Table(
        [[Paragraph(c, S['TableHdr'] if i==0 else S['TableCell']) for c in row]
         for i, row in enumerate([["Parameter","Assessment","Outcome"]] + mcal_rows)],
        colWidths=[3*cm, 4.5*cm, 9.5*cm], repeatRows=1
    )
    mt.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0), NAVY),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white, GREY]),
        ('GRID',(0,0),(-1,-1),0.4,HexColor("#BBBBBB")),
        ('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    story.append(mt)

    # ════════════════════════════════════════════════════════════════
    # SECTION 5 – IN-HOSPITAL TRIAGE
    # ════════════════════════════════════════════════════════════════
    story.append(PageBreak())
    story.append(section_header("5.  IN-HOSPITAL TRIAGE – COLOUR-CODED SYSTEM", color=RED_BOX))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph(
        "Triage must be performed at the ED entrance even if already done in the field, because patient "
        "status may have changed. All patients — including those self-presenting — must be assessed. "
        "The goal is to <b>do the most good for the most patients</b>. Triage at the hospital level should "
        "be limited to manually opening airways and controlling external haemorrhage.",
        S['Body']))
    story.append(Spacer(1, 0.2*cm))
    story.append(Paragraph("Triage Categories (Tintinalli Table 5-8)", S['H2']))
    story.append(triage_color_table())

    story.append(Spacer(1, 0.3*cm))
    story.append(Paragraph("Triage Team Composition", S['H2']))
    story.append(Paragraph(
        "A triage team consists of: <b>Emergency physician + ED nurse + Medical records/admitting clerk</b>. "
        "In extraordinary situations, multiple triage teams operate simultaneously. "
        "Triage category is identified by a <b>colour-coded band or disaster tag</b> placed on the patient.",
        S['Body']))

    story.append(Spacer(1, 0.2*cm))
    story.append(Paragraph("Triage Decision Factors", S['H2']))
    td_items = [
        "Nature and urgency of the patient's systemic condition",
        "Prognosis factors: age, general health, prior physical condition",
        "Qualifications of responders and availability of equipment and supplies",
        "Number of patients versus available resources",
        "Mechanism of injury and anticipated delayed presentations (e.g., blast injury: dysrhythmias, hyperkalemia, renal failure, pulmonary blast injury)",
    ]
    for item in td_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    # ════════════════════════════════════════════════════════════════
    # SECTION 6 – IN-HOSPITAL MANAGEMENT
    # ════════════════════════════════════════════════════════════════
    story.append(Spacer(1, 0.3*cm))
    story.append(section_header("6.  IN-HOSPITAL MANAGEMENT AND TREATMENT AREAS", color=TEAL))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph("Initial Response Activation", S['H2']))
    init_items = [
        "Disaster event verified by predesignated official → Emergency Operations Plan activated.",
        "Charge nurse and ED physician notified; on-call cascade activated; additional staff called in.",
        "ED physician/charge nurse acts as <b>on-site incident commander</b> until designated commander arrives.",
        "Discharge all non-emergency patients from ED; assess admission/discharge/transfer for current inpatients.",
        "Communicate patient capacity to regional emergency communications centre.",
        "Security diverts non-essential vehicles; one-way traffic flow to ambulance entrance established.",
        "Essential equipment (ETT, IV fluids, collars, splints, bandages) staged at ambulance entrance.",
    ]
    for item in init_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    story.append(Spacer(1, 0.2*cm))
    story.append(Paragraph("Treatment Zone Organisation", S['H2']))
    zones = [
        ["Zone", "Function", "Patients / Notes"],
        ["RESUSCITATION\n(Red Zone)", "Immediate life-saving care",
         "Trauma resuscitation, haemorrhagic/septic shock, severe respiratory failure.\nStaffed by emergency physicians. Located in ED core or direct OR triage."],
        ["PRESURGICAL HOLDING\n(Yellow Zone)", "Surgical triage and monitoring",
         "Trauma patients needing surgical evaluation. Staffed by surgery team.\nPatients can tolerate 45–60 min wait. Prioritised for OR."],
        ["MINOR TREATMENT\n(Green Zone)", "Urgent care / definitive minor care",
         "Majority of patients. Splinting, laceration closure, tetanus prophylaxis, observation.\nCan be in outpatient clinics; staffed by clinic physicians."],
        ["DECONTAMINATION\n(Pre-entry)", "Remove chemical/radiological contamination",
         "External to ED. Warm water wash. Level C PPE for staff."],
        ["MENTAL HEALTH AREA", "Psychiatric intervention",
         "Agitated patients, anxiety, PTSD, exacerbations of psychiatric illness.\nSocial workers, psychiatrists, critical stress response team."],
        ["MORGUE", "Fatality management",
         "Expanded to adjacent areas or freezer trucks (prearranged).\nDisaster Mortuary Operational Response Teams (DMORT) if needed."],
        ["FAMILY INFORMATION CENTRE", "Family liaison",
         "Separate from clinical areas. Prevents interference with care."],
        ["MEDIA CENTRE", "Press and public information",
         "Single hospital spokesperson (Public Information Officer). Away from clinical areas."],
        ["VOLUNTEER COORDINATION", "Manage unsolicited volunteers",
         "Emergency credentialing if appropriate. Prevents hindrance to care."],
    ]
    tz = Table(
        [[Paragraph(c, S['TableHdr'] if i==0 else S['TableCell']) for c in row]
         for i, row in enumerate(zones)],
        colWidths=[4*cm, 4.5*cm, 8.5*cm], repeatRows=1
    )
    tz.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0), TEAL),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white, GREY]),
        ('GRID',(0,0),(-1,-1),0.4,HexColor("#BBBBBB")),
        ('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    story.append(tz)

    story.append(Spacer(1, 0.3*cm))
    story.append(Paragraph("Clinical Management Principles in Disaster", S['H2']))
    cm_items = [
        "<b>Use radiographic and laboratory studies sparingly</b> — only if results will change management.",
        "Possible closed, non-angulated fractures: splint and delay X-ray 24–48 h.",
        "Chest X-ray for chest pain, dyspnoea, abnormal wall motion, or blast exposure.",
        "<b>FAST ultrasound</b> for intraperitoneal/pericardial fluid and pneumothorax — time and cost effective.",
        "Point-of-care testing preferred (e.g., baseline haematocrit and type-and-crossmatch in haemorrhagic shock).",
        "<b>Carboxyhaemoglobin</b> in smoke inhalation; no other routine labs indicated.",
        "Pulse oximetry as <b>spot assessment</b>, not continuous bedside monitoring.",
        "Wounds: consider <b>delayed primary closure</b> if contaminated or prolonged extrication.",
        "Post-extrication monitoring for: <b>cardiac dysrhythmias, hyperkalaemia, renal failure</b> (crush syndrome), pulmonary blast injury.",
        "Blood bank: ensure <b>up to 50 units of blood</b> available; mobilise volunteer donors from minimally injured patients and family members.",
        "Contact <b>CDC</b> for biological agent guidance; <b>Poison Centre</b> for chemical agents.",
    ]
    for item in cm_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    # ════════════════════════════════════════════════════════════════
    # SECTION 7 – TERTIARY CENTRE MANAGEMENT
    # ════════════════════════════════════════════════════════════════
    story.append(PageBreak())
    story.append(section_header("7.  MANAGEMENT IN A TERTIARY CENTRE", color=NAVY))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph(
        "Tertiary centres (Level I trauma centres / academic medical centres) provide "
        "the highest level of care and serve as the final referral destination in a disaster. "
        "They must activate their HEOP early and coordinate with regional hospitals.",
        S['Body']))

    story.append(Spacer(1, 0.15*cm))
    story.append(Paragraph("Tertiary Centre Disaster Activations", S['H2']))
    tc_items = [
        "<b>Surge capacity maximisation</b>: rapid discharge of stable inpatients, cancel elective admissions and procedures, activate disaster beds.",
        "<b>OR surge</b>: prioritise operative cases — haemorrhage control (damage control surgery), airway surgical management, cavity decompression.",
        "<b>ICU surge</b>: convert step-down and recovery rooms to ICU capacity; train rapid ICU protocols.",
        "<b>Trauma team activation</b>: senior surgeons, orthopaedics, neurosurgery, anaesthesia, and critical care on standby.",
        "<b>Blood product preparation</b>: massive transfusion protocols activated; blood bank pre-warmed; FFP:PRBCs:platelets (1:1:1 ratio for haemorrhagic shock).",
        "<b>Specialist resources</b>: burn unit, neurosurgical suite, cardiothoracic, paediatric care, toxicology consultation.",
        "<b>Radiology</b>: prioritise CT for complex multi-system trauma; FAST ultrasonography for rapid triage.",
        "<b>Pharmacy</b>: ensure antidotes (atropine, pralidoxime for organophosphates), antibiotics, analgesics, anticoagulants, blood products stockpiled.",
        "<b>Regional coordination</b>: accept incoming transfers; communicate available capacity to EMS dispatch and regional coordination centre.",
        "<b>Staff recall</b>: full disaster call-in of all surgical and critical care staff.",
    ]
    for item in tc_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    story.append(Spacer(1, 0.2*cm))
    story.append(Paragraph("Damage Control Surgery (DCS) in Disaster", S['H2']))
    dcs_items = [
        "<b>Phase 1 – Haemorrhage and contamination control</b>: abbreviated laparotomy, packing, shunts, temporary wound closure.",
        "<b>Phase 2 – ICU resuscitation</b>: correction of hypothermia, acidosis, and coagulopathy (lethal triad).",
        "<b>Phase 3 – Definitive repair</b>: return to OR after 24–48 h when physiology restored.",
        "Priority sequence: haemorrhage → airway → contamination → fracture stabilisation → soft tissue.",
    ]
    for item in dcs_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    # ════════════════════════════════════════════════════════════════
    # SECTION 8 – REFERRAL CRITERIA
    # ════════════════════════════════════════════════════════════════
    story.append(Spacer(1, 0.3*cm))
    story.append(section_header("8.  REFERRAL CRITERIA TO TERTIARY CENTRE", color=RED_BOX))
    story.append(Spacer(1, 0.25*cm))

    story.append(Paragraph(
        "Transfer to a higher-level centre (tertiary/Level I) is indicated when the receiving hospital "
        "cannot provide the required care. During a disaster, casualty distribution aims to spread the "
        "load, but critically injured patients must be directed to capable centres.",
        S['Body']))

    story.append(Spacer(1, 0.15*cm))
    ref_rows = [
        ["Category", "Specific Criteria for Referral"],
        ["Haemodynamic", "Persistent haemorrhagic shock not responding to 2L crystalloid / blood transfusion\nSuspected major vascular injury requiring vascular surgery"],
        ["Neurological", "Severe TBI (GCS ≤8), epidural/subdural haematoma, depressed skull fracture\nSpinal cord injury or suspected cervical spine instability"],
        ["Thoracic", "Tension pneumothorax (post-needle decompression), massive haemothorax\nSuspected aortic injury, tracheobronchial tear, cardiac tamponade"],
        ["Abdominal", "Haemoperitoneum (FAST positive) with haemodynamic instability\nSuspected hollow viscus perforation, mesenteric vascular injury, pancreatic/duodenal injury"],
        ["Orthopaedic", "Pelvic ring disruption with haemodynamic instability\nLong bone fractures requiring intramedullary nailing or complex fixation\nMajor limb replantation"],
        ["Burns", "Burns >20% TBSA; full-thickness burns >5% TBSA; burns involving face, hands, genitalia, perineum, major joints\nInhalation injury, circumferential burns, burns with concomitant trauma, paediatric burns"],
        ["CBRN / Special", "Suspected biological agent (smallpox, anthrax) requiring isolation and specialist management\nOrganophosphate / nerve agent poisoning requiring ICU monitoring and antidotes\nSignificant radiation exposure"],
        ["Paediatric", "Any critically injured child requiring paediatric surgical or paediatric ICU capability"],
        ["Resource", "Any patient whose needs exceed the current hospital's resources or specialist capabilities"],
    ]
    rt = Table(
        [[Paragraph(c, S['TableHdr'] if i==0 else S['TableCell']) for c in row]
         for i, row in enumerate(ref_rows)],
        colWidths=[4.5*cm, 12.5*cm], repeatRows=1
    )
    rt.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0), RED_BOX),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white, RED_BG]),
        ('GRID',(0,0),(-1,-1),0.4,HexColor("#BBBBBB")),
        ('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    story.append(rt)

    story.append(Spacer(1, 0.25*cm))
    story.append(color_box(
        "Key Points for Transfer",
        [
            "Stabilise before transfer: secure airway (intubate if needed), IV access, haemorrhage control, spinal precautions.",
            "Send relevant documentation: triage tag, administered medications, blood transfusion record.",
            "Communicate to receiving centre: mechanism, injuries, vital signs, interventions performed.",
            "Accompany with qualified staff (at minimum: trained nurse/paramedic with emergency experience).",
            "If no capacity at nearest tertiary centre: distribute to next available centre — maintain regional awareness.",
        ],
        bg=AMBER_BG, border=AMBER, title_color=AMBER
    ))

    # ════════════════════════════════════════════════════════════════
    # SECTION 9 – SHORT ANSWER QUESTION ON TRIAGE (10 MARKS)
    # ════════════════════════════════════════════════════════════════
    story.append(PageBreak())

    # Exam header box
    exam_hdr = Table([[
        Paragraph("EXAMINATION QUESTION", ParagraphStyle('eh',
            fontName='Helvetica-Bold', fontSize=13, textColor=white,
            alignment=TA_CENTER)),
    ]], colWidths=[W])
    exam_hdr.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1), NAVY),
        ('TOPPADDING',(0,0),(-1,-1),10),('BOTTOMPADDING',(0,0),(-1,-1),10),
    ]))
    story.append(exam_hdr)

    q_box = Table([[
        Paragraph(
            'Q. <b>Write a short note on Triage in Disaster Management.</b>',
            ParagraphStyle('qb', fontName='Helvetica-Bold', fontSize=11,
                           textColor=NAVY, alignment=TA_LEFT)),
        Paragraph('[10 Marks]',
            ParagraphStyle('marks', fontName='Helvetica-Bold', fontSize=11,
                           textColor=RED_BOX, alignment=TA_RIGHT)),
    ]], colWidths=[13*cm, 4*cm])
    q_box.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1), LIGHT_BG),
        ('BOX',(0,0),(-1,-1),1,NAVY),
        ('TOPPADDING',(0,0),(-1,-1),8),('BOTTOMPADDING',(0,0),(-1,-1),8),
        ('LEFTPADDING',(0,0),(-1,-1),10),('RIGHTPADDING',(0,0),(-1,-1),10),
        ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
    ]))
    story.append(q_box)
    story.append(Spacer(1, 0.3*cm))

    # Model Answer
    story.append(Paragraph("MODEL ANSWER", ParagraphStyle('ma',
        fontName='Helvetica-Bold', fontSize=12, textColor=TEAL, spaceBefore=2, spaceAfter=4)))
    story.append(HRFlowable(width=W, thickness=1.5, color=TEAL, spaceAfter=6))

    # 1 Definition
    story.append(Paragraph("1.  Definition  (1 mark)", S['H3']))
    story.append(Paragraph(
        "Triage (from French trier = 'to sort') is the process of sorting patients based on their need "
        "for immediate medical care and the likelihood of benefit from that care, especially when "
        "resources are limited. In disaster medicine, the overarching goal is to <b>do the most good "
        "for the most number of patients</b> — not necessarily saving every individual life.",
        S['Body']))

    # 2 Purpose
    story.append(Paragraph("2.  Purpose of Triage in Disaster  (1 mark)", S['H3']))
    p_items = [
        "Rapid assessment of all incoming casualties.",
        "Patient registration and identification.",
        "Assignment of priorities for management.",
        "Distribution of patients to appropriate treatment areas.",
    ]
    for item in p_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    # 3 Levels
    story.append(Paragraph("3.  Levels of Triage  (1 mark)", S['H3']))
    l_items = [
        "<b>Field triage:</b> At the scene — by first responders using START or SALT.",
        "<b>In-hospital (ED) triage:</b> At the hospital entrance — re-done even if field triage was performed.",
        "<b>Intra-hospital:</b> At each level of care (resuscitation area, surgical triage, ICU).",
    ]
    for item in l_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    # 4 Triage Categories
    story.append(Paragraph("4.  Triage Categories  (2 marks)", S['H3']))
    story.append(triage_color_table())

    # 5 START
    story.append(Spacer(1, 0.2*cm))
    story.append(Paragraph("5.  START Algorithm  (2 marks)", S['H3']))
    story.append(Paragraph(
        "The <b>Simple Triage and Rapid Treatment (START)</b> system is the most widely used field "
        "triage tool. It assesses four parameters in &lt;30 seconds per patient:",
        S['Body']))
    start_items = [
        "<b>Respirations</b>: absent → open airway → still absent → Black; >30/min → Red.",
        "<b>Perfusion</b>: no radial pulse or cap refill >2 sec → Red.",
        "<b>Mental Status</b>: cannot obey commands → Red; can obey → Yellow.",
        "<b>Walking</b>: ambulatory → Green (assessed last).",
    ]
    for item in start_items:
        story.append(Paragraph(f"\u2022  {item}", S['Bullet']))

    # 6 SALT
    story.append(Paragraph("6.  SALT Algorithm  (1 mark)", S['H3']))
    story.append(Paragraph(
        "SALT (Sort–Assess–Lifesaving interventions–Treat/Transport) has evidence of best sensitivity "
        "and specificity for mass casualty triage. It begins with a global sort into three tiers "
        "(walk, wave/purposeful movement, still/obvious life-threat), followed by individual assessment "
        "with brief lifesaving interventions (haemorrhage control, airway opening), then categorisation "
        "as Immediate, Delayed, Minimal, or Expectant (DIME).",
        S['Body']))

    # 7 Triage Tag
    story.append(Paragraph("7.  Triage Tag System  (0.5 marks)", S['H3']))
    story.append(Paragraph(
        "Each patient receives a colour-coded band or disaster tag documenting triage status. "
        "Tags allow rapid identification at a glance and prevent repeated triage of the same patient. "
        "They should include: patient identity (if known), mechanism of injury, vital signs, "
        "interventions performed, and triage category assigned.",
        S['Body']))

    # 8 Triage Team
    story.append(Paragraph("8.  Triage Team  (0.5 marks)", S['H3']))
    story.append(Paragraph(
        "The ED triage team consists of an <b>emergency physician, an ED nurse, and a medical records "
        "or admitting clerk</b>. Multiple teams operate in extraordinary situations. A single designated "
        "<b>Triage Officer</b> oversees consistency and quality of the triage process.",
        S['Body']))

    # 9 Dynamic nature
    story.append(Paragraph("9.  Dynamic and Continuous Nature of Triage  (0.5 marks)", S['H3']))
    story.append(Paragraph(
        "Triage is not a one-time event. Patient status changes — the GREEN patient may deteriorate to "
        "RED. <b>Continuous re-triage</b> at each level of care (field → ED → surgical holding → OR → "
        "ICU) is mandatory. Triage decisions must be revisited regularly, especially when delayed "
        "presentations are anticipated (blast injury, crush syndrome).",
        S['Body']))

    # 10 Ethical dimension
    story.append(Paragraph("10.  Ethical Considerations  (0.5 marks)", S['H3']))
    story.append(Paragraph(
        "Disaster triage requires a shift from the individual patient ethics of routine medicine to a "
        "<b>utilitarian, population-based ethic</b>. Catastrophically injured patients with minimal "
        "survival chance despite optimal care are categorised Expectant (Black). The duty of care toward "
        "Expectant patients is comfort and dignity — adequate analgesia and the opportunity to be with "
        "family — rather than aggressive life-saving intervention that would consume resources needed by "
        "salvageable patients.",
        S['Body']))

    story.append(Spacer(1, 0.3*cm))

    # Mark scheme summary table
    story.append(Paragraph("Mark Allocation Summary", S['H2']))
    ms_rows = [
        ["Point", "Topic", "Marks"],
        ["1", "Definition of triage", "1"],
        ["2", "Purpose / functions of triage in disaster", "1"],
        ["3", "Levels of triage (field, ED, intra-hospital)", "1"],
        ["4", "Triage categories (Red/Yellow/Green/Black with descriptions)", "2"],
        ["5", "START algorithm (4 parameters)", "2"],
        ["6", "SALT algorithm overview", "1"],
        ["7", "Triage tag system", "0.5"],
        ["8", "Triage team composition", "0.5"],
        ["9", "Dynamic / continuous re-triage", "0.5"],
        ["10", "Ethical considerations (utilitarian shift, Expectant care)", "0.5"],
        ["", "TOTAL", "10"],
    ]
    ms = Table(
        [[Paragraph(c, S['TableHdr'] if i==0 else
                    (ParagraphStyle('tot', fontName='Helvetica-Bold', fontSize=9,
                                    textColor=NAVY) if i==len(ms_rows)-1 else S['TableCell']))
          for c in row]
         for i, row in enumerate(ms_rows)],
        colWidths=[1.2*cm, 12*cm, 1.8*cm], repeatRows=1
    )
    ms.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0), NAVY),
        ('ROWBACKGROUNDS',(0,1),(-1,-2),[white, GREY]),
        ('BACKGROUND',(0,-1),(-1,-1), LIGHT_BG),
        ('GRID',(0,0),(-1,-1),0.4,HexColor("#BBBBBB")),
        ('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('ALIGN',(2,0),(-1,-1),'CENTER'),
    ]))
    story.append(ms)

    story.append(Spacer(1, 0.4*cm))
    story.append(HRFlowable(width=W, thickness=1, color=NAVY, spaceAfter=6))
    story.append(Paragraph(
        "Reference: Tintinalli JE et al. Tintinalli's Emergency Medicine: A Comprehensive Study Guide, "
        "9th Edition. McGraw-Hill Education. Chapters 5 (Disaster Preparedness) and 302 (Mass Casualty Triage).",
        ParagraphStyle('footer_ref', fontName='Helvetica-Oblique', fontSize=8,
                       textColor=HexColor("#555555"), alignment=TA_CENTER)
    ))

    # ── BUILD ────────────────────────────────────────────────────────────────
    doc.build(story, canvasmaker=HeaderFooterCanvas)
    print(f"PDF saved to {OUTPUT}")

build_pdf()
Running Command

cd /tmp/workspace/disaster-management && python generate_pdf.py 2>&1

Editing File

~/disaster-management/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/disaster-management/generate_pdf.py'
Running Command

cd /tmp/workspace/disaster-management && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/disaster-management/Disaster_Management_Tintinalli.pdf

Your PDF is ready. Download it here:

Disaster Management Tintinalli

PDF Document · PDF


What's inside (all sourced from Tintinalli's Emergency Medicine, 9th Ed.)

The document is multi-section, colour-coded, and formatted for study/printing across ~8 pages:
SectionContent
1. Definition, Types, CharacteristicsWHO definition, disaster taxonomy (natural/technological/intentional/internal/external), surge characteristics (80% self-transport, peak at 2–3 h)
2. Preparedness & PlanningHEOP components, Hazard Vulnerability Analysis, national response assets (FEMA, NDMS, CDC)
3. Out-of-Hospital (Field) ManagementICS, casualty collection points, field treatment principles (prolonged extrication vs. rapid transport), CBRN decontamination steps
4. Field Triage – START & SALTFull START algorithm table (Respirations → Perfusion → Mental Status → Walk), SALT (Sort–Assess–LSI–Treat/Transport), Tintinalli Table 302-5 (MASCAL triage algorithm)
5. In-Hospital TriageFull colour-coded system (Red/Yellow/Green/Black with Tintinalli Table 5-8 criteria), triage team, dynamic re-triage
6. In-Hospital ManagementTreatment zones (Resuscitation, Presurgical Holding, Minor Treatment, Decontamination, Mental Health, Morgue, Family/Media/Volunteer centres), clinical management principles (imaging, labs, blood banking)
7. Tertiary Centre ManagementSurge capacity, OR/ICU expansion, massive transfusion protocols, damage control surgery phases, specialist resources
8. Referral CriteriaDetailed table by system (haemodynamic, neuro, thoracic, abdominal, orthopaedic, burns, CBRN, paediatric) + transfer principles
9. SAQ – Triage (10 Marks)Exam-ready model answer with mark allocation breakdown across 10 sub-points

Include Indian management protocols in this pdf for same topic

Searching the Web

India National Disaster Management Authority NDMA guidelines hospital disaster management protocol

Searching the Web

India NDRF SDRF disaster medical response triage protocol mass casualty incident

Reading Web Page

https://asdma.gov.in/pdf/publication/undp/guidelines_hospita…

Reading Web Page

https://www.ndma.gov.in/sites/default/files/PDF/Technical%20…

Reading File
Reading File
Reading File
Reading File
Editing File

~/disaster-management/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/disaster-management/generate_pdf.py'
Editing File

~/disaster-management/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/disaster-management/generate_pdf.py'
Running Command

cd /tmp/workspace/disaster-management && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/disaster-management/Disaster_Management_Tintinalli.pdf

PDF generated successfully (53 KB — grown from 34 KB). Download it here:

Disaster Management Tintinalli

PDF Document · PDF


The updated PDF now includes a full Section 10: Indian Disaster Management Protocols, spanning ~4 additional pages. Here's what's been added:
Sub-sectionContent
10.1 Legislative FrameworkDisaster Management Act 2005, NDMA, NIDM, NDRF, SDRF, DDMA, MoHFW, NABH roles
10.2 Three-Tier SystemLevel I (District/Tier I) → Level II (State/SDRF) → Level III (National/NDRF); activation criteria
10.3 Pre-Hospital ManagementFirst Aid Parties, First Aid Posts (static/mobile), 108 ERS, Mobile Surgical Units, NDRF medical teams, Incident Response System (IRS), Casualty Collection Points
10.4 Field Triage – Indian ProtocolFour-colour triage table (Red/Yellow/Green/Black) per NDMA guidelines — colour band on upper arm; zone assignments (Main Casualty Hall, Disaster Room, Observation Room)
10.5 In-Hospital ProtocolRMO-activated HDMP; command structure (Triage Officer, Medical Controller, Nursing Superintendent, Security, PRO); visitor restriction (KASH/NABH policy)
10.6 Treatment ZonesIndian zone names mapped to colour codes with patient categories
10.7 Referral ChainPHC → CHC → District Hospital → Medical College → AIIMS/Regional Trauma Centres; 108 ERS role
10.8 CBRN ProtocolNDRF CBRN units; NPIC AIIMS (chemical: 011-26589391); AERB/BARC (radiological); IDSP/ICMR (biological)
10.9 PsychosocialNDMA Psychosocial Guidelines 2009; PSTs, PFA (ASHA/ANM), CISD for responders, NMHP
10.10 Comparison TableSide-by-side Tintinalli vs. Indian protocol across 15 parameters (triage algorithm, command system, ambulance, CBRN hotlines, referral, legal basis)
This is a shared conversation. Sign in to Orris to start your own chat.