write xo.plications of spinal Anaesthesia my refernce book is miller ,korgan write everything tevhnique relared spinal needle related everything

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Reading File
Reading File
Reading File
I now have comprehensive material from both textbooks. Let me compile the complete, detailed answer.

Complications of Spinal Anaesthesia

Based on Miller's Anesthesia (10th Ed.) and Morgan & Mikhail's Clinical Anesthesiology (7th Ed.)


SPINAL NEEDLES - Types, Design, and Selection

Needle Tip Designs

There are two broad categories of spinal needle tip (Miller's Ch. 41, Morgan & Mikhail Ch. 45):
1. Cutting (Sharp) Tip Needles
  • Quincke-Babcock needle: The classic cutting needle with a bevelled, sharp tip and end injection orifice. Cuts through dural fibres rather than separating them, producing a larger dural defect and a significantly higher incidence of post-dural puncture headache (PDPH).
  • Pitkin needle: Another cutting tip design, now largely historical.
2. Pencil-Point (Atraumatic / Non-Cutting) Tip Needles
  • Whitacre: Rounded, conical (pencil-point) tip with side injection. Separates rather than cuts dural fibres, dramatically reducing PDPH risk.
  • Sprotte: Pencil-point tip with a long, oval side-injection opening. Gives vigorous CSF flow due to the large aperture - but this creates a specific risk: if only the distal part of the opening is subarachnoid (with free CSF flow) while the proximal part of the opening remains outside the dura, the full drug dose will not be delivered intrathecally, resulting in a failed block.
  • Pencan: Another atraumatic pencil-point design.
Below is a scanning electron micrograph from Miller's (Fig. 41.4) showing the three needle tip designs:
Scanning electron micrographs of spinal needle tips - Quincke (left), Sprotte (middle), Whitacre (right)
Fig. 41.4 - Miller's Anesthesia, 10e: Quincke (left), Sprotte (middle), Whitacre (right)

Needle Gauge and PDPH Relationship

GaugePDPH Incidence
22-G cutting~40%
25-GSignificantly lower
26-G atraumaticLowest probability of both PDPH and failure (optimal balance)
29-G<2% PDPH but increased procedural failure
The use of pencil-point needles and smaller gauge (≥22-G) together minimise PDPH. However, below 25-G, the failure rate rises because tactile feedback is poor and aspiration of CSF may require active suction. An introducer needle assists guidance of very fine-gauge needles (Miller's, p. 6065-6066).
All spinal needles must have a tightly fitting removable stylet that completely occludes the lumen to prevent epithelial cell tracking into the subarachnoid space (Morgan & Mikhail, p. 1825).

NR-Fit (Non-Luer) Connectors

Non-Luer syringes and needles are now available for spinal kits to prevent inadvertent intrathecal injection of wrong drugs - though correct drug selection must still occur before drawing into the non-Luer syringe (Miller's, p. 6065).

TECHNIQUE OF SPINAL ANAESTHESIA

Pre-procedure Preparation (Miller's Ch. 41)

  • Obtain informed consent with documentation of risks discussed.
  • Ensure resuscitation equipment is immediately available at all times.
  • Minimum monitoring: pulse oximetry, NIBP, ECG.
  • Establish adequate IV access.
  • Preprepared packs typically contain drapes, swabs, syringes, needles, filters, spinal needles, sterilising solution, and local anaesthetic for skin infiltration.
  • Match local anaesthetic duration to the surgical procedure (see drug selection below).

Sterility

  • Mask, hand/forearm wash, glove.
  • Most common organism in post-spinal bacterial meningitis is Streptococcus viridans (an oral commensal), emphasising the purpose of wearing a mask.
  • Skin cleaning: chlorhexidine + alcohol is the most effective combination. Chlorhexidine must be allowed to dry completely before needle insertion - chlorhexidine is neurotoxic if introduced intrathecally while still wet (Miller's, p. 6067).

Patient Positioning

1. Lateral Decubitus
  • Patient's back parallel to the table edge nearest the anaesthesiologist.
  • Thighs flexed onto abdomen, neck flexed to bring forehead toward knees ("foetal position") to open vertebral spaces.
  • More comfortable; allows sedation; less reliant on an assistant.
  • In females, hips wider than shoulders cause the spine to slope downward toward the head (relevant when using hyperbaric solutions).
  • In males, the opposite occurs.
2. Sitting Position
  • Easier midline identification, especially in obese or scoliotic patients.
  • Stool footrest + pillow in lap; assistant helps maintain vertical posture and flexion.
  • Hypotension may be more common.
  • Do not over-sedate.
3. Prone (Jack-knife)
  • Used when surgery is to be performed in prone position (rectal, perineal, lumbar procedures).
  • Gravity opposes CSF flow; active aspiration may be needed to confirm dural puncture.
IMPORTANT: Current consensus guidelines recommend neuraxial blocks should NOT be routinely performed under general anaesthesia or deep sedation, as this prevents the patient from reporting warning paresthesiae indicating needle proximity to neural structures.

Landmark Identification

  • Intercristal (Tuffier's) line between the two iliac crests traditionally corresponds to L4 vertebral body or L4-L5 interspace.
  • Ultrasound studies show this landmark is unreliable; ultrasound can be used to verify the interspace.
  • Spinal cord ends at L1-L2; insertion above this level should be avoided.
  • Target interspaces: L3-L4 or L4-L5 (midline approach).

Midline Approach

  1. Skin wheal of LA over the selected interspace.
  2. Insert introducer at a 10-15 degree cephalad angle through skin, subcutaneous tissue, and supraspinous ligament.
  3. Advance spinal needle through the introducer - two "pops" are felt:
    • First pop: penetration of ligamentum flavum.
    • Second pop: penetration of the dura-arachnoid membrane.
  4. Remove stylet - verify free flow of CSF.
    • With needles <25-G, active aspiration may be needed.
    • If CSF flows initially but cannot be re-aspirated after syringe attachment, the needle has moved.
  5. Persistent paresthesia or pain during injection: withdraw and redirect the needle before proceeding.
  6. Inject drug in a controlled manner; note bevel direction with cutting needles (bevel parallel to longitudinal dural fibres reduces the defect size and lowers PDPH).

Paramedian Approach

  • Useful when midline approach is difficult (mid-to-high thoracic, heavily calcified interspinous ligaments, kyphosis).
  • Needle inserted 1-2 cm lateral to the inferior tip of the spinous process of the vertebra above the desired interspace.
  • Advanced horizontally to hit lamina, then redirected medially and cephalad.
  • Taylor approach: Modified paramedian via the L5-S1 interspace. Needle placed 1 cm medial and 1 cm inferior to the posterior superior iliac spine, angled medially and cephalad at 45-55 degrees. Useful in trauma patients who cannot sit.

Factors Affecting Block Level (Morgan & Mikhail Table 45-2)

The three most important determinants are:
  1. Baricity of LA solution and patient position during/after injection.
  2. Drug dose (volume x concentration).
  3. Site of injection (more cephalad injection = more cephalad spread).
CSF specific gravity = 1.003-1.008 at 37°C.
  • Hyperbaric solution (heavier than CSF): settles to the dependent side.
  • Hypobaric solution (lighter than CSF): rises toward the non-dependent side.
  • Isobaric solution: relatively position-independent spread.

Block Monitoring (Miller's Ch. 41)

  • Assess onset, extent, and quality of sensory and motor block.
  • Sensory assessment: cold (C-fibers assessed first, most cephalad spread), then pinprick (Aδ-fibers), then touch (Aβ-fibers).
  • Motor block: Modified Bromage Scale:
    • 0: No block
    • 1: Cannot raise extended leg; can move knees and feet
    • 2: Cannot raise extended leg or move knee; can move feet
    • 3: Complete lower limb motor block
  • Block is considered adequate when cold/pinprick level is 2-3 segments above the expected surgical stimulus level.

COMPLICATIONS OF SPINAL ANAESTHESIA

Complications of spinal anaesthesia fall into three categories (Morgan & Mikhail Table 45-6):
CategoryExamples
Adverse/exaggerated physiological responsesHypotension, urinary retention, high block, total spinal, cardiac arrest, anterior spinal artery syndrome, Horner syndrome
Needle/catheter-related complicationsPDPH, backache, neural injury, cauda equina syndrome, spinal/epidural haematoma, meningitis, epidural abscess, arachnoiditis
Drug toxicityLAST (local anaesthetic systemic toxicity), TNS, cauda equina syndrome

1. HYPOTENSION

Most common complication of spinal anaesthesia. Defined as >20% decrease from baseline systolic BP or systolic BP <100 mmHg.
Mechanism: Sympathetic blockade causes vasodilation (decreased SVR and venous return). Worsened by:
  • Aortocaval compression (supine position, especially in pregnancy)
  • Upright or semi-upright position
  • Hypovolaemia (exaggerated response)
  • Pre-existing aortic stenosis or fixed cardiac output states
Treatment:
  • IV phenylephrine boluses (40-120 mcg) - first-line vasopressor
  • IV fluid bolus (though routine crystalloid pre-loading before epidural does not reliably prevent hypotension)
  • Supplemental oxygen
  • Left uterine displacement in pregnant patients
  • Trendelenburg position is controversial (may impair pulmonary gas exchange)
  • Ephedrine (if bradycardia component is present)

2. HIGH SPINAL / TOTAL SPINAL ANESTHESIA

Mechanism: Excessive cephalad spread of LA. Causes include excessive dose, failure to reduce dose in at-risk patients (elderly, obese, pregnant, very short), or unusual spread.
Levels and consequences:
  • High thoracic/cervical spread: severe hypotension, bradycardia, respiratory insufficiency.
  • Total spinal (extends to cranial nerves): unconsciousness, apnoea, profound hypotension.
  • Apnoea is more commonly due to medullary hypoperfusion from sustained hypotension than to phrenic nerve palsy (C3-C5) per se.
  • Anterior spinal artery syndrome can result from prolonged severe hypotension combined with raised intraspinal pressure.
Symptoms preceding total spinal:
  • Nausea often precedes hypotension.
  • Dyspnoea, numbness/weakness in upper extremities.
Treatment:
  • Reassure patient.
  • Supplemental oxygen; assisted ventilation; intubation + mechanical ventilation if needed.
  • IV vasopressors (ephedrine, epinephrine) and rapid IV fluids.
  • Atropine early for bradycardia.
  • Epinephrine for cardiac arrest.
(Morgan & Mikhail, p. 1847)

3. CARDIAC ARREST DURING SPINAL ANAESTHESIA

  • Relatively high incidence: approximately 1:1500 spinal anaesthetics.
  • Many preceded by bradycardia; many occur in young, healthy patients.
  • Contributing factors: oversedation, unrecognised hypoventilation, hypoxia (historical cases predated pulse oximetry), untreated hypovolaemia.
  • Prevention: Prompt treatment of bradycardia and hypotension is strongly recommended.
(Morgan & Mikhail, p. 1847)

4. BRADYCARDIA

  • From sympathetic blockade (block of cardioaccelerator fibres T1-T4 when block is high).
  • Also from the Bezold-Jarisch reflex: venous pooling reduces venous return, activating intracardiac stretch receptors, producing paradoxical bradycardia.
  • Treatment: atropine, ephedrine, epinephrine if severe.

5. POST-DURAL PUNCTURE HEADACHE (PDPH)

Mechanism: Loss of CSF through the dural hole reduces CSF pressure, causing traction on pain-sensitive intracranial structures. Compensatory intracranial venous dilation also contributes.
Characteristics (Morgan & Mikhail, p. 1851):
  • Bilateral, frontal, retroorbital or occipital, extending into the neck.
  • Throbbing or constant; associated with photophobia and nausea.
  • Hallmark: postural - aggravated by sitting/standing, relieved by lying flat.
  • Onset typically 12-72 hours after dural puncture (may be delayed up to 7 days).
  • May be accompanied by diplopia (CN VI palsy), tinnitus, and hearing changes.
Risk factors:
  • Large-gauge needle.
  • Cutting (Quincke) tip vs. pencil-point tip.
  • Female sex, younger age, obstetric patients.
  • Prior history of PDPH.
Prevention:
  • Use pencil-point needles ≥22-G (ideally 25-26-G).
  • If using a cutting needle, bevel parallel to longitudinal dural fibres.
  • Replacing the stylet before withdrawing the needle reduces PDPH rate.
Treatment:
  • Conservative: bed rest, hydration, caffeine (promotes vasoconstriction), simple analgesics.
  • Epidural blood patch (EBP): gold-standard treatment. Autologous blood (15-20 mL) injected into the epidural space at the level of the dural puncture. Creates a clot that seals the defect. Relief in >90% of cases. A second patch can be performed if the first is inadequate.

6. URINARY RETENTION

  • Local anaesthetic block of S2-S4 root fibres decreases bladder tone and inhibits the voiding reflex.
  • Intrathecal/epidural opioids also impair voiding.
  • Management: bladder catheterisation if persistent.
(Morgan & Mikhail, p. 1848)

7. BACKACHE

  • Needle passage through skin, subcutaneous tissue, muscle, and ligaments causes varying degrees of tissue trauma, bruising, and localised inflammation.
  • Usually mild and self-limited (days to weeks).
  • Important: up to 25-30% of patients receiving general anaesthesia also report postoperative backache, and a large proportion of the population has pre-existing chronic back pain.
  • Treatment: paracetamol or NSAIDs.
  • Clinical significance: Backache may be the first sign of a serious complication (epidural haematoma or abscess). Must not be dismissed without assessment.
(Morgan & Mikhail, p. 1850)

8. TRANSIENT NEUROLOGICAL SYMPTOMS (TNS) / Transient Radicular Irritation (TRI)

Definition: Back pain radiating to the legs without motor or sensory deficits, occurring after resolution of spinal anaesthesia and resolving spontaneously within several days. First described in 1993.
Cause: Most commonly hyperbaric lidocaine (incidence up to 12%). Also reported with:
  • Tetracaine (2%)
  • Bupivacaine (1%)
  • Mepivacaine, prilocaine, procaine, ropivacaine
Risk factors: Greatest among outpatients; lithotomy position; male sex. Least common in inpatients not in lithotomy position.
Treatment: NSAIDs, spontaneous resolution within days. No permanent sequelae.
(Morgan & Mikhail, p. 1855)

9. CAUDA EQUINA SYNDROME

  • Permanent lower motor neuron damage: saddle anaesthesia, bowel/bladder dysfunction, variable lower limb weakness.
  • Most commonly associated with continuous spinal anaesthesia via microcatheters using hyperbaric 5% lidocaine - the drug pools around the cauda equina at high concentration.
  • Also associated with direct trauma from needle, haematoma, or abscess.
  • The 5% hyperbaric lidocaine preparation has largely been abandoned due to this risk.

10. SPINAL / EPIDURAL HAEMATOMA

Risk: Low overall incidence but potentially catastrophic.
Presentation: Back pain, radicular pain, progressive motor or sensory deficits, sphincter dysfunction.
Risk factors:
  • Anticoagulant or antiplatelet therapy (see ASRA guidelines).
  • Coagulopathy, thrombocytopenia.
  • Traumatic needle insertion, multiple attempts.
  • Underlying spinal vascular lesions.
Management:
  • Urgent MRI or CT imaging.
  • Neurosurgical decompression within 6-8 hours of onset of neurological deficit is the key determinant of neurological recovery.
  • ASRA (American Society of Regional Anesthesia) guidelines define minimum intervals between anticoagulant administration and neuraxial procedures (see ASRA 4th edition guidelines, Horlocker et al. 2018).

11. MENINGITIS

  • Bacterial or chemical (aseptic).
  • Bacterial meningitis: Most common organism - Streptococcus viridans (oral commensal) - transmitted from the operator's droplets. Full aseptic technique including mask is essential.
  • Chemical/aseptic meningitis: May result from detergents, antiseptics, or preservatives introduced into the intrathecal space.
  • Presentation: fever, headache, neck stiffness, photophobia. CSF analysis confirms diagnosis.
  • Treatment: antibiotics, supportive care.

12. EPIDURAL ABSCESS

Incidence: Rare - 1:6,500 to 1:500,000 epidurals. Most reported cases involve epidural catheters (mean time from insertion to symptoms: 5 days; may present weeks later).
Four classic clinical stages (Morgan & Mikhail, p. 1853-1854):
  1. Back pain intensified by spinal percussion.
  2. Nerve root / radicular pain.
  3. Motor/sensory deficits or sphincter dysfunction.
  4. Paraplegia / paralysis.
Organisms: Staphylococcus aureus and S. epidermidis most common.
Management:
  • Remove catheter (if present) and culture the tip.
  • Blood cultures.
  • Anti-staphylococcal antibiotics.
  • Urgent MRI/CT to confirm.
  • Surgical decompression (laminectomy) or percutaneous drainage.
  • Prognosis correlates with degree of neurological deficit at time of diagnosis.
Prevention strategies:
  • Minimise catheter manipulations; maintain closed system.
  • Use 0.22-μm bacterial filter.
  • Replace/remove epidural catheter after defined time interval (some practitioners remove after 4 days).

13. ARACHNOIDITIS

  • Inflammation of the arachnoid membrane, resulting in fibrosis and adhesion formation.
  • Can be caused by intrathecal injection of: chlorhexidine (if not fully dried), blood, detergents, preservatives, or contaminated solutions.
  • Presents as chronic, progressive pain and neurological dysfunction.
  • Largely preventable by meticulous technique and using only preservative-free solutions intrathecally.

14. NEURAL INJURY

Direct nerve trauma: Paresthesia or pain on needle insertion indicates needle proximity to nerve root. Persistent paresthesia or pain during injection demands immediate needle withdrawal and redirection.
Spinal cord injury:
  • Needle insertion above L1-L2 risks direct spinal cord trauma.
  • More common with thoracic spinal procedures.
Nerve root damage: Usually temporary paresthesia; permanent damage is rare.
Anterior spinal artery syndrome: Ischaemia of the anterior two-thirds of the spinal cord (motor tracts, spinothalamic tract) from prolonged severe hypotension + raised intraspinal pressure during neuraxial anesthesia. Results in permanent motor paralysis with preserved posterior column sensation.

15. SUBDURAL INJECTION

  • Inadvertent injection into the potential space between dura and arachnoid.
  • With spinal doses: relatively less serious.
  • With epidural doses: produces presentation similar to high spinal - but onset may be delayed 15-30 minutes and block may be "patchy."
  • Spinal subdural space extends intracranially, so LA can ascend to very high levels.
  • Treatment: supportive - intubation, mechanical ventilation, cardiovascular support.
(Morgan & Mikhail, p. 1849)

16. FAILED OR INADEQUATE SPINAL BLOCK

Causes (Morgan & Mikhail, p. 1848):
  • Needle movement during injection.
  • Incomplete entry of needle opening into subarachnoid space.
  • Subdural injection.
  • Injection into a nerve root sleeve.
  • With Sprotte needle: CSF flows freely from distal end of the side aperture which is subarachnoid, while the proximal portion of the aperture has not cleared the dura - drug delivered partly extradurally.
  • Insufficient drug dose.
Management: If CSF does not flow freely, withdraw and re-site the needle.

17. HORNER'S SYNDROME

  • From ipsilateral sympathetic blockade at T1-T3 level (ptosis, miosis, anhidrosis, enophthalmos).
  • Seen with high thoracic spinal or cervical extension.
  • Usually transient and resolves with block regression.

18. NAUSEA AND VOMITING

  • Very common, often preceding hypotension.
  • Caused by hypotension reducing cerebral perfusion, or vagal dominance from unopposed parasympathetics after sympathetic block.
  • Treatment of the underlying hypotension usually resolves nausea.
  • Ondansetron or metoclopramide can be used.

19. RESPIRATORY COMPROMISE

  • Results from blockade of intercostal muscles (T1-T12) and potentially phrenic nerve (C3-C5) with very high blocks.
  • Most cases of apnoea during high spinal are from medullary ischaemia (due to hypotension) rather than phrenic nerve block alone.
  • Management: oxygen supplementation, assisted ventilation, intubation if needed.

20. WRONG ROUTE ADMINISTRATION

  • Risk of epidural drug dosages being given intrathecally (10x overdose).
  • Risk of wrong drug entirely entering the intrathecal space.
  • Prevention: NR-Fit (non-Luer) connectors, careful drug labelling, independent double checks.

INCIDENCE DATA (Morgan & Mikhail Table 45-7)

In a large survey of regional anaesthetics (n = 40,640 spinal cases):
ComplicationSpinal (per case)
Cardiac arrest26 cases
Death6 cases
Seizure0 cases
Cauda equina syndrome5 cases
Paraplegia0 cases
Radiculopathy19 cases
In the ASA Closed Claims Project (20-year period, 1980-1999): Spinal anaesthesia accounted for 34% of regional anaesthesia liability claims. Injury breakdown: temporary/non-disabling (64%), death (13%), permanent nerve injury (10%), permanent brain damage (8%).

SPECIAL POPULATIONS (Miller's Ch. 41)

PopulationConsideration
Spinal stenosisIncreased neurological complication risk; consider lower LA dose
Previous spine surgeryUnpredictable/incomplete spread; needle access may be impossible
Multiple sclerosisProlonged blockade; use lower dose/concentration; demyelinated fibres more susceptible to LA neurotoxicity
Spina bifidaRisk of tethered cord injury; ligamentum flavum may be absent; unpredictable spread; avoid in severe neural tube defects
Aortic stenosis / fixed cardiac outputUnpredictable SVR reduction is dangerous; consider catheter-based technique (intrathecal catheter) for incremental dosing
HypovolaemiaExaggerated hypotensive response; correct volume deficit first
PregnancyReduced LA dose requirement; left uterine displacement critical; use of vasopressors differs from non-obstetric patients

SUMMARY TABLE OF COMPLICATIONS

ComplicationKey FeatureTreatment
HypotensionMost common; sympathetic blockPhenylephrine, fluids, O2
High/Total SpinalExcessive spread; apnoea, arrestABC, vasopressors, intubation
Cardiac arrest1:1500 incidenceCPR, epinephrine
PDPHPostural headache; 12-72h onsetConservative, EBP
TNSBack pain to legs; no deficit; resolves in daysNSAIDs
Cauda equinaSaddle anaesthesia, sphincter dysfunctionSupportive; prevention only
HaematomaBack pain + neuro deficitUrgent MRI, surgical decompression
MeningitisFever, headache, neck stiffnessAntibiotics
Epidural abscess4 stages; rareDecompression + antibiotics
ArachnoiditisChronic pain/neuro dysfunctionPrevention (sterile technique)
BackacheCommon, usually self-limitedParacetamol/NSAIDs
Urinary retentionS2-S4 blockCatheterisation
TNS (lidocaine)Up to 12% incidenceNSAIDs, spontaneous resolution
Neural injuryParesthesia on injectionWithdraw needle immediately

References:
  • Miller's Anesthesia, 2-Volume Set, 10th Edition - Chapter 41 (Spinal, Epidural, and Caudal Anesthesia)
  • Morgan and Mikhail's Clinical Anesthesiology, 7th Edition - Chapter 45 (Neuraxial Anesthesia)

make flow chart.of everything tevhnique relsted drug related how we gibe dpinal.and everything that could be complication

Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/spinal-flowchart

Writing File

~/spinal-flowchart/spinal_flowchart.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"

// ─── PALETTE ─────────────────────────────────────────────────────────────────
const C = {
  navy:      "0A1628",  // deep navy - dominant background
  darkBlue:  "0D2B55",  // section headers
  teal:      "0F7B8C",  // technique boxes
  tealLight: "1AA3B5",  // technique lighter
  green:     "1B7A4A",  // drug boxes
  greenLight:"27A866",  // drug lighter
  red:       "C0392B",  // complications
  redLight:  "E74C3C",  // complications lighter
  orange:    "D35400",  // warnings / special
  gold:      "F39C12",  // accents / arrows
  white:     "FFFFFF",
  lightGray: "ECF0F1",
  midGray:   "BDC3C7",
  darkGray:  "2C3E50",
  cream:     "FDFEFE",
};

// ─── HELPER: rounded box with text ───────────────────────────────────────────
function box(slide, x, y, w, h, text, bgColor, txtColor, fontSize, options = {}) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: bgColor },
    line: { color: options.borderColor || "FFFFFF", width: options.borderWidth || 0 },
    rectRadius: options.radius !== undefined ? options.radius : 0.08,
    shadow: options.shadow ? { type: "outer", color: "000000", blur: 4, offset: 2, angle: 45, opacity: 0.3 } : undefined,
  });
  slide.addText(text, {
    x, y, w, h,
    fontSize: fontSize || 10,
    color: txtColor || C.white,
    bold: options.bold !== undefined ? options.bold : false,
    align: options.align || "center",
    valign: options.valign || "middle",
    wrap: true,
    margin: options.margin !== undefined ? options.margin : 4,
    fontFace: "Calibri",
  });
}

// ─── HELPER: arrow (simple line with arrowhead) ──────────────────────────────
function arrow(slide, x1, y1, x2, y2, color) {
  slide.addShape(pres.ShapeType.line, {
    x: x1, y: y1, w: x2 - x1, h: y2 - y1,
    line: {
      color: color || C.gold,
      width: 1.8,
      endArrowType: "arrow",
    },
  });
}

function arrowDown(slide, x, y1, y2, color) {
  arrow(slide, x, y1, x, y2, color);
}
function arrowRight(slide, x1, x2, y, color) {
  arrow(slide, x1, y, x2, y, color);
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  // Full background
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });

  // Decorative accent bar left
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.45, h: 7.5, fill: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0.45, y: 0, w: 0.12, h: 7.5, fill: { color: C.gold } });

  // Decorative accent bar right
  s.addShape(pres.ShapeType.rect, { x: 12.73, y: 0, w: 0.45, h: 7.5, fill: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 12.73, y: 0, w: 0.12, h: 7.5, fill: { color: C.gold } });

  // Title
  s.addText("SPINAL ANAESTHESIA", {
    x: 1, y: 1.6, w: 11.3, h: 1.2,
    fontSize: 48, color: C.white, bold: true, align: "center",
    fontFace: "Calibri", charSpacing: 6,
  });

  // Subtitle
  s.addText("Complete Flowchart: Technique · Drugs · Complications", {
    x: 1, y: 3.0, w: 11.3, h: 0.65,
    fontSize: 22, color: C.tealLight, bold: false, align: "center", fontFace: "Calibri",
  });

  // Reference line
  s.addText("Reference: Miller's Anesthesia 10e  |  Morgan & Mikhail's Clinical Anesthesiology 7e", {
    x: 1, y: 6.6, w: 11.3, h: 0.5,
    fontSize: 13, color: C.midGray, align: "center", fontFace: "Calibri",
  });

  // Horizontal divider
  s.addShape(pres.ShapeType.line, { x: 1.5, y: 3.8, w: 10.3, h: 0, line: { color: C.gold, width: 1.5 } });

  // 3 category pillars
  const cats = [
    { label: "TECHNIQUE", color: C.teal, x: 1.8 },
    { label: "DRUGS", color: C.green, x: 5.4 },
    { label: "COMPLICATIONS", color: C.red, x: 9.0 },
  ];
  cats.forEach(c => {
    s.addShape(pres.ShapeType.roundRect, {
      x: c.x, y: 4.1, w: 3.2, h: 0.85,
      fill: { color: c.color }, rectRadius: 0.12,
    });
    s.addText(c.label, {
      x: c.x, y: 4.1, w: 3.2, h: 0.85,
      fontSize: 18, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW MASTER FLOWCHART
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: C.darkBlue } });
  s.addText("SPINAL ANAESTHESIA — MASTER OVERVIEW FLOWCHART", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.gold, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // DECISION TO PERFORM SPINAL
  box(s, 4.9, 0.65, 3.5, 0.62, "DECISION TO PERFORM SPINAL", C.darkBlue, C.white, 11, { bold: true, borderColor: C.gold, borderWidth: 1.5 });
  arrowDown(s, 6.65, 1.27, 1.68, C.gold);

  // 3 columns headers
  box(s, 0.2, 1.68, 3.7, 0.5, "① PRE-PROCEDURE", C.teal, C.white, 11, { bold: true });
  box(s, 4.8, 1.68, 3.7, 0.5, "② TECHNIQUE / EXECUTION", C.tealLight, C.white, 11, { bold: true });
  box(s, 9.4, 1.68, 3.7, 0.5, "③ POST-PROCEDURE", "2E4057", C.white, 11, { bold: true });

  // Pre-procedure steps
  const pre = [
    "Informed consent & documentation",
    "IV access + monitoring\n(SpO2, NIBP, ECG)",
    "Resuscitation equipment ready",
    "Patient positioning\n(Lateral / Sitting / Prone)",
    "Choose drug + dose\nbased on surgery",
    "Aseptic technique\n(mask, gloves, chlorhexidine)",
  ];
  let py = 2.3;
  pre.forEach((t, i) => {
    box(s, 0.2, py, 3.7, 0.52, `${i+1}. ${t}`, i % 2 === 0 ? "0D3B5E" : "0D2B55", C.white, 8.5, { align: "left", margin: 8 });
    py += 0.58;
  });

  // Technique steps
  const tech = [
    "Landmark identification\n(L3-L4 or L4-L5 interspace)",
    "Skin wheal of LA",
    "Introducer needle\n(10-15° cephalad angle)",
    "Spinal needle advance\n→ Feel 2 'pops'",
    "Confirm free CSF flow",
    "Inject drug slowly\n(note baricity vs position)",
  ];
  let ty = 2.3;
  tech.forEach((t, i) => {
    box(s, 4.8, ty, 3.7, 0.52, `${i+1}. ${t}`, i % 2 === 0 ? "1A5276" : "154360", C.white, 8.5, { align: "left", margin: 8 });
    ty += 0.58;
  });

  // Post-procedure
  const post = [
    "Position patient per baricity",
    "Monitor sensory block level\n(cold, pinprick, touch)",
    "Assess motor block\n(Modified Bromage Scale)",
    "Monitor BP every 2 min\nfor first 15 min",
    "Treat complications promptly",
    "Document block height & time",
  ];
  let pp = 2.3;
  post.forEach((t, i) => {
    box(s, 9.4, pp, 3.7, 0.52, `${i+1}. ${t}`, i % 2 === 0 ? "1A3A4A" : "162C38", C.white, 8.5, { align: "left", margin: 8 });
    pp += 0.58;
  });

  // Arrows down from headers to first items
  arrowDown(s, 2.05, 2.18, 2.3, C.tealLight);
  arrowDown(s, 6.65, 2.18, 2.3, C.tealLight);
  arrowDown(s, 11.25, 2.18, 2.3, C.tealLight);

  // Bottom note
  s.addText("★  If FREE CSF does not flow → withdraw & re-site  |  If paresthesia on injection → STOP, withdraw, redirect", {
    x: 0.2, y: 7.05, w: 12.9, h: 0.35,
    fontSize: 9.5, color: C.gold, align: "center", fontFace: "Calibri", italic: true,
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 3 — TECHNIQUE DETAILED FLOWCHART
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: C.teal } });
  s.addText("TECHNIQUE FLOWCHART — Step-by-Step Execution", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // Left column: NEEDLE SELECTION
  box(s, 0.2, 0.7, 5.6, 0.45, "NEEDLE SELECTION", C.teal, C.white, 12, { bold: true });

  // Needle type table
  const needles = [
    ["CUTTING TIP", C.orange, ["Quincke (end injection)", "Pitkin (historical)", "Higher PDPH risk", "Bevel → parallel to dural fibres"]],
    ["PENCIL-POINT", C.green, ["Whitacre (side injection)", "Sprotte (long oval side opening)", "Pencan", "Lower PDPH risk (preferred)"]],
  ];
  let nx = 0.2;
  needles.forEach(([title, col, items]) => {
    box(s, nx, 1.25, 2.7, 0.38, title, col, C.white, 10, { bold: true });
    items.forEach((item, i) => {
      box(s, nx, 1.68 + i * 0.42, 2.7, 0.38, "• " + item, i % 2 === 0 ? "1A3A4A" : "162C38", C.white, 8.5, { align: "left", margin: 6 });
    });
    nx += 2.85;
  });

  // Gauge recommendation
  box(s, 0.2, 3.4, 5.6, 0.85,
    "GAUGE: 25-26G pencil-point = optimal (fewest PDPH + acceptable failure rate)\n22G: PDPH ~40%  |  29G: PDPH <2% but high failure rate",
    "D35400", C.white, 9, { align: "center", margin: 6 });

  // Right column: STEP-BY-STEP FLOWCHART
  const steps = [
    { title: "POSITION PATIENT", detail: "Lateral decubitus / Sitting / Prone (jack-knife)", col: "155874" },
    { title: "IDENTIFY INTERSPACE", detail: "Intercristal (Tuffier's) line → L4 or L4-L5\nUltrasound if landmarks difficult", col: "1A6680" },
    { title: "ASEPTIC SKIN PREP", detail: "Chlorhexidine + alcohol — must be FULLY DRY before puncture (neurotoxic if wet)", col: "B7950B" },
    { title: "SKIN WHEAL + INTRODUCER", detail: "Subcutaneous LA at selected space\nInsert introducer at 10-15° cephalad", col: "155874" },
    { title: "ADVANCE SPINAL NEEDLE", detail: "Midline: through supraspinous lig. → interspinous lig. → ligamentum flavum → dura\nParamedian: 1-2cm lateral, redirect medially & cephalad", col: "1A6680" },
    { title: "2 POPS FELT", detail: "1st pop = ligamentum flavum\n2nd pop = dura-arachnoid membrane", col: "B7950B" },
    { title: "CONFIRM CSF FLOW", detail: "Remove stylet → free flow of CSF confirms subarachnoid position\n<25G needles may need active aspiration", col: "155874" },
    { title: "INJECT DRUG", detail: "Slow controlled injection\nNote baricity vs. patient position → determines spread\nParesthesia during injection → STOP, withdraw, redirect", col: C.green },
  ];

  let sy = 0.7;
  steps.forEach((step, i) => {
    box(s, 6.1, sy, 7.0, 0.75, `${i+1}. ${step.title}\n${step.detail}`, step.col, C.white, 8, { align: "left", margin: 8, bold: false });
    if (i < steps.length - 1) {
      arrowDown(s, 9.6, sy + 0.75, sy + 0.82, C.gold);
    }
    sy += 0.82;
  });

  // Bottom note
  s.addText("STYLET must fully occlude lumen before insertion (prevents epithelial tracking into CSF)", {
    x: 0.2, y: 7.1, w: 12.9, h: 0.3,
    fontSize: 9, color: C.midGray, align: "center", italic: true, fontFace: "Calibri",
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 4 — DRUGS FLOWCHART
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: C.green } });
  s.addText("DRUGS FOR SPINAL ANAESTHESIA — Selection & Dosing Flowchart", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // Decision box: duration needed
  box(s, 4.65, 0.65, 4.0, 0.55, "HOW LONG IS SURGERY?", C.darkBlue, C.gold, 12, { bold: true, borderColor: C.gold, borderWidth: 1.5 });

  // 3 branches
  const branches = [
    { label: "<60 min\n(Short)", col: "1B6B3A", x: 0.2 },
    { label: "60–120 min\n(Intermediate)", col: "1B5B6B", x: 5.05 },
    { label: ">120 min\n(Long)", col: "6B1B1B", x: 9.9 },
  ];
  branches.forEach(b => {
    box(s, b.x, 1.35, 3.35, 0.55, b.label, b.col, C.white, 10, { bold: true });
  });

  // Arrows from decision to branches
  arrowDown(s, 1.87, 1.2, 1.35, C.gold);
  arrowDown(s, 6.65, 1.2, 1.35, C.gold);
  arrowDown(s, 11.57, 1.2, 1.35, C.gold);

  // Drug boxes under each branch
  const shortDrugs = [
    ["Chloroprocaine\n30–60 mg | 30–60 min", "2ECC71"],
    ["Lidocaine\n50–100 mg | 60–90 min\n⚠ TNS risk (up to 12%)", "E67E22"],
    ["Prilocaine\n40–60 mg | 100–130 min", "27AE60"],
    ["Articaine\n50–80 mg | ~60 min\n(novel, rapid offset)", "2ECC71"],
  ];
  const intDrugs = [
    ["Mepivacaine\n30–80 mg | 90–150 min\n(isobaric = less TNS)", "2980B9"],
    ["Bupivacaine (low dose)\n5–10 mg | 60–120 min", "1A8DBE"],
    ["Levobupivacaine\n5–10 mg | 60–120 min\n(less cardiotoxic)", "2980B9"],
  ];
  const longDrugs = [
    ["Bupivacaine 0.5%\n10–20 mg | 90–225 min\nGold standard for surgery", "922B21"],
    ["Tetracaine\n6–20 mg | 90–180 min\n(with epinephrine prolongs)", "A93226"],
    ["Levobupivacaine\n10–20 mg | 120–240 min\nPreferred in cardiac pts", "922B21"],
  ];

  const drugGroups = [shortDrugs, intDrugs, longDrugs];
  const startX = [0.2, 5.05, 9.9];

  drugGroups.forEach((group, gi) => {
    let dy = 2.05;
    group.forEach(([text, col]) => {
      box(s, startX[gi], dy, 3.35, 0.72, text, col, C.white, 8, { align: "left", margin: 7 });
      dy += 0.78;
    });
  });

  // ADDITIVES section
  box(s, 0.2, 4.45, 12.9, 0.38, "ADDITIVES — Modify Onset, Duration, or Quality", C.darkBlue, C.gold, 11, { bold: true });

  const additives = [
    { name: "Fentanyl\n10–30 mcg", effect: "Faster onset\nProlongs analgesia 4–6h\n(ambulatory surgery)", col: "6C3483" },
    { name: "Sufentanil\n5–10 mcg", effect: "More potent than fentanyl\nUsed in obstetrics\nRapid onset", col: "76448A" },
    { name: "Morphine\n0.1–0.5 mg", effect: "Long postop analgesia\n12–24h\nRisk: delayed resp. depression", col: "5B2C6F" },
    { name: "Epinephrine\n0.1–0.2 mg", effect: "Prolongs tetracaine &\nlidocaine blocks\n(α1 vasoconstriction)", col: "6E2F09" },
    { name: "Clonidine\n15–45 mcg", effect: "Prolongs block\nα2-agonist effect\nMay cause hypotension", col: "1A5276" },
  ];

  let ax = 0.2;
  additives.forEach(a => {
    box(s, ax, 4.9, 2.45, 0.48, a.name, a.col, C.white, 8.5, { bold: true });
    box(s, ax, 5.43, 2.45, 0.72, a.effect, "162C38", C.white, 8, { align: "left", margin: 5 });
    ax += 2.56;
  });

  // BARICITY note
  box(s, 0.2, 6.25, 12.9, 0.72,
    "BARICITY vs POSITION:  Hyperbaric (heavier than CSF sg 1.003-1.008) → settles to dependent side  |  Hypobaric → rises to non-dependent side  |  Isobaric → relatively position independent\nCSF specific gravity = 1.003–1.008 at 37°C  |  Hyperbaric bupivacaine = bupivacaine + 8% glucose",
    "0D2B55", C.midGray, 8.5, { align: "left", margin: 8 });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 5 — COMPLICATIONS: CARDIOVASCULAR + NEUROLOGICAL
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: C.red } });
  s.addText("COMPLICATIONS FLOWCHART (1) — Cardiovascular & Neurological", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // ─── LEFT: CARDIOVASCULAR ─────────────────────────────────────
  box(s, 0.2, 0.62, 6.2, 0.42, "CARDIOVASCULAR COMPLICATIONS", C.red, C.white, 12, { bold: true });

  const cvComps = [
    {
      title: "HYPOTENSION (Most Common)",
      col: "C0392B",
      points: [
        "Definition: >20% drop from baseline SBP or SBP <100 mmHg",
        "Mechanism: Sympathetic block → vasodilation → ↓SVR + ↓venous return",
        "Worsened by: Hypovolaemia, aortocaval compression, upright position",
        "Rx: Phenylephrine 40–120 mcg IV bolus | IV fluids | O2 | LUD",
      ]
    },
    {
      title: "BRADYCARDIA",
      col: "A93226",
      points: [
        "Block of cardioaccelerator fibres T1–T4 (high block)",
        "Bezold-Jarisch reflex: ↓venous return → paradoxical bradycardia",
        "Rx: Atropine | Ephedrine | Epinephrine (if severe)",
      ]
    },
    {
      title: "CARDIAC ARREST (~1:1500)",
      col: "7B241C",
      points: [
        "Many preceded by untreated bradycardia/hypotension",
        "Can occur in young healthy patients",
        "Rx: CPR, epinephrine, vasopressors, treat cause",
        "Prevention: Prompt treatment of bradycardia & hypotension",
      ]
    },
    {
      title: "ANTERIOR SPINAL ARTERY SYNDROME",
      col: "6B2737",
      points: [
        "Prolonged severe hypotension + raised intraspinal pressure",
        "Motor paralysis + spinothalamic loss, posterior columns spared",
        "Rare; largely preventable by maintaining BP",
      ]
    },
  ];

  let cy = 1.1;
  cvComps.forEach(c => {
    box(s, 0.2, cy, 6.2, 0.34, c.title, c.col, C.white, 9, { bold: true, align: "left", margin: 7 });
    c.points.forEach(p => {
      box(s, 0.2, cy + 0.34, 6.2, 0.3, "▸ " + p, "1A2A3A", C.white, 7.5, { align: "left", margin: 7 });
      cy += 0.3;
    });
    cy += 0.44;
  });

  // ─── RIGHT: NEUROLOGICAL ──────────────────────────────────────
  box(s, 6.8, 0.62, 6.3, 0.42, "NEUROLOGICAL COMPLICATIONS", "7D3C98", C.white, 12, { bold: true });

  const neuroComps = [
    {
      title: "HIGH / TOTAL SPINAL",
      col: "7D3C98",
      points: [
        "Excessive cephalad spread → cervical/cranial nerve blockade",
        "Apnoea = medullary hypoperfusion (not just phrenic nerve paralysis)",
        "Sx: dyspnoea, upper limb numbness, nausea, LOC, apnoea",
        "Rx: O2/intubation, vasopressors, fluids, atropine, reassure",
      ]
    },
    {
      title: "TRANSIENT NEUROLOGICAL SYMPTOMS (TNS)",
      col: "6C3483",
      points: [
        "Back pain → legs without neuro deficit; resolves in days",
        "Lidocaine risk: up to 12% | Tetracaine 2% | Bupivacaine 1%",
        "Risk factors: Lithotomy position, outpatient, male sex",
        "Rx: NSAIDs, spontaneous resolution; no permanent sequelae",
      ]
    },
    {
      title: "CAUDA EQUINA SYNDROME",
      col: "5B2C6F",
      points: [
        "Saddle anaesthesia, sphincter dysfunction, leg weakness",
        "Most common: 5% hyperbaric lidocaine via microcatheter",
        "Drug pools at high concentration around cauda equina",
        "Prevention: Avoid hyperbaric lidocaine; use preservative-free drugs",
      ]
    },
    {
      title: "DIRECT NERVE / CORD INJURY",
      col: "4A235A",
      points: [
        "Paresthesia on injection = needle near nerve root → STOP & redirect",
        "Cord ends at L1-L2; avoid insertion above this level",
        "Horner syndrome: ptosis, miosis, anhidrosis (T1–T3 block)",
      ]
    },
  ];

  let ny2 = 1.1;
  neuroComps.forEach(c => {
    box(s, 6.8, ny2, 6.3, 0.34, c.title, c.col, C.white, 9, { bold: true, align: "left", margin: 7 });
    c.points.forEach(p => {
      box(s, 6.8, ny2 + 0.34, 6.3, 0.3, "▸ " + p, "1A2A3A", C.white, 7.5, { align: "left", margin: 7 });
      ny2 += 0.3;
    });
    ny2 += 0.44;
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 6 — COMPLICATIONS: HEADACHE, INFECTION, DRUG TOXICITY, OTHER
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: C.red } });
  s.addText("COMPLICATIONS FLOWCHART (2) — PDPH, Infection, Drug Toxicity & Other", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // PDPH
  box(s, 0.2, 0.62, 6.1, 0.38, "POST-DURAL PUNCTURE HEADACHE (PDPH)", "E67E22", C.white, 11, { bold: true });
  const pdph = [
    ["Mechanism", "CSF leak through dural hole → ↓CSF pressure → traction on pain-sensitive intracranial structures + compensatory venodilation"],
    ["Hallmark", "POSTURAL: worse sitting/standing, relieved by lying flat"],
    ["Features", "Bilateral frontal/occipital, retroorbital, neck pain, photophobia, nausea, diplopia (CN VI), tinnitus"],
    ["Onset", "12–72 hours after dural puncture (may be delayed up to 7 days)"],
    ["Risk factors", "Larger gauge needle, cutting tip, female, young, obstetric, prior PDPH"],
    ["Prevention", "Pencil-point needle 25–26G | bevel parallel to dural fibres (if cutting) | replace stylet before withdrawal"],
    ["Rx (conservative)", "Bed rest, hydration, caffeine (vasoconstrictive), paracetamol, NSAIDs"],
    ["Rx (definitive)", "EPIDURAL BLOOD PATCH (EBP): 15–20 mL autologous blood → seals dural defect. >90% success. Second patch if needed."],
  ];
  let ph = 1.05;
  pdph.forEach(([key, val]) => {
    box(s, 0.2, ph, 1.5, 0.4, key, "7E5109", C.white, 8, { bold: true });
    box(s, 1.72, ph, 4.58, 0.4, val, "1A2A3A", C.white, 7.5, { align: "left", margin: 5 });
    ph += 0.44;
  });

  // INFECTION
  box(s, 6.9, 0.62, 6.2, 0.38, "INFECTION COMPLICATIONS", C.red, C.white, 11, { bold: true });
  const infect = [
    {
      title: "MENINGITIS",
      col: "C0392B",
      points: [
        "Organism: Strep. viridans (oral commensal) → operator droplets",
        "Sx: fever, headache, neck stiffness, photophobia",
        "Prevention: mask + full aseptic technique",
        "Rx: Antibiotics + supportive care",
      ]
    },
    {
      title: "EPIDURAL ABSCESS (Rare: 1:6500–1:500,000)",
      col: "A93226",
      points: [
        "Stage 1: Back pain (percussion tender) → Stage 2: Radicular pain",
        "Stage 3: Motor/sensory deficit or sphincter dysfunction → Stage 4: Paraplegia",
        "Organism: S. aureus, S. epidermidis",
        "Rx: Remove catheter, blood cultures, anti-staph antibiotics, MRI, laminectomy/drainage",
        "Prognosis correlates with neurological deficit at time of diagnosis",
      ]
    },
    {
      title: "ARACHNOIDITIS",
      col: "7B241C",
      points: [
        "Chronic inflammation/fibrosis of arachnoid membrane",
        "Causes: chlorhexidine (if wet), blood, detergents, preservatives in CSF",
        "Prevention: allow chlorhexidine to dry; use preservative-free drugs only",
      ]
    },
  ];

  let iy = 1.05;
  infect.forEach(c => {
    box(s, 6.9, iy, 6.2, 0.34, c.title, c.col, C.white, 8.5, { bold: true, align: "left", margin: 7 });
    c.points.forEach(p => {
      box(s, 6.9, iy + 0.34, 6.2, 0.3, "▸ " + p, "1A2A3A", C.white, 7.5, { align: "left", margin: 7 });
      iy += 0.3;
    });
    iy += 0.44;
  });

  // Bottom 2-column: Urinary retention + Backache + Failed block + Total spinal summary
  box(s, 0.2, 4.55, 6.1, 0.35, "OTHER COMPLICATIONS", "2E4057", C.white, 10, { bold: true });
  const other = [
    ["Urinary retention", "S2-S4 block → loss of voiding reflex | Rx: catheterisation"],
    ["Backache", "Tissue trauma; up to 25-30% also occurs with GA; mild & self-limited | Rx: paracetamol/NSAIDs"],
    ["Subdural injection", "Delayed high block (15-30 min); patchy; no true subarachnoid spread | Rx: supportive (intubation if needed)"],
    ["Failed block", "Needle movement; partial aperture in CSF; nerve root sleeve injection | Rx: re-site needle"],
    ["Haematoma", "Urgent MRI → surgical decompression within 6-8h of neuro deficit"],
  ];
  let oh = 4.95;
  other.forEach(([key, val]) => {
    box(s, 0.2, oh, 1.7, 0.42, key, "34495E", C.white, 8, { bold: true });
    box(s, 1.92, oh, 4.38, 0.42, val, "1A2A3A", C.white, 7.5, { align: "left", margin: 5 });
    oh += 0.46;
  });

  // Drug toxicity summary
  box(s, 6.9, 4.55, 6.2, 0.35, "DRUG TOXICITY", "2C3E50", C.white, 10, { bold: true });
  const tox = [
    ["LAST (systemic LA toxicity)", "CNS: tinnitus, perioral numbness, seizure | CV: hypotension, arrhythmia | Rx: lipid emulsion 20% 1.5 mL/kg IV"],
    ["TNS (Lidocaine)", "Back pain → legs; no deficit; resolves in days; Rx: NSAIDs"],
    ["Wrong route", "Epidural dose intrathecally (10x overdose) → total spinal; Prevention: NR-Fit connectors, double-check"],
    ["Respiratory depression", "Intrathecal opioids (esp. morphine, delayed 6–18h) | Rx: naloxone, monitoring"],
  ];
  let tx = 4.95;
  tox.forEach(([key, val]) => {
    box(s, 6.9, tx, 2.1, 0.42, key, "2C3E50", C.white, 7.5, { bold: true });
    box(s, 9.02, tx, 4.08, 0.42, val, "1A2A3A", C.white, 7.5, { align: "left", margin: 5 });
    tx += 0.46;
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 7 — COMPLICATIONS DECISION TREE: WHAT TO DO WHEN
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: "C0392B" } });
  s.addText("INTRAOPERATIVE COMPLICATIONS — DECISION & TREATMENT TREE", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // Central diamond: COMPLICATION RECOGNISED
  box(s, 4.9, 0.7, 3.5, 0.55, "COMPLICATION RECOGNISED", C.darkBlue, C.gold, 11, { bold: true, borderColor: C.gold, borderWidth: 1.5 });

  // 5 branches below
  const decisions = [
    { q: "SBP drop\n>20%?", action: "HYPOTENSION\n→ Phenylephrine 40–120mcg\n→ IV fluid bolus\n→ O2 supplement\n→ LUD (in pregnancy)", col: C.red, x: 0.15 },
    { q: "Bradycardia\n<50 bpm?", action: "BRADYCARDIA\n→ Atropine 0.5–1mg IV\n→ Ephedrine 5–10mg IV\n→ Epinephrine if arrest", col: "E67E22", x: 2.85 },
    { q: "Apnoea or\nHigh block?", action: "HIGH / TOTAL SPINAL\n→ O2 / bag-mask\n→ Intubate if needed\n→ Vasopressors\n→ Reassure patient", col: "8E44AD", x: 5.55 },
    { q: "Paresthesia\non injection?", action: "NERVE PROXIMITY\n→ STOP injection\n→ Withdraw needle\n→ Redirect & re-site\n→ Do NOT inject!", col: "D35400", x: 8.25 },
    { q: "No CSF\nfree flow?", action: "FAILED PUNCTURE\n→ Withdraw needle\n→ Re-position patient\n→ Re-site at adjacent space\n→ Consider paramedian", col: "2C3E50", x: 10.95 },
  ];

  decisions.forEach(d => {
    // Question box
    box(s, d.x, 1.38, 2.15, 0.52, d.q, "0D2B55", C.midGray, 8.5, { bold: true, borderColor: C.gold, borderWidth: 0.8 });
    // Downward arrow
    arrowDown(s, d.x + 1.075, 1.9, 2.08, C.gold);
    // Action box
    box(s, d.x, 2.08, 2.15, 1.55, d.action, d.col, C.white, 8, { align: "left", margin: 7 });
  });

  // POSTOPERATIVE COMPLICATIONS TREE
  box(s, 0.2, 3.82, 12.9, 0.38, "POSTOPERATIVE COMPLICATIONS — Recognition & Response", "0D2B55", C.gold, 11, { bold: true });

  const postComps = [
    { sx: "Postural headache\n12-72h later", dx: "PDPH", rx: "Conservative (caffeine,\nhydration, analgesia)\nor EBP (15-20 mL blood)\n→ >90% success", col: "D35400" },
    { sx: "Back pain +\nneurological deficit", dx: "HAEMATOMA or\nABSCESS", rx: "URGENT MRI\nNeurosurgical consult\nDecompression <6-8h\nAnti-staph antibiotics", col: C.red },
    { sx: "Back pain →\nlegs (no deficit)", dx: "TNS (Transient\nNeurological Sx)", rx: "NSAIDs\nReassure patient\nResolves in days\nNo permanent injury", col: "27AE60" },
    { sx: "Fever + neck\nstiffness + headache", dx: "MENINGITIS", rx: "Blood + CSF cultures\nAntibiotics (cover Strep.)\nSupportive care\nIC management", col: "8E44AD" },
    { sx: "Unable to\nvoid urine", dx: "URINARY\nRETENTION", rx: "Urinary catheterisation\nMonitor until voiding\nreturns", col: "2980B9" },
  ];

  let px = 0.2;
  postComps.forEach(pc => {
    box(s, px, 4.28, 2.45, 0.52, pc.sx, "1A2A3A", C.midGray, 8, { bold: false });
    arrowDown(s, px + 1.225, 4.8, 4.98, C.gold);
    box(s, px, 4.98, 2.45, 0.42, pc.dx, pc.col, C.white, 8.5, { bold: true });
    arrowDown(s, px + 1.225, 5.4, 5.58, C.gold);
    box(s, px, 5.58, 2.45, 0.98, pc.rx, "0D2B55", C.white, 7.5, { align: "left", margin: 6 });
    px += 2.58;
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 8 — SPECIAL POPULATIONS + INCIDENCE TABLE
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: "2E4057" } });
  s.addText("SPECIAL POPULATIONS | INCIDENCE DATA | MONITORING", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // Special populations
  box(s, 0.2, 0.6, 7.8, 0.38, "SPECIAL POPULATIONS — Modified Approach", C.teal, C.white, 11, { bold: true });

  const pops = [
    ["Spinal Stenosis", "Increased neurological risk; use lower LA dose; benefit vs. risk assessment"],
    ["Previous Spine Surgery", "Unpredictable spread; scar tissue; access may be impossible"],
    ["Multiple Sclerosis", "Prolonged blockade; use lower dose; demyelinated fibres more susceptible"],
    ["Spina Bifida", "Absent ligamentum flavum risk; avoid in severe neural tube defects (tethered cord)"],
    ["Aortic Stenosis", "Rapid SVR drop is dangerous; use intrathecal catheter for incremental dosing"],
    ["Hypovolaemia", "Correct volume deficit first; exaggerated hypotensive response expected"],
    ["Pregnancy", "20-25% lower dose needed; left uterine displacement; phenylephrine preferred over ephedrine"],
    ["Obesity", "20-25% less LA per segment (distended epidural veins, reduced CSF volume)"],
  ];

  let poY = 1.03;
  pops.forEach(([pop, note], i) => {
    box(s, 0.2, poY, 2.3, 0.41, pop, i % 2 === 0 ? "155874" : "0E3D52", C.white, 8, { bold: true });
    box(s, 2.52, poY, 5.48, 0.41, note, "1A2A3A", C.white, 8, { align: "left", margin: 6 });
    poY += 0.46;
  });

  // Right: Incidence table
  box(s, 8.3, 0.6, 4.8, 0.38, "COMPLICATION INCIDENCE (Morgan & Mikhail)", C.red, C.white, 10, { bold: true });
  const incRows = [
    ["Complication", "Spinal (n=40,640)", "Header"],
    ["Cardiac Arrest", "26 cases", "data"],
    ["Death", "6 cases", "data"],
    ["Cauda Equina Syndrome", "5 cases", "data"],
    ["Radiculopathy", "19 cases", "data"],
    ["Seizure", "0 cases", "data"],
    ["Paraplegia", "0 cases", "data"],
  ];
  let ry = 1.03;
  incRows.forEach(([comp, val, type]) => {
    const bg = type === "Header" ? "922B21" : (incRows.indexOf(incRows.find(r => r === [comp, val, type])) % 2 === 0 ? "1A2A3A" : "162C38");
    box(s, 8.3, ry, 3.2, 0.36, comp, type === "Header" ? "922B21" : "1A2A3A", C.white, 8, { align: "left", margin: 6, bold: type === "Header" });
    box(s, 11.52, ry, 1.58, 0.36, val, type === "Header" ? "7B241C" : "1A3A50", type === "Header" ? C.gold : C.white, 8, { bold: type === "Header" });
    ry += 0.4;
  });

  // ASA closed claims note
  box(s, 8.3, 3.9, 4.8, 1.1,
    "ASA CLOSED CLAIMS (1980-1999):\n" +
    "• Spinal = 34% of all regional claims\n" +
    "• Temporary/non-disabling injury: 64%\n" +
    "• Death: 13% | Permanent nerve injury: 10%\n" +
    "• Permanent brain damage: 8%\n" +
    "• Most claims: obstetric patients",
    "2C3E50", C.white, 8.5, { align: "left", margin: 8 });

  // Modified Bromage Scale
  box(s, 0.2, 4.8, 7.8, 0.38, "MODIFIED BROMAGE SCALE (Motor Block Assessment)", "0E3D52", C.gold, 10, { bold: true });
  const bromage = [
    ["Grade 0", "No motor block — full movement of all joints"],
    ["Grade 1", "Cannot raise extended leg; able to move knees and feet"],
    ["Grade 2", "Cannot raise extended leg OR move knee; able to move feet only"],
    ["Grade 3", "Complete lower limb motor block — no movement at all"],
  ];
  let by = 5.22;
  bromage.forEach(([grade, desc], i) => {
    box(s, 0.2, by, 1.3, 0.41, grade, i % 2 === 0 ? C.teal : "0E3D52", C.white, 8.5, { bold: true });
    box(s, 1.52, by, 6.48, 0.41, desc, "1A2A3A", C.white, 8, { align: "left", margin: 6 });
    by += 0.46;
  });

  // Block monitoring note
  box(s, 8.3, 5.1, 4.8, 1.5,
    "SENSORY BLOCK ASSESSMENT ORDER:\n" +
    "1. Cold (C-fibres) — most cephalad spread\n" +
    "2. Pinprick (Aδ-fibres)\n" +
    "3. Touch (Aβ-fibres) — lowest level\n\n" +
    "Adequate block = sensory level 2-3 segments\nABOVE expected surgical stimulus level",
    "0D2B55", C.white, 9, { align: "left", margin: 8 });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 9 — SUMMARY FLOWCHART (everything in one visual)
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.52, fill: { color: C.gold } });
  s.addText("SPINAL ANAESTHESIA — COMPLETE SUMMARY REFERENCE CARD", {
    x: 0.2, y: 0, w: 12.9, h: 0.52,
    fontSize: 16, color: C.navy, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  // TECHNIQUE column
  box(s, 0.15, 0.6, 4.1, 0.38, "TECHNIQUE", C.teal, C.white, 11, { bold: true });
  const techItems = [
    "1. Consent + IV access + monitoring",
    "2. Position: Lateral / Sitting / Prone",
    "3. Identify L3-L4 or L4-L5 interspace",
    "4. Chlorhexidine + alcohol (fully dry)",
    "5. Skin LA wheal + introducer",
    "6. Advance spinal needle (2 pops)",
    "7. Confirm free CSF flow",
    "8. Inject drug (match to surgery duration)",
    "9. Position per baricity",
    "10. Monitor BP every 2 min × 15 min",
    "11. Assess block: cold > pinprick > touch",
    "12. Motor block: Modified Bromage Scale",
  ];
  let ti = 1.03;
  techItems.forEach((t, i) => {
    box(s, 0.15, ti, 4.1, 0.38, t, i % 2 === 0 ? "0D3B5E" : "0A2A4A", C.white, 7.5, { align: "left", margin: 6 });
    ti += 0.42;
  });

  // NEEDLES sub-panel
  box(s, 0.15, 6.1, 4.1, 0.38, "NEEDLES: Pencil-point 25-26G preferred | Quincke (cutting) if only available", "1B4F72", C.white, 7.5, { align: "left", margin: 6 });

  // DRUGS column
  box(s, 4.55, 0.6, 4.2, 0.38, "DRUGS & DOSES", C.green, C.white, 11, { bold: true });
  const drugItems = [
    "SHORT (<60 min): Chloroprocaine 30-60 mg",
    "SHORT: Lidocaine 50-100 mg (⚠ TNS risk)",
    "SHORT: Prilocaine 40-60 mg (safer)",
    "INTERMEDIATE: Mepivacaine 30-80 mg",
    "INTERMEDIATE: Bupivacaine low dose 5-10mg",
    "LONG (>90 min): Bupivacaine 0.5% 10-20 mg",
    "LONG: Tetracaine 6-20 mg (+epi)",
    "LONG: Levobupivacaine 10-20 mg (cardiac)",
    "ADDITIVE: Fentanyl 10-30 mcg (↑duration)",
    "ADDITIVE: Morphine 0.1-0.5 mg (postop pain)",
    "ADDITIVE: Epinephrine 0.1-0.2 mg (↑duration)",
    "BARICITY: Hyper = dependent ↓ | Hypo = up",
  ];
  let di = 1.03;
  drugItems.forEach((d, i) => {
    box(s, 4.55, di, 4.2, 0.38, d, i % 2 === 0 ? "1A5C3A" : "125030", C.white, 7.5, { align: "left", margin: 6 });
    di += 0.42;
  });
  box(s, 4.55, 6.1, 4.2, 0.38, "Use PRESERVATIVE-FREE drugs only intrathecally", "7B7D00", C.white, 7.5, { align: "left", margin: 6 });

  // COMPLICATIONS column
  box(s, 9.05, 0.6, 4.1, 0.38, "COMPLICATIONS & MANAGEMENT", C.red, C.white, 11, { bold: true });
  const compItems = [
    ["Hypotension", "Phenylephrine 40-120mcg + fluids + O2"],
    ["Bradycardia", "Atropine 0.5mg IV / Ephedrine"],
    ["Total Spinal", "Intubate + vasopressors + CPR"],
    ["PDPH", "EBP (15-20mL blood) > conservative Rx"],
    ["TNS", "NSAIDs, self-limiting, no sequelae"],
    ["Cauda Equina", "Prevention only; avoid 5% lido"],
    ["Haematoma", "Urgent MRI → decompression <6-8h"],
    ["Meningitis", "Antibiotics (Strep. viridans = mask!)"],
    ["Epidural Abscess", "4 stages; laminectomy + antibiotics"],
    ["Arachnoiditis", "Prevention: dry chlorhexidine; preserv-free"],
    ["Urinary retention", "Catheterise"],
    ["Backache", "Paracetamol/NSAIDs; exclude haematoma"],
  ];
  let ci = 1.03;
  compItems.forEach(([comp, rx], i) => {
    s.addText([
      { text: comp + ": ", options: { bold: true, color: i % 2 === 0 ? "FF9999" : "FFBBBB" } },
      { text: rx, options: { bold: false, color: C.white } },
    ], {
      x: 9.05, y: ci, w: 4.1, h: 0.38,
      fontSize: 7.5,
      valign: "middle",
      wrap: true,
      fontFace: "Calibri",
      fill: { color: i % 2 === 0 ? "3B1010" : "2E0A0A" },
      margin: 6,
    });
    ci += 0.42;
  });
  box(s, 9.05, 6.1, 4.1, 0.38, "ASRA guidelines: check anticoagulant timing before block", "5D1010", C.white, 7.5, { align: "left", margin: 6 });
}

// ─── WRITE FILE ──────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/spinal-flowchart/Spinal_Anaesthesia_Flowchart.pptx" })
  .then(() => console.log("✅ Done: /home/daytona/workspace/spinal-flowchart/Spinal_Anaesthesia_Flowchart.pptx"))
  .catch(err => { console.error("❌ Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/spinal-flowchart && node spinal_flowchart.js 2>&1

Running Command

ls -lh /home/daytona/workspace/spinal-flowchart/

Your flowchart PPTX is ready! Download it here:

Spinal Anaesthesia Flowchart

Presentation · PPTX


Here's what's inside the 9-slide presentation (all based on Miller's 10e + Morgan & Mikhail 7e):
SlideContent
1Title slide with 3 pillars: Technique, Drugs, Complications
2Master overview flowchart: Pre-procedure → Technique → Post-procedure in 3 columns
3Technique detail: Needle types (Quincke vs. Whitacre vs. Sprotte), gauge selection, step-by-step injection technique with decision points
4Drugs flowchart: Branched by surgery duration (short/intermediate/long) with all agents + doses + additives (fentanyl, morphine, epinephrine, clonidine) + baricity concept
5Complications (1): Cardiovascular (hypotension, bradycardia, cardiac arrest, anterior spinal artery syndrome) + Neurological (high spinal, TNS, cauda equina, Horner, nerve injury)
6Complications (2): PDPH with treatment pathway (conservative → EBP), Infection (meningitis, epidural abscess with 4 stages, arachnoiditis), drug toxicity, urinary retention, backache
7Intraoperative decision tree: "What to do when" for hypotension, bradycardia, high block, paresthesia on injection, failed CSF flow + postoperative complication flowcharts
8Special populations (pregnancy, MS, stenosis, obesity, etc.) + ASA incidence data table + Modified Bromage Scale + sensory block assessment order
9One-page complete reference card: all 3 columns (technique, drugs, complications) side by side

pdf

Running Command

cd /home/daytona/workspace/spinal-flowchart && libreoffice --headless --convert-to pdf Spinal_Anaesthesia_Flowchart.pptx 2>&1

Running Command

libreoffice --headless --convert-to pdf /home/daytona/workspace/spinal-flowchart/Spinal_Anaesthesia_Flowchart.pptx --outdir /home/daytona/workspace/spinal-flowchart/ 2>&1; echo "EXIT: $?"

Running Command

cp /home/daytona/workspace/spinal-flowchart/Spinal_Anaesthesia_Flowchart.pptx /tmp/spinal.pptx && libreoffice --headless --convert-to pdf /tmp/spinal.pptx --outdir /tmp/ 2>&1 && ls -lh /tmp/spinal.pdf

Running Command

cp /tmp/spinal.pdf /home/daytona/workspace/spinal-flowchart/Spinal_Anaesthesia_Flowchart.pdf && ls -lh /home/daytona/workspace/spinal-flowchart/

Here you go! PDF is ready:

Spinal Anaesthesia Flowchart

PDF Document · PDF

All 9 slides converted - technique, drugs, and complications flowcharts included. The PPTX is also still available if you need to edit anything:

Spinal Anaesthesia Flowchart

Presentation · PPTX

nitrous oxide Anaesthesiagas Give me the Everythibg Summarize written in MORGAN MILLER ANAESTHEIAA BOOK

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
I now have comprehensive material from both textbooks. Let me compile the full, organized summary.

Nitrous Oxide (N₂O) — Complete Summary

Miller's Anesthesia (10th Ed.) & Morgan and Mikhail's Clinical Anesthesiology (7th Ed.)


1. HISTORY

  • 1772: Joseph Priestley first produced nitrous oxide.
  • 1800: Humphry Davy noted its analgesic properties.
  • 1844: Gardner Colton and Horace Wells first used N₂O as an anaesthetic for dental extractions in humans.
  • N₂O is the only one of the original three anaesthetic agents (ether, chloroform, N₂O) still in use today.
(Morgan & Mikhail, p. 270)

2. PHYSICAL & CHEMICAL PROPERTIES

PropertyValue
Chemical formulaN₂O (nitrous oxide, "laughing gas")
Physical state at room tempGas (colourless, odourless)
Critical temperature36.5°C (above room temperature)
Cylinder pressure (at 20°C)745 psig (constant until liquid phase exhausted)
MAC104–105% (requires hyperbaric conditions for sole anaesthesia at 1 atm)
Blood/gas partition coefficient0.47 (low solubility = rapid onset and offset)
Oil/gas partition coefficient1.4
Boiling point-88.5°C

Storage

  • Stored as a liquid under pressure in H-cylinders or E-cylinders (hospitals use bulk H-cylinder manifolds with automatic crossover).
  • Because critical temperature (36.5°C) is above room temperature, it remains liquefied at room temperature without refrigeration.
  • The only reliable way to determine residual volume is to weigh the cylinder - pressure gauge remains constant at 745 psig until all liquid is exhausted, only then does pressure fall.
  • The tare weight (TW) - empty weight - is stamped on the shoulder of each cylinder.
  • Energy consumed during liquid-to-gas conversion (latent heat of vaporisation) causes temperature drop during high flow rates: frost can form on the tank and the pressure regulator may freeze.
  • All E-cylinders are fitted with a Wood's metal fusible plug to prevent explosion under high pressure or fire.
(Morgan & Mikhail, Ch. 2; Miller's Ch. 2)

3. MECHANISM OF ACTION

N₂O acts primarily as an NMDA (N-methyl-D-aspartate) receptor antagonist, inhibiting excitatory glutamate neurotransmission. This accounts for both its analgesic and its amnestic properties.
Additional mechanisms include:
  • Activation of opioid receptors (analgesic effect partially reversible by naloxone; animals tolerant to N₂O are cross-tolerant to morphine).
  • Stimulation of sympathoadrenal (catecholamine) release - responsible for many of its cardiovascular effects.
  • Possible activation of GABA receptors.
(Miller's Ch. 18 & 19; Morgan & Mikhail Ch. 8)

4. PHARMACOKINETICS

Uptake and Distribution

Blood/gas partition coefficient = 0.47 - one of the lowest among inhalational agents (xenon is lower at 0.115). This means very little N₂O needs to dissolve in blood to raise blood partial pressure, so the alveolar fraction (FA) rises quickly toward the inspired fraction (FI) - rapid induction and rapid emergence.

Concentration Effect

Because N₂O can be used in very high concentrations (50-70%), its uptake from alveoli causes two important phenomena:
1. Concentration effect: When a large fraction of alveolar gas is being rapidly absorbed (e.g., 50% N₂O), the remaining alveolar gas concentrations are "concentrated" - resulting in a disproportionately higher alveolar concentration compared to what simple absorption would predict. Increasing inspired N₂O from 20% to 80% increases alveolar concentration sixfold (not fourfold), despite the same 50% uptake fraction.
2. Augmented inflow effect (component of concentration effect): Absorbed gas must be replaced by fresh inflow - this additional inflow further increases alveolar concentration.

Second Gas Effect

High-volume absorption of N₂O also concentrates any concurrently administered volatile anaesthetic in the alveolus - theoretically speeding uptake of that agent. However, this effect is probably clinically insignificant in practice.
(Morgan & Mikhail, p. 284-286)

Elimination

  • Almost all N₂O is eliminated by exhalation during emergence.
  • A tiny amount diffuses out through the skin.
  • Biotransformation: <0.01% - metabolised by anaerobic bacteria in the gastrointestinal tract via reductive metabolism.
  • Essentially no hepatic or renal metabolism.

5. MAC AND POTENCY

  • MAC = 104-105% - cannot produce surgical anaesthesia as a sole agent at 1 atmosphere.
  • Hyperbaric conditions (>1 atm) are required to achieve 1.0 MAC with N₂O alone.
  • MAC is additive with other agents: 65% N₂O reduces the MAC of volatile anaesthetics by approximately 50%. For example, 0.5 MAC N₂O (53%) + 0.5 MAC isoflurane (0.6%) = 1.0 MAC anaesthesia.
  • MAC awake for N₂O = 0.61 MAC (63.3%) - much higher than for volatile agents (where MAC awake ~0.3 MAC). At 50% N₂O (0.48 MAC), most adults remain conscious.
  • MAC decreases 6% per decade of age (same as volatile agents).
(Morgan & Mikhail, p. 294-295; Miller's Ch. 19)

6. EFFECTS ON ORGAN SYSTEMS

A. CARDIOVASCULAR

ParameterEffect of N₂O
Blood pressureNo change (N/C)
Heart rateNo change
Cardiac outputNo change
Systemic vascular resistanceNo change
Pulmonary vascular resistance↑ (increases)
Mechanism - dual action:
  • N₂O directly depresses myocardial contractility in vitro.
  • However, in vivo, it stimulates the sympathetic nervous system and catecholamine release - this sympathomimetic effect counteracts the direct myocardial depression, resulting in no net change in BP, CO, or HR in healthy patients.
Clinical implications:
  • In patients with coronary artery disease or severe hypovolaemia, the sympathetic stimulation may be insufficient to offset the direct myocardial depression → unmasked myocardial depression and haemodynamic compromise.
  • Pulmonary vasoconstriction: N₂O constricts pulmonary vascular smooth muscle → increases pulmonary vascular resistance (PVR) and right ventricular end-diastolic pressure. Avoid or use cautiously in pulmonary hypertension or right ventricular dysfunction.
  • Peripheral vascular resistance: not significantly altered despite cutaneous vasoconstriction.
(Morgan & Mikhail, p. 298-299; Miller's Ch. 19)

B. RESPIRATORY

ParameterEffect of N₂O
Tidal volume↓ (mild decrease)
Respiratory rate↑ (compensatory increase)
PaCO₂ at restNo change
PaCO₂ to hypercapnic challenge↑ (blunted ventilatory response)
Bronchomotor toneNo significant effect in healthy individuals
  • N₂O does not significantly interfere with respiratory drive in healthy individuals and has no negative impact on bronchial mucosa or smooth muscle.
  • However, it does blunt the hypercapnic ventilatory response (response to CO₂ challenge ↑).
  • Tidal volume decrease is compensated by respiratory rate increase, so PaCO₂ at rest is unchanged.
  • Right-to-left cardiac shunt (or bronchial intubation) slows the rate of induction with N₂O more than with sevoflurane, because poorly soluble agents are most sensitive to V/Q mismatch.

C. CEREBRAL (CNS)

ParameterEffect of N₂O
Cerebral blood flow (CBF)↑↑
Intracranial pressure (ICP)↑↑ (most significant among all inhalational agents)
Cerebral metabolic rate (CMRO₂) (unique - unlike volatile agents which decrease CMRO₂)
  • N₂O increases CBF, CMRO₂, and ICP - mediated in part by sympathoadrenal stimulation.
  • When N₂O is given alone, very large increases in CBF and ICP occur.
    • Example: In patients with intracranial tumours, breathing 66% N₂O caused mean ICP to rise from 13 to 40 mmHg.
  • When combined with intravenous agents (barbiturates, benzodiazepines, opioids, propofol): its cerebral vasodilatory effect is attenuated or completely abolished.
  • When added to an established volatile anaesthetic: moderate increase in CBF occurs.
  • Clinical rule: N₂O should be avoided or used very cautiously in patients with reduced intracranial compliance (raised ICP, brain tumours). If used, it should be combined with IV anaesthetic agents to blunt its cerebral vasodilatory effects.
(Miller's Ch. 10 - Neurophysiology)

D. NEUROMUSCULAR

  • N₂O provides no significant muscle relaxation.
  • At high concentrations in hyperbaric chambers, N₂O can cause skeletal muscle rigidity.
  • N₂O does NOT trigger malignant hyperthermia.
  • It enhances (potentiates) non-depolarising neuromuscular blockade (↑, though less so than volatile agents).
(Morgan & Mikhail, p. 299)

E. RENAL

ParameterEffect
Renal blood flow↓↓
Glomerular filtration rate (GFR)↓↓
Urinary output↓↓
These reductions are comparable to other inhalational agents and are largely indirect (cardiovascular-mediated).

F. HEPATIC

  • Hepatic blood flow: ↓ (mild reduction, less than volatile agents).
  • No direct hepatotoxicity.
  • No significant hepatic biotransformation.

G. GASTROINTESTINAL / NAUSEA

  • N₂O use in adults increases the risk of postoperative nausea and vomiting (PONV) - presumably via activation of the chemoreceptor trigger zone (CTZ) and vomiting centre in the medulla.
  • This is one of the most clinically relevant and cited reasons for limiting or avoiding N₂O.
  • In children: less evidence that N₂O increases PONV compared to adults.

7. SEDATIVE AND ANALGESIC PROPERTIES (Miller's Ch. 19)

  • N₂O possesses both sedative and analgesic properties.
  • MAC awake for N₂O is 0.61 MAC (63.3%) vs ~0.3 MAC for volatile agents - meaning N₂O produces sedation without unconsciousness across a wider range of concentrations.
  • Analgesic potency: 66-70% N₂O = equivalent analgesia to remifentanil infusion at 0.085-0.17 mcg/kg/min (whole-blood concentration ~2 ng/mL).
  • N₂O analgesia is partially reversed by naloxone - indicating opioid receptor involvement.
  • Acute tolerance develops rapidly - in animals within 6-24 hours; in humans within as little as 40 minutes of continuous administration. This means prolonged use may produce significantly reduced analgesia.
  • Sub-anaesthetic concentrations (below MAC) provide analgesia useful in dental surgery, labour, and traumatic injury.

8. BIOTRANSFORMATION AND TOXICITY

Mechanism of Toxicity: Vitamin B₁₂ and Methionine Synthase

This is the most important toxic mechanism of N₂O:
N₂O irreversibly oxidises the cobalt atom in vitamin B₁₂ (cobalamin), converting it from the reduced (active) to the oxidised (inactive) form. This irreversibly inhibits methionine synthase (also called methionine synthetase), a vitamin B₁₂-dependent enzyme.
Consequences of methionine synthase inhibition:
  1. Methionine synthesis blocked → methionine is required for myelin formation → demyelination (subacute combined degeneration pattern).
  2. Thymidylate synthetase inhibition (also B₁₂ dependent) → impaired DNA synthesis → megaloblastic changes in rapidly dividing cells (bone marrow).
  3. Homocysteine accumulates (the substrate that methionine synthase converts to methionine) → raised plasma homocysteine levels.

Clinical Consequences

ExposureConsequence
Single brief exposureGenerally safe in healthy patients
Prolonged exposure (anesthetic concentrations)Bone marrow depression, megaloblastic anaemia
Very prolonged or repeatedPeripheral neuropathy, subacute combined degeneration of spinal cord
Inborn error of B₁₂ metabolismFatal encephalopathy even after single exposure (reported in 4-month-old infant)

Homocysteine and Cardiovascular Risk

  • N₂O exposure causes a measurable increase in plasma homocysteine (up to 8-fold increase after 8 hours of exposure).
  • Homocysteine is a known biomarker of methionine synthase inhibition and a theoretical cardiovascular risk factor.
  • However, major clinical trials (ENIGMA, ENIGMA-II, POISE) in over 7000+ patients found no increase in rates of myocardial infarction, stroke, pulmonary embolism, or cardiac arrest within 30 days of N₂O anaesthesia.
  • The clinical cardiovascular significance of N₂O-induced homocysteine elevation appears tenuous in most patient populations.

Other Toxic Effects

  • Teratogenicity: Possible teratogenic effects via folate pathway interference. N₂O is often avoided in pregnant patients not yet in the third trimester.
  • Immune function: May impair chemotaxis and motility of polymorphonuclear (PMN) leukocytes - alters immunologic response to infection.
  • Occupational exposure: Chronic exposure in operating room personnel associated with:
    • Spontaneous abortion
    • Peripheral neuropathy (subacute combined degeneration)
    • Bone marrow depression
    • Megaloblastic anaemia
(Morgan & Mikhail, p. 300-301; Miller's Ch. 18)

9. GAS VOLUME EXPANSION - DIFFUSION INTO CLOSED SPACES

This is a critical clinical safety point:
N₂O is 35 times more soluble in blood than nitrogen. Therefore N₂O diffuses into any closed, nitrogen-containing air space far more rapidly than nitrogen can diffuse out. This causes expansion in volume (if walls are compliant) or rise in pressure (if walls are rigid).

Examples:

ConditionConsequence
PneumothoraxExpands - N₂O diffuses in faster than N₂ exits. A 100-mL pneumothorax breathing 50% N₂O expands to ~200 mL
Bowel obstructionBowel gas expands - clinically significant after ~3 hours of N₂O use
Venous/arterial air embolismN₂O diffuses into the air bubble → markedly accentuates haemodynamic effects of even small amounts of air
Intracranial air (pneumocephalus)After dural closure or pneumocephalography → dangerous ICP elevation
Pulmonary air cystsMay rupture
Intraocular air/gas bubblesExpands → raised intraocular pressure. N₂O should be discontinued at least 15 min before intraocular gas injection (SF₆)
Tympanic membrane graftingMiddle ear is a closed space - N₂O diffuses in, may displace the graft
Tracheal tube cuffN₂O diffuses in → increased cuff pressure against tracheal mucosa
(Morgan & Mikhail, p. 301; Miller's Ch. 19)

10. CONTRAINDICATIONS

ContraindicationReason
PneumothoraxExpansion (see above)
Venous/arterial air embolismMarked accentuation
Bowel obstruction with distentionGas expansion
Pneumocephalus (intracranial air)Dangerous ICP rise
Pulmonary air cysts / bullaeRisk of rupture
Intraocular air/gas (e.g., SF₆ bubble)Expansion; raised IOP
Tympanic membrane graftingMiddle ear expansion; graft displacement
Pulmonary hypertension / right heart dysfunctionN₂O raises PVR
Severe coronary artery disease / hypovolaemiaUnmasked myocardial depression
Vitamin B₁₂ deficiencyRapid methionine synthase inhibition → neuropathy
Inborn errors of B₁₂/folate metabolismCatastrophic even from single exposure
First/second trimester pregnancyPossible teratogenicity
Scuba diving history / decompression sickness (DCS)N₂O may cause bubble growth; avoid even at 1 atm
Helium-O₂ atmosphereIsobaric gas counterdiffusion → urticaria and vestibular dysfunction
Patients requiring high FiO₂N₂O displaces oxygen; limits maximum achievable FiO₂

11. DRUG INTERACTIONS

  • Volatile anaesthetics: MAC values are additive. 65% N₂O reduces MAC of volatile agents by ~50%. This allows lower concentrations of the more potent (and potentially more toxic) volatile agents to be used.
  • N₂O attenuates the circulatory and respiratory depression of volatile agents at equivalent MAC.
  • Changing N₂O concentration affects vaporiser output: Decreasing N₂O (increasing O₂) concentration through a vaporiser increases volatile anaesthetic concentration despite a constant vaporiser setting, due to differing solubilities of N₂O and O₂ in liquid volatile anaesthetics.
  • Does not trigger malignant hyperthermia.
  • NMDA antagonism may interact additively with ketamine and other NMDA antagonists.

12. OCCUPATIONAL HAZARDS AND SCAVENGING

  • OSHA maximum acceptable trace concentration: <25 ppm for N₂O (2 ppm for halogenated agents alone).
  • Achieving these concentrations requires:
    • Efficient scavenging equipment (waste anaesthetic gas disposal - WAGD systems).
    • Adequate operating room ventilation.
  • Modern anaesthesia machines require dedicated WAGD vacuum systems.
  • Chronic occupational exposure risks: spontaneous abortion, peripheral neuropathy, bone marrow depression, megaloblastic anaemia.
(Morgan & Mikhail Ch. 45; Miller's Ch. 20)

13. N₂O IN SPECIAL SITUATIONS

Paediatric Anaesthesia (Miller's Ch. 30)

  • N₂O is odourless → useful as an adjuvant at the beginning of inhalational induction in children (before administering volatile agents).
  • MAC has not been accurately determined in children.
  • Does not appear to reduce MAC of sevoflurane (unlike in adults).
  • Less evidence for increased PONV in children compared with adults.

Hyperbaric Conditions (Miller's Ch. 71)

  • Increased ambient pressure allows N₂O to be used at partial pressures exceeding its MAC → can function as a sole anaesthetic in hyperbaric chambers.
  • Induction was rapid (<60 seconds) but accompanied by: tachypnea, tachycardia, hypertension, diaphoresis, muscle rigidity, catatonic jerking, opisthotonus.
  • Never administer N₂O in a helium-O₂ atmosphere - isobaric gas counterdiffusion can cause local inert gas supersaturation (urticaria, vestibular dysfunction) even at normal pressure.
  • During decompression after hyperbaric N₂O: risk of dilutional hypoxia as large volumes of dissolved N₂O enter the lungs. Prevent with O₂-enriched mix before decompression.
  • Avoid N₂O in patients who have recently SCUBA dived or had decompression sickness (DCS) even at 1 atm - may cause bubble growth and neurological symptoms.

Labour Analgesia

  • Sub-MAC concentrations of N₂O provide useful analgesia during labour.
  • Its use for labour pain has declined but is still practised in some centres.
  • 50% N₂O/O₂ (Entonox) is used for procedural analgesia in obstetrics.

Neurosurgery

  • Generally avoid N₂O in patients with intracranial hypertension, pneumocephalus, or poor intracranial compliance.
  • If used alongside IV agents, its cerebral vasodilatory effect is blunted.

14. ADVANTAGES AND DISADVANTAGES SUMMARY

Advantages

  • Rapid onset and offset (low blood/gas coefficient 0.47).
  • Odourless - good for inhalational induction (especially paediatrics).
  • Useful analgesia at sub-MAC doses.
  • MAC-sparing: reduces required dose of more potent volatile agents by ~50%.
  • Haemodynamically stable in healthy patients (maintains CO, BP, HR).
  • Does not trigger malignant hyperthermia.
  • No significant hepatic or renal metabolism.
  • Cost-effective compared to xenon.
  • Quick washout/emergence.

Disadvantages

  • Cannot produce surgical anaesthesia alone at 1 atm (MAC = 104%).
  • Raises ICP and CMRO₂ - unique among modern inhalational agents.
  • Increases pulmonary vascular resistance - avoid in pulmonary hypertension.
  • Inhibits methionine synthase via B₁₂ oxidation → risk of megaloblastic anaemia and neuropathy with prolonged/repeated use.
  • Diffuses into closed gas spaces - dangerous in pneumothorax, air embolism, bowel obstruction, pneumocephalus.
  • Increases PONV risk.
  • Acute tolerance to analgesic effects develops within 40 minutes.
  • Possible teratogen - avoided in early pregnancy.
  • Occupational hazard to theatre staff - requires scavenging.
  • Greenhouse gas and ozone-depleting substance - environmental concern.
  • Cannot be used with high FiO₂ requirements.

QUICK REFERENCE CARD

FeatureNitrous Oxide
MAC104-105%
Blood/gas partition coefficient0.47
Oil/gas partition coefficient1.4
Biotransformation<0.01%
BP / CO / HRNo change (N/C)
PVR↑↑
CBF↑↑
ICP↑↑ (most of any inhalational agent)
CMRO₂↑ (unlike volatile agents)
Muscle relaxationNone
Malignant hyperthermia triggerNo
PONV risk↑ in adults
Key mechanism of toxicityIrreversible B₁₂ oxidation → methionine synthase inhibition
Key contraindicationsClosed gas spaces, pulmonary HTN, raised ICP, B₁₂ deficiency, pregnancy (1st/2nd trimester)

References: Miller's Anesthesia 10e (Chapters 2, 10, 18, 19, 29, 30, 71) | Morgan & Mikhail's Clinical Anesthesiology 7e (Chapters 2, 8, 9)

indication for Nitrous oxide

Based on the extensive content already retrieved from both Miller's and Morgan & Mikhail in our previous session, I can answer this directly without re-querying the library.

Indications for Nitrous Oxide (N₂O)

Miller's Anesthesia 10e | Morgan & Mikhail's Clinical Anesthesiology 7e


1. MAC-SPARING ADJUVANT IN GENERAL ANAESTHESIA

Most common and important indication.
  • N₂O (65%) reduces the MAC of all volatile anaesthetics by approximately 50%.
  • This allows lower doses of more potent volatile agents (sevoflurane, isoflurane, desflurane) to be used, reducing:
    • Cardiovascular depression
    • Dose-dependent toxicity
    • Cost of volatile agent consumption
  • Example: Adding 65% N₂O to isoflurane reduces required isoflurane concentration from 1.2% to ~0.6%.
(Morgan & Mikhail, p. 302)

2. INHALATIONAL INDUCTION (ESPECIALLY PAEDIATRICS)

  • N₂O is odourless - far less pungent than sevoflurane/desflurane.
  • Used as an adjuvant at the start of inhalational induction in children before volatile agents are added, making mask induction more acceptable.
  • Rapid alveolar rise (blood/gas = 0.47) speeds the overall induction process.
  • Also reduces the amount of volatile agent needed to achieve loss of consciousness.
(Miller's Ch. 30)

3. ANALGESIA FOR PROCEDURAL / MINOR PAIN

Sub-anaesthetic concentrations (below MAC) provide useful analgesia without loss of consciousness:
SettingN₂O Concentration Used
Dental procedures30–50%
Minor surgical procedures30–50%
Wound dressings / burn care50%
Labour analgesia (Entonox)50% N₂O / 50% O₂
Trauma / emergency50%
Paediatric procedural sedation50–70%
  • Analgesic potency at 66-70% N₂O equals an IV remifentanil infusion at 0.085-0.17 mcg/kg/min.
  • Useful in settings where IV access is unavailable or undesirable.
  • Entonox (50% N₂O / 50% O₂ premixed) is the classic preparation for self-administered analgesia.
(Miller's Ch. 19; Morgan & Mikhail, p. 299)

4. LABOUR ANALGESIA

  • Inhaled 50% N₂O/O₂ (Entonox) is used in some centres for pain relief during labour.
  • Self-administered via a demand valve between contractions.
  • Provides moderate analgesia with rapid onset and offset.
  • Does not affect uterine tone or neonatal Apgar scores at these concentrations.
  • Use has declined in favour of neuraxial techniques but remains an option in centres without epidural services.
(Morgan & Mikhail, p. 299)

5. HYPERBARIC ANAESTHESIA

  • At elevated atmospheric pressures (>1 atm), the partial pressure of N₂O exceeds its MAC, making sole-agent anaesthesia possible.
  • Has been used in hyperbaric chambers to support anaesthesia (e.g., during therapeutic lung lavage procedures).
  • Allows general anaesthesia without volatile agents in the chamber environment.
(Miller's Ch. 71)

6. SECOND GAS EFFECT - SPEEDING UPTAKE OF VOLATILE AGENTS

  • High-volume absorption of N₂O from alveoli "concentrates" any co-administered volatile anaesthetic in the alveolus (second gas effect) and augments its inflow.
  • Theoretically speeds induction with volatile agents.
  • The clinical significance is debated - Miller's states it is "probably insignificant in clinical practice," but it is still used as a rationale for including N₂O during induction.
(Morgan & Mikhail, p. 286)

7. REDUCING VOLATILE AGENT USE - CLINICAL BENEFITS

When N₂O replaces a portion of volatile agent:
  • Less cardiovascular depression (volatile agents decrease CO and BP; N₂O does not).
  • Less myocardial depression in patients with reduced cardiac reserve.
  • Less dose-dependent respiratory depression from volatile agents.
  • Faster emergence (lower volatile agent concentration = faster washout).

8. EMERGENCE FACILITATION

  • Clinicians often use N₂O at the end of anaesthesia to hasten washout of the volatile agent.
  • N₂O being taken up by the lung dilutes alveolar volatile agent and accelerates its elimination.
  • However: Miller's cautions that even though the sum of MAC values (N₂O + volatile) may exceed MAC awake for the volatile alone, this does not guarantee the patient is unconscious - awareness is possible.
(Miller's Ch. 19)

SUMMARY TABLE OF INDICATIONS

IndicationConcentrationSetting
Adjuvant to volatile agents (MAC sparing)50–70%All general anaesthesia
Inhalational induction aid50–70%Especially paediatrics
Procedural analgesia / sedation30–50%Dental, ED, dressing changes
Labour analgesia (Entonox)50%Obstetrics
Trauma / emergency analgesia50%Pre-hospital / ED
Hyperbaric anaesthesiaVariable (>1 atm)Hyperbaric chamber
Emergence facilitation50–70%End of anaesthesia

IMPORTANT PRACTICAL POINTS

  1. N₂O is never used as a sole anaesthetic at 1 atm because MAC = 104% - always used as part of a balanced technique.
  2. Always maintain at least 30% O₂ when using N₂O (machines have safety interlocks - e.g., the North American Dräger SORC system prevents N₂O exceeding 75%, keeping O₂ ≥ 25%).
  3. Acute analgesic tolerance develops within 40 minutes - prolonged use for analgesia loses effectiveness.
  4. Always weigh indications against contraindications (closed gas spaces, raised ICP, PONV risk, pulmonary hypertension, B₁₂ deficiency, pregnancy <3rd trimester).

References: Miller's Anesthesia 10e (Ch. 19) | Morgan & Mikhail's Clinical Anesthesiology 7e (Ch. 8)

summarize in flow diagram

Running Command

ls /home/daytona/workspace/spinal-flowchart/ && node --version

Writing File

~/spinal-flowchart/n2o_indications.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"

// ─── PALETTE ─────────────────────────────────────────────────────────────
const C = {
  navy:      "0A1628",
  darkBlue:  "0D2B55",
  teal:      "0B6E7A",
  tealLight: "12919F",
  green:     "1B7A4A",
  greenLight:"22A05E",
  amber:     "B7600A",
  amberLight:"E07B12",
  purple:    "5B2C6F",
  purpleLight:"7D3C98",
  red:       "922B21",
  gold:      "D4AC0D",
  white:     "FFFFFF",
  lightGray: "D5D8DC",
  midGray:   "99A3A4",
  cream:     "FDFEFE",
  charcoal:  "1C2833",
};

// helpers
function box(s, x, y, w, h, text, bg, fg, fs, opts={}) {
  s.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: bg },
    line: { color: opts.border || bg, width: opts.bw || 0 },
    rectRadius: opts.r !== undefined ? opts.r : 0.09,
    shadow: opts.shadow ? { type:"outer", color:"000000", blur:5, offset:2, angle:45, opacity:0.28 } : undefined,
  });
  s.addText(text, {
    x, y, w, h,
    fontSize: fs || 9.5,
    color: fg || C.white,
    bold: opts.bold || false,
    align: opts.align || "center",
    valign: opts.valign || "middle",
    wrap: true,
    margin: opts.margin !== undefined ? opts.margin : 4,
    fontFace: "Calibri",
    italic: opts.italic || false,
  });
}

function arrowD(s, x, y1, y2, col) {
  s.addShape(pres.ShapeType.line, {
    x, y: y1, w: 0, h: y2 - y1,
    line: { color: col || C.gold, width: 1.8, endArrowType: "arrow" },
  });
}
function arrowR(s, x1, x2, y, col) {
  s.addShape(pres.ShapeType.line, {
    x: x1, y, w: x2 - x1, h: 0,
    line: { color: col || C.gold, width: 1.8, endArrowType: "arrow" },
  });
}
function line(s, x1, y1, x2, y2, col, w) {
  s.addShape(pres.ShapeType.line, {
    x: x1, y: y1, w: x2-x1, h: y2-y1,
    line: { color: col || C.gold, width: w || 1.5 },
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{ color:C.navy } });
  // left accent
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.45, h:7.5, fill:{ color:C.teal } });
  s.addShape(pres.ShapeType.rect, { x:0.45, y:0, w:0.1, h:7.5, fill:{ color:C.gold } });
  // right accent
  s.addShape(pres.ShapeType.rect, { x:12.75, y:0, w:0.45, h:7.5, fill:{ color:C.teal } });
  s.addShape(pres.ShapeType.rect, { x:12.75, y:0, w:0.1, h:7.5, fill:{ color:C.gold } });

  s.addText("NITROUS OXIDE (N₂O)", {
    x:1, y:1.5, w:11.3, h:1.1,
    fontSize:50, color:C.white, bold:true, align:"center",
    fontFace:"Calibri", charSpacing:4,
  });
  s.addText("Indications — Complete Flow Diagram", {
    x:1, y:2.75, w:11.3, h:0.65,
    fontSize:24, color:C.tealLight, align:"center", fontFace:"Calibri",
  });
  // horizontal rule
  s.addShape(pres.ShapeType.line, { x:1.5, y:3.55, w:10.3, h:0, line:{ color:C.gold, width:1.5 } });

  // 4 property pills
  const pills = [
    { t:"MAC = 104-105%", c:C.teal },
    { t:"Blood/Gas = 0.47", c:C.green },
    { t:"Odourless Gas", c:C.amber },
    { t:"NMDA Antagonist", c:C.purple },
  ];
  let px = 1.2;
  pills.forEach(p => {
    box(s, px, 3.75, 2.6, 0.52, p.t, p.c, C.white, 13, { bold:true, r:0.26 });
    px += 2.75;
  });

  s.addText("Reference: Miller's Anesthesia 10e  |  Morgan & Mikhail's Clinical Anesthesiology 7e", {
    x:1, y:6.7, w:11.3, h:0.4,
    fontSize:12, color:C.midGray, align:"center", fontFace:"Calibri",
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 2 — MASTER INDICATIONS FLOWCHART
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{ color:C.navy } });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.5, fill:{ color:C.teal } });
  s.addText("NITROUS OXIDE — INDICATIONS MASTER FLOWCHART", {
    x:0.2, y:0, w:12.9, h:0.5,
    fontSize:16, color:C.white, bold:true, align:"center", valign:"middle", fontFace:"Calibri",
  });

  // Central source node
  box(s, 4.65, 0.62, 4.0, 0.62, "N₂O INDICATED?", C.darkBlue, C.gold, 14,
    { bold:true, border:C.gold, bw:2, shadow:true });

  // Decision diamond visual hint
  arrowD(s, 6.65, 1.24, 1.65, C.gold);

  // Central hub box
  box(s, 4.4, 1.65, 4.5, 0.58,
    "DETERMINE CLINICAL SCENARIO", C.teal, C.white, 11,
    { bold:true, shadow:true });

  // 7 branch arrows from hub centre (x=6.65)
  // We fan out: left-3, centre, right-3
  const branchY = 2.36; // top of branch boxes

  // Branch positions (x centres): 0.65, 2.3, 3.95, 5.6, 7.25, 8.9, 10.55
  // widths 1.55 each
  const branches = [
    { x:0.15, label:"① GENERAL\nANAESTHESIA\n(MAC Sparing)", col:C.teal },
    { x:1.95, label:"② INHALATIONAL\nINDUCTION", col:C.tealLight },
    { x:3.75, label:"③ PROCEDURAL\nANALGESIA", col:C.green },
    { x:5.55, label:"④ LABOUR\nANALGESIA", col:C.greenLight },
    { x:7.35, label:"⑤ EMERGENCE\nFACILITATION", col:C.amber },
    { x:9.15, label:"⑥ PAEDIATRIC\nSEDATION", col:C.amberLight },
    { x:10.95, label:"⑦ HYPERBARIC\nANAESTHESIA", col:C.purple },
  ];

  // Draw spokes from hub
  const hubCx = 6.65;
  const hubY  = 2.23; // bottom of hub
  branches.forEach(b => {
    const bCx = b.x + 0.95;
    line(s, hubCx, hubY, bCx, branchY - 0.02, C.gold, 1.6);
    s.addShape(pres.ShapeType.line, {
      x: bCx - 0.001, y: branchY - 0.14, w: 0, h: 0.14,
      line: { color: C.gold, width: 1.6, endArrowType: "arrow" },
    });
  });

  // Branch header boxes
  branches.forEach(b => {
    box(s, b.x, branchY, 1.9, 0.72, b.label, b.col, C.white, 8.5,
      { bold:true, shadow:true });
  });

  // Detail boxes under each branch
  const details = [
    // ① General Anaesthesia
    [
      "65% N₂O reduces\nvolatile MAC by ~50%",
      "↓ cardiovascular\ndepression from volatiles",
      "↓ cost of volatile agent",
      "Always with ≥30% O₂",
    ],
    // ② Inhalational Induction
    [
      "Odourless → better\nmask acceptance",
      "Speeds alveolar rise\n(blood/gas = 0.47)",
      "Especially useful\nin paediatrics",
      "Given before volatile\nagent is introduced",
    ],
    // ③ Procedural Analgesia
    [
      "30–50% for dental,\nwound care, ED",
      "50% Entonox\nfor trauma/burns",
      "66–70% = equivalent\nto remifentanil 2ng/mL",
      "No IV access needed;\nrapid offset",
    ],
    // ④ Labour Analgesia
    [
      "50% N₂O / 50% O₂\n(Entonox)",
      "Self-administered via\ndemand valve",
      "No effect on uterine\ntone or Apgar scores",
      "Where epidural\nnot available",
    ],
    // ⑤ Emergence Facilitation
    [
      "Given at end of case to\nwash out volatile agent",
      "Dilutes alveolar volatile\n→ faster elimination",
      "⚠ Does NOT guarantee\nconsciousness (awareness risk)",
      "Use with care; limit\nto brief period",
    ],
    // ⑥ Paediatric Sedation
    [
      "50–70% for short\nprocedures (ED, dental)",
      "Odourless → less\nanxiety during induction",
      "Self-limiting sedation;\nrapid recovery",
      "Less PONV increase\nin children than adults",
    ],
    // ⑦ Hyperbaric
    [
      "At >1 atm partial\npressure exceeds MAC",
      "Sole anaesthetic possible\nin hyperbaric chamber",
      "Rapid induction (<60s)\nbut muscle rigidity risk",
      "NEVER use in\nHe-O₂ atmosphere",
    ],
  ];

  const detailBgs = [
    ["0D3B5E","0A2A4A","0D3B5E","0A2A4A"],
    ["1A5C6A","124050","1A5C6A","124050"],
    ["1A5C3A","125030","1A5C3A","125030"],
    ["1B6B40","125030","1B6B40","125030"],
    ["7E5109","6B430A","7E5109","6B430A"],
    ["9C5A10","7E4A0C","9C5A10","7E4A0C"],
    ["4A235A","3B1A4A","4A235A","3B1A4A"],
  ];

  let dy = branchY + 0.72 + 0.06;
  details.forEach((group, gi) => {
    group.forEach((txt, ti) => {
      box(s, branches[gi].x, dy + ti * 0.75, 1.9, 0.7, txt,
        detailBgs[gi][ti], C.white, 7.5,
        { align:"left", margin:6 });
    });
  });

  // Bottom safety bar
  box(s, 0.15, 7.08, 12.9, 0.35,
    "⚠  Safety: Always maintain O₂ ≥ 30%  |  Check for contraindications before use  |  Acute analgesic tolerance develops within ~40 minutes",
    C.red, C.white, 9, { align:"center", margin:4, r:0.05 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 3 — INDICATION vs CONTRAINDICATION DECISION TREE
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{ color:C.navy } });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.5, fill:{ color:C.teal } });
  s.addText("N₂O — CLINICAL DECISION TREE: When to USE vs When to AVOID", {
    x:0.2, y:0, w:12.9, h:0.5,
    fontSize:16, color:C.white, bold:true, align:"center", valign:"middle", fontFace:"Calibri",
  });

  // Top decision box
  box(s, 4.65, 0.62, 4.0, 0.6, "CONSIDER N₂O FOR PATIENT?",
    C.darkBlue, C.gold, 12, { bold:true, border:C.gold, bw:2 });

  arrowD(s, 6.65, 1.22, 1.62, C.gold);

  // Screening question box
  box(s, 3.9, 1.62, 5.5, 0.58,
    "Screen for Contraindications First", C.charcoal, C.lightGray, 11,
    { bold:true, border:C.gold, bw:1 });

  // YES branch (left) and NO branch (right)
  // left: contraindication present → AVOID
  // right: no contraindication → USE

  // line left
  line(s, 3.9, 1.91, 2.1, 1.91, C.red, 1.8);
  arrowD(s, 2.1, 1.91, 2.52, C.red);
  s.addText("CONTRAINDICATION\nPRESENT", {
    x:0.2, y:1.72, w:1.65, h:0.4,
    fontSize:8, color:C.red, bold:true, align:"center", fontFace:"Calibri",
  });

  // line right
  line(s, 9.4, 1.91, 11.2, 1.91, C.greenLight, 1.8);
  arrowD(s, 11.2, 1.91, 2.52, C.greenLight);
  s.addText("NO CONTRAINDICATION\nIDENTIFIED", {
    x:11.25, y:1.72, w:1.85, h:0.4,
    fontSize:8, color:C.greenLight, bold:true, align:"center", fontFace:"Calibri",
  });

  // AVOID box (left)
  box(s, 0.15, 2.52, 5.7, 0.45, "❌  DO NOT USE N₂O", C.red, C.white, 12, { bold:true });

  // USE box (right)
  box(s, 7.45, 2.52, 5.7, 0.45, "✅  N₂O APPROPRIATE", C.green, C.white, 12, { bold:true });

  // Contraindications list (left column)
  const contras = [
    ["Pneumothorax", "Expands to double volume (35× more soluble than N₂)"],
    ["Venous/Arterial Air Embolism", "N₂O diffuses into bubble → haemodynamic collapse"],
    ["Bowel Obstruction / Distention", "Bowel gas expansion (significant after >3h)"],
    ["Pneumocephalus / Intracranial Air", "ICP surge → life-threatening after dural closure"],
    ["Pulmonary Air Cysts / Bullae", "Risk of rupture"],
    ["Intraocular Gas (SF₆ / Air)", "Expansion → raised IOP; stop N₂O ≥15 min before injection"],
    ["Tympanic Membrane Graft", "Middle ear expansion → graft displacement"],
    ["Pulmonary Hypertension / RV Failure", "N₂O ↑ PVR and RV afterload"],
    ["Raised ICP (sole agent)", "N₂O alone → very large ↑ CBF & ICP"],
    ["Vitamin B₁₂ Deficiency", "Even single exposure → neuropathy / subacute combined degeneration"],
    ["Pregnancy (1st / 2nd trimester)", "Possible teratogenicity via methionine synthase inhibition"],
    ["Decompression Sickness / Recent SCUBA", "Risk of bubble growth and neurological relapse"],
    ["High FiO₂ Requirement", "N₂O displaces O₂; cannot achieve high FiO₂"],
  ];

  let cy = 3.1;
  contras.forEach(([cond, reason], i) => {
    box(s, 0.15, cy, 2.3, 0.37, cond, i%2===0 ? "5D0A0A":"4A0808", C.white, 7.5, { bold:true, align:"left", margin:5 });
    box(s, 2.47, cy, 3.38, 0.37, reason, i%2===0 ? "1A0808":"140606", C.white, 7, { align:"left", margin:5 });
    cy += 0.4;
  });

  // Indications list (right column)
  const indics = [
    { title:"MAC Sparing in GA", detail:"65% N₂O → ↓ volatile MAC by ~50%\nMaintain O₂ ≥30%", col:"0B6E4A" },
    { title:"Inhalational Induction", detail:"Odourless; speeds alveolar rise; better mask acceptance\n(especially paediatrics)", col:"0B6E7A" },
    { title:"Procedural Analgesia", detail:"30–50%: dental, wound care, burns, ED\n66–70% = remifentanil 2 ng/mL equivalent", col:"B7600A" },
    { title:"Labour Analgesia (Entonox)", detail:"50% N₂O / 50% O₂; self-administered;\nno uterine or neonatal effects", col:"1B7A4A" },
    { title:"Emergence Facilitation", detail:"End of case: hasten volatile washout\n⚠ Risk of awareness; use briefly", col:"6B430A" },
    { title:"Paediatric Sedation", detail:"50–70%; odourless → less anxiety;\nless PONV in children than adults", col:"5B2C6F" },
    { title:"Hyperbaric Anaesthesia", detail:"At >1 atm: can exceed MAC\nNEVER in He-O₂ environment", col:"2E4057" },
  ];

  let iy = 3.1;
  indics.forEach(({ title, detail, col }) => {
    box(s, 7.45, iy, 2.0, 0.72, title, col, C.white, 8.5, { bold:true, align:"left", margin:6 });
    box(s, 9.47, iy, 3.68, 0.72, detail, "0D1F2E", C.white, 7.5, { align:"left", margin:6 });
    iy += 0.78;
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 4 — DETAILED INDICATIONS DEEP DIVE (properties + clinical use)
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{ color:C.navy } });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.5, fill:{ color:C.green } });
  s.addText("N₂O — WHY IT WORKS: Physical Properties → Clinical Indications", {
    x:0.2, y:0, w:12.9, h:0.5,
    fontSize:16, color:C.white, bold:true, align:"center", valign:"middle", fontFace:"Calibri",
  });

  // Properties → Indications cascade
  const cascade = [
    {
      prop: "LOW BLOOD/GAS\nCOEFFICIENT (0.47)",
      propCol: C.teal,
      arrow: "→",
      ind: "Rapid Induction & Rapid Emergence",
      indDetail: "FA rises quickly toward FI\nAmong fastest of all inhalation agents (only Xenon faster at 0.115)\nIdeal for short procedures / ambulatory anaesthesia",
      indCol: "0D3B5E",
    },
    {
      prop: "MAC = 104%\n(Cannot sole anaesthetise\nat 1 atm)",
      propCol: C.amber,
      ind: "Always used as ADJUVANT\n(MAC-sparing combination)",
      indDetail: "65% N₂O reduces volatile MAC by ~50%\nAllows lower sevoflurane / isoflurane / desflurane → less side effects\nMAC values are additive (0.5 MAC N₂O + 0.5 MAC iso = 1.0 MAC)",
      indCol: "6B430A",
    },
    {
      prop: "NMDA ANTAGONIST\n+ Opioid receptor activation",
      propCol: C.green,
      ind: "Analgesic Indications\n(sub-anaesthetic doses)",
      indDetail: "30-70% provides analgesia without LOC\nDental, obstetric (Entonox), trauma, burn dressings\n66-70% = remifentanil 0.085–0.17 mcg/kg/min equivalent\nAnalgesic effect partially reversible by naloxone",
      indCol: "1B5C3A",
    },
    {
      prop: "SYMPATHOADRENAL\nSTIMULATION\n(catecholamine release)",
      propCol: C.purple,
      ind: "Haemodynamically Stable\n→ Suitable in cardiac patients",
      indDetail: "BP, CO, HR = No change in healthy patients\nCounteracts direct myocardial depression (in vitro)\n⚠ Unmasked depression in severe CAD or hypovolaemia\n⚠ ↑ PVR → avoid in pulmonary hypertension",
      indCol: "4A235A",
    },
    {
      prop: "ODOURLESS",
      propCol: "2E4057",
      ind: "Paediatric Induction\n+ Anxious Patients",
      indDetail: "No pungent smell → better mask acceptance than sevoflurane/desflurane\nUsed as first agent before volatile is introduced\nHigher patient acceptance during inhalational induction",
      indCol: "1A2A3A",
    },
    {
      prop: "35× MORE SOLUBLE\nTHAN N₂ IN BLOOD\n(but 0.47 blood/gas)",
      propCol: C.red,
      ind: "⚠ CONTRAINDICATION in\nClosed Air Spaces\n(NOT an indication — BEWARE)",
      indDetail: "Diffuses into pneumothorax, bowel, pneumocephalus, air emboli\nVolume doubles if walls compliant; pressure rises if walls rigid\nTympanic graft, intraocular gas, tracheal cuff expansion",
      indCol: "5D0A0A",
    },
  ];

  let cy = 0.62;
  cascade.forEach((row, i) => {
    // Property box
    box(s, 0.15, cy, 2.85, 0.9, row.prop, row.propCol, C.white, 9, { bold:true, shadow:true });
    // Arrow
    s.addText("➤", {
      x:3.05, y:cy+0.25, w:0.5, h:0.4,
      fontSize:20, color:C.gold, align:"center", valign:"middle", fontFace:"Calibri",
    });
    // Indication header
    box(s, 3.6, cy, 3.2, 0.9, row.ind, row.indCol, C.white, 9, { bold:true, border:C.gold, bw:0.8 });
    // Indication detail
    box(s, 6.85, cy, 6.3, 0.9, row.indDetail, "0D1F2E", C.white, 8, { align:"left", margin:7 });
    cy += 1.0;
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 5 — CONCENTRATION & DOSING GUIDE PER INDICATION
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{ color:C.navy } });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.5, fill:{ color:C.amber } });
  s.addText("N₂O — CONCENTRATION & DOSING GUIDE BY INDICATION", {
    x:0.2, y:0, w:12.9, h:0.5,
    fontSize:16, color:C.white, bold:true, align:"center", valign:"middle", fontFace:"Calibri",
  });

  // Concentration scale bar at top
  const scaleX = 0.5, scaleY = 0.62, scaleW = 12.3, scaleH = 0.45;
  // gradient segments: 0% → 30% → 50% → 70% → 100%
  const segs = [
    { label:"0–30%\nSub-analgesic", col:"1A3A2A", w:3.5 },
    { label:"30–50%\nAnalgesia Zone", col:"1B7A4A", w:3.0 },
    { label:"50–70%\nSedation/Analgesia", col:"B7600A", w:3.0 },
    { label:"70–100%\nHyperbaric Only", col:"922B21", w:2.8 },
  ];
  let sx = scaleX;
  segs.forEach(seg => {
    box(s, sx, scaleY, seg.w, scaleH, seg.label, seg.col, C.white, 8, { bold:false, r:0.04 });
    sx += seg.w;
  });

  // Tick + label: minimum O₂ line
  s.addShape(pres.ShapeType.line, {
    x: scaleX + scaleW * 0.7, y: scaleY - 0.02, w: 0, h: scaleH + 0.04,
    line: { color: C.gold, width: 2 },
  });
  s.addText("Max 70% N₂O\n(Min 30% O₂)", {
    x: scaleX + scaleW * 0.7 - 0.5, y: scaleY - 0.38, w: 2.0, h: 0.35,
    fontSize: 8, color: C.gold, align: "center", bold: true, fontFace: "Calibri",
  });

  // Cards for each indication
  const cards = [
    {
      title: "① GA — MAC Sparing",
      conc: "50–70%",
      bar: 0.62,
      col: C.teal,
      points: [
        "Most common use of N₂O",
        "Used with volatile agents (sevo, iso, des)",
        "65% N₂O → ↓ volatile MAC by ~50%",
        "Maintain O₂ ≥30% at all times",
        "Machine SORC prevents >75% N₂O",
        "MAC values are additive",
      ]
    },
    {
      title: "② Inhalational Induction",
      conc: "50–70%",
      bar: 0.62,
      col: C.tealLight,
      points: [
        "Given first — before volatile agent",
        "Odourless: better mask acceptance",
        "Low blood/gas = very rapid alveolar rise",
        "Paediatrics: standard in many centres",
        "Reduces volatile concentration needed",
        "Transition to volatile once airway secured",
      ]
    },
    {
      title: "③ Procedural Analgesia",
      conc: "30–50%",
      bar: 0.35,
      col: C.green,
      points: [
        "Dental surgery, wound dressing changes",
        "Burns, minor ED procedures",
        "Trauma pain relief (Entonox 50%)",
        "Self-administered via demand valve",
        "No IV access required",
        "⚠ Tolerance within ~40 min",
      ]
    },
    {
      title: "④ Labour Analgesia",
      conc: "50%",
      bar: 0.48,
      col: C.greenLight,
      points: [
        "Entonox: 50% N₂O / 50% O₂",
        "Breathed during contractions",
        "Self-administered demand valve",
        "No uterine tone alteration",
        "No neonatal Apgar score effect",
        "Where epidural unavailable",
      ]
    },
    {
      title: "⑤ Emergence",
      conc: "50–70%",
      bar: 0.62,
      col: C.amber,
      points: [
        "Given at case end to hasten washout",
        "Dilutes alveolar volatile → faster elimination",
        "Diffusion hypoxia risk on discontinuation",
        "Give 100% O₂ at the very end",
        "⚠ Awareness risk: MAC awake N₂O = 63%",
        "Limit to brief period only",
      ]
    },
    {
      title: "⑥ Paediatric Sedation",
      conc: "50–70%",
      bar: 0.62,
      col: C.amberLight,
      points: [
        "ED procedures, dental extractions",
        "Odourless → less anxiety, better compliance",
        "Rapid onset and offset",
        "Less PONV in children vs. adults",
        "Does not trigger malignant hyperthermia",
        "MAC not fully established in children",
      ]
    },
    {
      title: "⑦ Hyperbaric",
      conc: ">100% effective\nat >1 atm",
      bar: 0.95,
      col: C.purple,
      points: [
        "Hyperbaric chamber only",
        "Partial pressure exceeds MAC at >1 atm",
        "Sole agent anaesthesia possible",
        "Rapid induction <60 sec",
        "Risk: muscle rigidity, opisthotonus",
        "NEVER in He-O₂ atmosphere",
      ]
    },
  ];

  const cardW = 1.82;
  const cardX0 = 0.18;
  let cx = cardX0;
  cards.forEach(c => {
    box(s, cx, 1.25, cardW, 0.45, c.title, c.col, C.white, 8, { bold:true });
    box(s, cx, 1.73, cardW, 0.32, `Concentration: ${c.conc}`, "1A2A3A", C.gold, 8, { bold:true });
    c.points.forEach((pt, pi) => {
      box(s, cx, 2.08 + pi*0.78, cardW, 0.73, "• " + pt,
        pi%2===0 ? "0D1F2E" : "0A1520", C.white, 7.5, { align:"left", margin:5 });
    });
    cx += cardW + 0.08;
  });

  // Diffusion hypoxia warning footer
  box(s, 0.18, 7.1, 12.9, 0.32,
    "⚠  DIFFUSION HYPOXIA (Fink Effect): On discontinuing N₂O, rapid outpouring of N₂O from blood into alveoli dilutes O₂ → hypoxia. Prevention: give 100% O₂ for 5–10 min at end of anaesthesia.",
    "5D0A0A", C.white, 8.5, { align:"center", r:0.04 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 6 — ONE-PAGE SUMMARY REFERENCE CARD
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{ color:C.navy } });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.5, fill:{ color:C.gold } });
  s.addText("NITROUS OXIDE — COMPLETE SUMMARY REFERENCE CARD", {
    x:0.2, y:0, w:12.9, h:0.5,
    fontSize:16, color:C.navy, bold:true, align:"center", valign:"middle", fontFace:"Calibri",
  });

  // Left column: KEY PROPERTIES
  box(s, 0.15, 0.58, 4.0, 0.38, "KEY PROPERTIES", C.teal, C.white, 11, { bold:true });
  const props = [
    "MAC = 104–105% (hyperbaric to sole-anaesthetise)",
    "Blood/gas coefficient = 0.47 (rapid onset/offset)",
    "Oil/gas coefficient = 1.4",
    "Biotransformation <0.01% (GI anaerobic bacteria)",
    "Mechanism: NMDA antagonist + opioid activation",
    "Sympathoadrenal stimulation → maintains CO/BP/HR",
    "Analgesic: 66–70% = remifentanil 2 ng/mL equiv.",
    "MAC awake = 63% (vs ~30% for volatile agents)",
    "Acute analgesic tolerance: within 40 min",
    "Odourless, colourless gas; stored as liquid 745 psig",
  ];
  props.forEach((p, i) => {
    box(s, 0.15, 1.0 + i*0.57, 4.0, 0.52, p,
      i%2===0 ? "0D3B5E":"0A2A4A", C.white, 7.5, { align:"left", margin:6 });
  });

  // Middle column: INDICATIONS
  box(s, 4.45, 0.58, 4.4, 0.38, "INDICATIONS (with dose)", C.green, C.white, 11, { bold:true });
  const inds = [
    ["GA MAC Sparing (most common)", "50–70% with volatile agent"],
    ["Inhalational induction", "50–70%; given before volatile"],
    ["Procedural analgesia", "30–50% (dental, wound, ED)"],
    ["Labour analgesia (Entonox)", "50% self-administered"],
    ["Emergence facilitation", "50–70%; brief use only"],
    ["Paediatric sedation", "50–70%; odourless advantage"],
    ["Hyperbaric anaesthesia", ">1 atm; sole agent possible"],
    ["Sub-anaesthetic analgesia", "30–50%; trauma, burns"],
    ["Second gas effect", "Speeds co-agent uptake"],
    ["Reduces volatile side-effects", "Lower CO/BP depression"],
  ];
  inds.forEach(([ind, dose], i) => {
    s.addText([
      { text: ind + " — ", options:{ bold:true, color:"88DDAA" } },
      { text: dose, options:{ bold:false, color:C.white } },
    ], {
      x:4.45, y:1.0 + i*0.57, w:4.4, h:0.52,
      fontSize:7.5, valign:"middle", wrap:true, fontFace:"Calibri",
      fill:{ color: i%2===0 ? "1A5C3A":"125030" }, margin:6,
    });
  });

  // Right column: CONTRAINDICATIONS
  box(s, 9.15, 0.58, 3.98, 0.38, "CONTRAINDICATIONS", C.red, C.white, 11, { bold:true });
  const cons = [
    "Pneumothorax / pulmonary bullae",
    "Venous or arterial air embolism",
    "Bowel obstruction (>3h use)",
    "Pneumocephalus / intracranial air",
    "Intraocular gas bubble (SF₆)",
    "Tympanic membrane graft",
    "Pulmonary hypertension / RV failure",
    "Raised ICP (sole agent use)",
    "Vitamin B₁₂ deficiency / inborn error",
    "Pregnancy (1st / 2nd trimester)",
    "Recent SCUBA / DCS",
    "High FiO₂ requirement",
    "Helium-O₂ atmosphere (hyperbaric)",
  ];
  cons.forEach((c, i) => {
    box(s, 9.15, 1.0 + i*0.47, 3.98, 0.42, "✖ " + c,
      i%2===0 ? "5D0A0A":"4A0808", C.white, 7.5, { align:"left", margin:6 });
  });

  // Bottom bar
  box(s, 0.15, 7.1, 12.9, 0.32,
    "Miller's Anesthesia 10e (Ch. 2, 10, 18, 19, 29, 30, 71)  |  Morgan & Mikhail's Clinical Anesthesiology 7e (Ch. 2, 8, 9)",
    "0D2B55", C.midGray, 8.5, { align:"center", r:0.04, italic:true });
}

// WRITE
pres.writeFile({ fileName: "/home/daytona/workspace/spinal-flowchart/N2O_Indications_Flowchart.pptx" })
  .then(() => console.log("✅ Done"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/spinal-flowchart && node n2o_indications.js 2>&1

Running Command

cp /home/daytona/workspace/spinal-flowchart/N2O_Indications_Flowchart.pptx /tmp/n2o.pptx && libreoffice --headless --convert-to pdf /tmp/n2o.pptx --outdir /tmp/ 2>&1 && cp /tmp/n2o.pdf /home/daytona/workspace/spinal-flowchart/N2O_Indications_Flowchart.pdf && ls -lh /home/daytona/workspace/spinal-flowchart/N2O*

Both files are ready — download whichever you prefer:

N2O Indications Flowchart

PDF Document · PDF

N2O Indications Flowchart

Presentation · PPTX


Here's what's inside the 6-slide flow diagram:
SlideContent
1Title slide with 4 key property pills (MAC, Blood/Gas, Odourless, NMDA)
2Master Indications Flowchart - central hub fans out to all 7 indications with detail boxes under each branch
3Clinical Decision Tree - USE vs AVOID - screens contraindications first, then branches to appropriate indication
4Why It Works - Physical property → Clinical indication cascade (Low blood/gas → rapid induction; MAC 104% → adjuvant use; NMDA → analgesia; Sympathoadrenal → cardiac stability; Odourless → paediatrics; Diffusion → contraindications)
5Concentration & Dosing Guide - visual concentration bar (0-100%) with 7 indication cards, each showing dose, key points, and clinical pearls. Diffusion hypoxia (Fink effect) warning at bottom
6One-page Summary Reference Card - 3 columns: Key Properties / Indications with doses / Contraindications

automatic machine Failure of ana3sthesia machine Plus Second machone Has power Outlet failire .reporting By anesthesia department write short applicarion rwpott doucmentqtion

Reading File
Running Command

mkdir -p /home/daytona/workspace/n2o-report && ls /home/daytona/workspace/

Writing File

~/n2o-report/anaesthesia_machine_report.js

const {
  Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
  Header, Footer, AlignmentType, HeadingLevel, BorderStyle, WidthType,
  VerticalAlign, PageNumber, ShadingType, UnderlineType,
} = require("docx");
const fs = require("fs");

// ─── HELPERS ────────────────────────────────────────────────────────────────
const FONT = "Times New Roman";
const FONT_BODY = 22;  // half-points = 11pt
const FONT_H1   = 28;  // 14pt
const FONT_H2   = 24;  // 12pt
const FONT_SMALL = 18; // 9pt

function para(text, opts = {}) {
  return new Paragraph({
    alignment: opts.align || AlignmentType.LEFT,
    spacing: { after: opts.afterPt ? opts.afterPt * 20 : 120, line: 360, lineRule: "auto" },
    children: [
      new TextRun({
        text,
        font: FONT,
        size: opts.size || FONT_BODY,
        bold: opts.bold || false,
        italics: opts.italic || false,
        underline: opts.underline ? { type: UnderlineType.SINGLE } : undefined,
        color: opts.color || "000000",
      }),
    ],
  });
}

function heading(text, level = 1, center = false) {
  return new Paragraph({
    alignment: center ? AlignmentType.CENTER : AlignmentType.LEFT,
    spacing: { before: 200, after: 100, line: 360, lineRule: "auto" },
    children: [
      new TextRun({
        text,
        font: FONT,
        size: level === 1 ? FONT_H1 : FONT_H2,
        bold: true,
        underline: level === 1 ? { type: UnderlineType.SINGLE } : undefined,
        color: level === 1 ? "1A3A6B" : "2E4A8A",
      }),
    ],
  });
}

function labelValue(label, value) {
  return new Paragraph({
    spacing: { after: 80, line: 340, lineRule: "auto" },
    children: [
      new TextRun({ text: label + ": ", font: FONT, size: FONT_BODY, bold: true }),
      new TextRun({ text: value, font: FONT, size: FONT_BODY, bold: false }),
    ],
  });
}

function bullet(text, bold = false) {
  return new Paragraph({
    spacing: { after: 80, line: 340, lineRule: "auto" },
    indent: { left: 480, hanging: 240 },
    children: [
      new TextRun({ text: "•  ", font: FONT, size: FONT_BODY, bold: false }),
      new TextRun({ text, font: FONT, size: FONT_BODY, bold }),
    ],
  });
}

function divider() {
  return new Paragraph({
    spacing: { before: 80, after: 80 },
    border: { bottom: { color: "1A3A6B", size: 6, style: BorderStyle.SINGLE } },
    children: [new TextRun({ text: "", font: FONT, size: 4 })],
  });
}

function emptyLine() {
  return new Paragraph({
    spacing: { after: 60 },
    children: [new TextRun({ text: "", font: FONT, size: FONT_BODY })],
  });
}

function signatureBlock(role, name = "_________________________") {
  return new Paragraph({
    spacing: { after: 200, line: 360, lineRule: "auto" },
    children: [
      new TextRun({ text: role + ": ", font: FONT, size: FONT_BODY, bold: true }),
      new TextRun({ text: name, font: FONT, size: FONT_BODY, bold: false,
        underline: { type: UnderlineType.SINGLE } }),
    ],
  });
}

// ─── STATUS TABLE ────────────────────────────────────────────────────────────
function statusTable() {
  const cellStyle = (txt, bg = "FFFFFF", bold = false, center = false) =>
    new TableCell({
      shading: { fill: bg, type: ShadingType.CLEAR },
      margins: { top: 80, bottom: 80, left: 120, right: 120 },
      verticalAlign: VerticalAlign.CENTER,
      children: [
        new Paragraph({
          alignment: center ? AlignmentType.CENTER : AlignmentType.LEFT,
          children: [
            new TextRun({ text: txt, font: FONT, size: FONT_BODY, bold }),
          ],
        }),
      ],
    });

  const headerCell = (txt) => cellStyle(txt, "1A3A6B", true, true);

  const rows = [
    new TableRow({
      tableHeader: true,
      children: [
        headerCell("Item"),
        headerCell("Details"),
        headerCell("Status"),
        headerCell("Action Required"),
      ],
    }),
    new TableRow({
      children: [
        cellStyle("Machine #1\n(Anaesthesia Machine)", "EBF0FA", true),
        cellStyle("Automatic failure during operation\nDate: 15 June 2026\nOR: Operating Theatre 1", "EBF0FA"),
        cellStyle("⚠ NON-FUNCTIONAL", "FDECEA", true, true),
        cellStyle("Immediate biomedical review\n+ replacement required", "FDECEA"),
      ],
    }),
    new TableRow({
      children: [
        cellStyle("Machine #2\n(Backup Anaesthesia Machine)", "F0FAF0", true),
        cellStyle("Power outlet failure on activation\nDate: 15 June 2026\nOR: Operating Theatre 1", "F0FAF0"),
        cellStyle("⚠ NON-FUNCTIONAL", "FDECEA", true, true),
        cellStyle("Electrical fault assessment\nby maintenance engineer", "FDECEA"),
      ],
    }),
    new TableRow({
      children: [
        cellStyle("Patient Safety Status", "FFFDE7", true),
        cellStyle("Elective cases postponed\nEmergency protocol activated", "FFFDE7"),
        cellStyle("MANAGED", "FFF8E1", true, true),
        cellStyle("Manual ventilation standby\nRestoring functional machine", "FFF8E1"),
      ],
    }),
  ];

  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    borders: {
      top:    { style: BorderStyle.SINGLE, size: 8, color: "1A3A6B" },
      bottom: { style: BorderStyle.SINGLE, size: 8, color: "1A3A6B" },
      left:   { style: BorderStyle.SINGLE, size: 8, color: "1A3A6B" },
      right:  { style: BorderStyle.SINGLE, size: 8, color: "1A3A6B" },
      insideH:{ style: BorderStyle.SINGLE, size: 4, color: "AAAAAA" },
      insideV:{ style: BorderStyle.SINGLE, size: 4, color: "AAAAAA" },
    },
    rows,
  });
}

// ─── DOCUMENT ────────────────────────────────────────────────────────────────
const doc = new Document({
  creator: "Department of Anaesthesiology",
  title: "Anaesthesia Machine Failure Incident Report",
  description: "Official incident documentation for anaesthesia machine failure",

  styles: {
    default: {
      document: {
        run: { font: FONT, size: FONT_BODY },
        paragraph: { spacing: { line: 360, lineRule: "auto" } },
      },
    },
  },

  sections: [
    {
      properties: {
        page: {
          margin: { top: 1080, bottom: 1080, left: 1260, right: 1080 }, // ~0.75-1 inch
        },
      },

      headers: {
        default: new Header({
          children: [
            new Paragraph({
              alignment: AlignmentType.CENTER,
              border: { bottom: { color: "1A3A6B", size: 6, style: BorderStyle.SINGLE } },
              spacing: { after: 80 },
              children: [
                new TextRun({
                  text: "DEPARTMENT OF ANAESTHESIOLOGY   |   INCIDENT REPORT   |   CONFIDENTIAL",
                  font: FONT, size: FONT_SMALL, bold: true, color: "1A3A6B",
                }),
              ],
            }),
          ],
        }),
      },

      footers: {
        default: new Footer({
          children: [
            new Paragraph({
              alignment: AlignmentType.CENTER,
              border: { top: { color: "1A3A6B", size: 6, style: BorderStyle.SINGLE } },
              spacing: { before: 80 },
              children: [
                new TextRun({ text: "Page ", font: FONT, size: FONT_SMALL, color: "555555" }),
                new TextRun({ children: [PageNumber.CURRENT], font: FONT, size: FONT_SMALL, color: "555555" }),
                new TextRun({ text: "  |  Anaesthesia Machine Failure Report  |  Ref: ANESTH/EQP/2026/001", font: FONT, size: FONT_SMALL, color: "555555" }),
              ],
            }),
          ],
        }),
      },

      children: [

        // ── LETTERHEAD ──
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 40 },
          children: [
            new TextRun({ text: "HOSPITAL / MEDICAL CENTRE NAME", font: FONT, size: 32, bold: true, color: "1A3A6B" }),
          ],
        }),
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 20 },
          children: [
            new TextRun({ text: "Department of Anaesthesiology", font: FONT, size: 24, bold: true, color: "2E4A8A" }),
          ],
        }),
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 40 },
          children: [
            new TextRun({ text: "Tel: ________  |  Email: ________  |  Internal Ext: ________", font: FONT, size: FONT_SMALL, color: "555555" }),
          ],
        }),
        divider(),
        emptyLine(),

        // ── DOCUMENT TITLE ──
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 60 },
          children: [
            new TextRun({ text: "INCIDENT / EQUIPMENT FAILURE REPORT", font: FONT, size: 30, bold: true, underline: { type: UnderlineType.SINGLE }, color: "1A3A6B" }),
          ],
        }),
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 40 },
          children: [
            new TextRun({ text: "Anaesthesia Machine Failure — Operating Theatre", font: FONT, size: 24, bold: false, italic: true, color: "2E4A8A" }),
          ],
        }),
        divider(),
        emptyLine(),

        // ── REFERENCE BLOCK ──
        labelValue("Reference No.", "ANESTH/EQP/2026/001"),
        labelValue("Date of Incident", "15 June 2026"),
        labelValue("Time of Incident", "____________"),
        labelValue("Location", "Operating Theatre _____, Floor _____, Block _____"),
        labelValue("Reported By", "Dr. ________________________  (Consultant Anaesthesiologist)"),
        labelValue("Report Date", "15 June 2026"),
        labelValue("Report Submitted To",
          "Medical Director  |  HOD Anaesthesiology  |  Biomedical Engineering  |  Hospital Administration"),
        emptyLine(),
        divider(),
        emptyLine(),

        // ── SECTION 1: TO ──
        heading("TO WHOM IT MAY CONCERN", 1, false),
        emptyLine(),
        para("The Honourable,"),
        para("The Medical Director / Chief Executive Officer,"),
        para("[Hospital / Medical Centre Name],"),
        para("[City, Country]"),
        emptyLine(),

        // ── SUBJECT LINE ──
        new Paragraph({
          spacing: { after: 120, line: 360 },
          children: [
            new TextRun({ text: "Subject: ", font: FONT, size: FONT_BODY, bold: true }),
            new TextRun({ text: "Urgent Report — Simultaneous Failure of Two Anaesthesia Machines in the Operating Theatre", font: FONT, size: FONT_BODY, bold: true, underline: { type: UnderlineType.SINGLE }, color: "C0392B" }),
          ],
        }),
        emptyLine(),

        // ── SECTION 2: INTRODUCTION ──
        heading("1.  INTRODUCTION", 2),
        para(
          "With due respect, this report is submitted on behalf of the Department of Anaesthesiology to formally document " +
          "a critical equipment failure incident that occurred in the Operating Theatre on 15 June 2026. " +
          "This incident directly compromised the operational readiness of the anaesthesia department and posed " +
          "a potential risk to patient safety. Immediate corrective action is requested from the relevant authorities."
        ),
        emptyLine(),

        // ── SECTION 3: INCIDENT DESCRIPTION ──
        heading("2.  DESCRIPTION OF INCIDENT", 2),

        para("2.1   Primary Machine Failure (Machine #1)", { bold: true }),
        para(
          "During the preparation for an elective surgical procedure on the above-mentioned date, " +
          "the primary anaesthesia machine in Operating Theatre _____ developed an automatic failure. " +
          "The machine shut down unexpectedly and could not be restarted. All pre-operative machine checks " +
          "had been performed by the attending anaesthesiologist as per standard protocol; however, " +
          "the machine became non-functional during the preparation phase."
        ),
        emptyLine(),

        para("2.2   Backup Machine Failure (Machine #2) — Power Outlet Failure", { bold: true }),
        para(
          "Following the failure of the primary machine, the departmental protocol was activated and the " +
          "backup anaesthesia machine was immediately requested. Upon connection of the backup machine " +
          "(Machine #2) to the designated power outlet in Operating Theatre _____, the power outlet was " +
          "found to be non-functional. The machine could not be powered on due to a complete electrical " +
          "failure at that outlet. Alternative outlets in the theatre were also assessed; connectivity was " +
          "limited. The backup machine was therefore also rendered non-operational at the time of the incident."
        ),
        emptyLine(),

        // Status Table
        heading("3.  INCIDENT SUMMARY TABLE", 2),
        statusTable(),
        emptyLine(),

        // ── SECTION 4: IMMEDIATE ACTIONS ──
        heading("4.  IMMEDIATE ACTIONS TAKEN", 2),
        bullet("Elective surgical procedures were immediately postponed until a functional anaesthesia machine was secured."),
        bullet("The on-call anaesthesiologist and HOD of Anaesthesiology were notified immediately."),
        bullet("Manual ventilation equipment (Ambu bag, self-inflating bag) and emergency oxygen supply were placed on standby."),
        bullet("Biomedical Engineering Department was urgently contacted for assessment of Machine #1."),
        bullet("Hospital Maintenance / Electrical Department was contacted regarding the power outlet failure."),
        bullet("An alternative functional anaesthesia machine was requested from another operating theatre."),
        bullet("All team members (surgeons, scrub nurses, OT staff) were briefed regarding the delay."),
        bullet("Incident was verbally reported to the Medical Director's office immediately."),
        emptyLine(),

        // ── SECTION 5: PATIENT SAFETY IMPACT ──
        heading("5.  PATIENT SAFETY IMPACT", 2),
        para(
          "This incident had the following patient safety implications:"
        ),
        bullet("Elective procedures scheduled for the day were delayed/postponed, causing inconvenience and anxiety to patients."),
        bullet("The simultaneous failure of both the primary and backup machine created a period of zero anaesthesia machine availability in the affected theatre."),
        bullet("No patient was harmed as a direct result of this incident; however, the potential for an adverse outcome was significant, particularly if the failure had occurred mid-procedure."),
        bullet("Anaesthetic risk was effectively managed through manual protocols and inter-theatre coordination."),
        emptyLine(),

        // ── SECTION 6: ROOT CAUSE ANALYSIS ──
        heading("6.  PRELIMINARY ROOT CAUSE ANALYSIS", 2),
        para("6.1   Machine #1 Failure:", { bold: true }),
        bullet("Probable cause: Mechanical or electronic component failure (to be confirmed by biomedical engineer)."),
        bullet("Contributing factor: Age of machine / last service date (refer to equipment maintenance log)."),
        bullet("Machine last serviced on: ________________"),
        emptyLine(),
        para("6.2   Power Outlet Failure (Machine #2):", { bold: true }),
        bullet("Probable cause: Faulty electrical circuit / overloaded outlet / loose connection."),
        bullet("Contributing factor: Inadequate electrical maintenance schedule in the operating theatre."),
        bullet("Outlet last inspected on: ________________"),
        emptyLine(),

        // ── SECTION 7: RECOMMENDATIONS ──
        heading("7.  RECOMMENDATIONS & CORRECTIVE ACTIONS REQUESTED", 2),

        para("7.1   Immediate (Within 24 Hours):", { bold: true, underline: true }),
        bullet("Biomedical Engineering to assess and repair or replace Machine #1 urgently."),
        bullet("Electrical/Maintenance team to inspect and repair the faulty power outlet in Theatre _____."),
        bullet("Provide a certified functional anaesthesia machine as an immediate replacement."),
        emptyLine(),

        para("7.2   Short-Term (Within 1 Week):", { bold: true, underline: true }),
        bullet("Conduct a full electrical inspection of all power outlets in all operating theatres."),
        bullet("Full functional check of all backup anaesthesia machines in the hospital."),
        bullet("Review and update the equipment failure emergency protocol."),
        bullet("Ensure all OR staff are re-trained on machine failure contingency procedures."),
        emptyLine(),

        para("7.3   Long-Term (Within 1 Month):", { bold: true, underline: true }),
        bullet("Establish a quarterly preventive maintenance schedule for all anaesthesia machines."),
        bullet("Procure an additional certified backup anaesthesia machine for each operating theatre."),
        bullet("Install dedicated UPS (Uninterruptible Power Supply) for all anaesthesia machine outlets."),
        bullet("Introduce a digital equipment log and alert system for maintenance due dates."),
        bullet("Conduct a formal Root Cause Analysis (RCA) meeting involving all stakeholders."),
        emptyLine(),

        // ── SECTION 8: IMPACT ON DEPARTMENT ──
        heading("8.  IMPACT ON DEPARTMENT OPERATIONS", 2),
        bullet("Operating list disruption: _____ elective cases postponed on the day."),
        bullet("Financial implication: Theatre time lost, rescheduling costs."),
        bullet("Staff distress: Anaesthesia team, surgical team, and nursing staff affected."),
        bullet("Reputation risk: Patient confidence in hospital safety standards may be affected."),
        emptyLine(),

        // ── SECTION 9: CLOSING ──
        heading("9.  CONCLUSION", 2),
        para(
          "The simultaneous failure of the primary anaesthesia machine and the backup machine's power outlet " +
          "represents a serious equipment reliability failure that requires urgent administrative attention. " +
          "The Department of Anaesthesiology acted promptly to ensure patient safety was maintained throughout the incident. " +
          "However, this event highlights critical gaps in equipment maintenance and electrical infrastructure " +
          "within the operating theatres."
        ),
        emptyLine(),
        para(
          "We respectfully request that this matter be escalated to the appropriate departments without delay " +
          "and that the recommended corrective actions be implemented at the earliest. " +
          "A follow-up report will be submitted upon completion of the technical assessments."
        ),
        emptyLine(),
        para(
          "We trust that the management will treat this matter with the urgency it deserves in the interest of " +
          "patient safety, staff welfare, and the operational integrity of the surgical services."
        ),
        emptyLine(),
        divider(),
        emptyLine(),

        // ── SIGNATURES ──
        heading("10.  REPORTED BY", 2),
        emptyLine(),
        signatureBlock("Name", "Dr. ______________________________"),
        signatureBlock("Designation", "Consultant Anaesthesiologist / HOD Anaesthesiology"),
        signatureBlock("Date", "15 June 2026"),
        signatureBlock("Signature", "___________________________"),
        emptyLine(),
        signatureBlock("Co-signed By", "Dr. ______________________________"),
        signatureBlock("Designation", "On-Call Anaesthesiologist"),
        signatureBlock("Date", "15 June 2026"),
        signatureBlock("Signature", "___________________________"),
        emptyLine(),
        divider(),
        emptyLine(),

        // ── CC ──
        heading("COPY TO:", 2),
        bullet("Head of Department — Anaesthesiology"),
        bullet("Medical Director / CEO"),
        bullet("Chief of Surgery"),
        bullet("Biomedical Engineering Department"),
        bullet("Hospital Maintenance / Electrical Department"),
        bullet("Risk Management / Quality & Patient Safety Office"),
        bullet("Hospital Administration"),
        bullet("Nursing In-Charge — Operating Theatres"),
        bullet("Equipment/Stores Department"),
        emptyLine(),
        divider(),
        emptyLine(),

        // ── DOCUMENT CONTROL ──
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 40 },
          children: [
            new TextRun({ text: "DOCUMENT CONTROL", font: FONT, size: FONT_SMALL, bold: true, color: "555555" }),
          ],
        }),
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 40 },
          children: [
            new TextRun({
              text: "Document Type: Incident Report  |  Version: 1.0  |  Classification: Confidential  |  Date: 15 June 2026",
              font: FONT, size: FONT_SMALL, color: "777777",
            }),
          ],
        }),
        new Paragraph({
          alignment: AlignmentType.CENTER,
          spacing: { after: 40 },
          children: [
            new TextRun({
              text: "This document is the property of the Department of Anaesthesiology. Unauthorized distribution is prohibited.",
              font: FONT, size: FONT_SMALL, italic: true, color: "999999",
            }),
          ],
        }),
      ],
    },
  ],
});

// WRITE
Packer.toBuffer(doc).then((buffer) => {
  fs.writeFileSync(
    "/home/daytona/workspace/n2o-report/Anaesthesia_Machine_Failure_Report.docx",
    buffer
  );
  console.log("✅ Done: Anaesthesia_Machine_Failure_Report.docx");
}).catch((e) => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/n2o-report && npm install docx 2>&1 | tail -5 && node anaesthesia_machine_report.js 2>&1

Running Command

node -e "require('docx')" 2>&1 | head -3

Running Command

node /home/daytona/workspace/n2o-report/anaesthesia_machine_report.js 2>&1

Running Command

cp /home/daytona/workspace/n2o-report/Anaesthesia_Machine_Failure_Report.docx /tmp/amr.docx && libreoffice --headless --convert-to pdf /tmp/amr.docx --outdir /tmp/ 2>&1 && cp /tmp/amr.pdf /home/daytona/workspace/n2o-report/Anaesthesia_Machine_Failure_Report.pdf && ls -lh /home/daytona/workspace/n2o-report/

Both files are ready - download either:

Anaesthesia Machine Failure Report

PDF Document · PDF

Anaesthesia Machine Failure Report

Word Document · DOCX


Here is what the report contains — fully structured as an official hospital document:
SectionContent
LetterheadDepartment of Anaesthesiology header with reference number
Subject LineHighlighted urgent heading in red
1. IntroductionFormal opening to Medical Director
2. Description of IncidentSeparate subsections for Machine #1 (automatic failure) and Machine #2 (power outlet failure)
3. Incident Summary TableColour-coded table — Machine 1, Machine 2, Patient Safety Status with Actions
4. Immediate Actions Taken8-point list of what the department did on the day
5. Patient Safety ImpactWhat risks were created and how they were managed
6. Root Cause AnalysisPreliminary causes for each machine failure
7. RecommendationsThree tiers — Immediate (24h), Short-term (1 week), Long-term (1 month)
8. Departmental ImpactTheatre time lost, financial and staff impact
9. ConclusionFormal closing with appeal for urgent action
10. SignaturesConsultant + On-Call anaesthesiologist signature blocks
CC ListMedical Director, Surgery, Biomedical, Maintenance, Risk Management, Admin, Nursing
Document ControlVersion, classification, confidentiality notice
Just fill in the blanks (hospital name, theatre number, doctor names, times) before submitting.
This is a shared conversation. Sign in to Orris to start your own chat.