Make proper detailed pdf from given data ANAESTHESIA AND MORBID OBESITY – MASTER NOTES PART 1 – Definition, Classification, Causes, Pathophysiology & Systemic Changes Definition of Obesity General Definition • Body weight >10% above ideal/expected weight, considering height, age, build, and sex. By Body Fat Content • Normal: 15–18% body weight as fat • Obese: • Male: ≥25% body fat • Female: ≥30% body fat • Morbid obesity: Actual body weight >200% of Ideal Body Weight (IBW) Body Mass Index (BMI) Definition • Also called Quetelet Index • Introduced by Lambert Adolphe Jacques Quetelet (1835) Formula BMI = Weight (kg) / Height² (m²) ⸻ BMI Classification BMI (kg/m²) Category <18.5 Underweight 18.5–24.99 Normal 25–26.9 Overweight 27–30 Mild obesity >30 Moderate obesity / Obese >35 Severe obesity >35 + comorbidity OR >40 without comorbidity Morbid obesity >50 Super obesity >55 Super-morbid obesity Important Points • Risk of perioperative complications increases sharply once BMI exceeds 30 kg/m². • Android (central) obesity: Greater cardiovascular, metabolic, and airway risk. • Gynoid (peripheral) obesity: Lower perioperative risk. ⸻ Causes of Obesity Obesity is multifactorial. Genetic Factors Environmental Factors Hormonal Regulation • Leptin • Adiponectin • Ghrelin • Peptide YY Hormonal Changes Leptin • Increased in obesity • Leptin resistance develops • Contributes to obesity hypoventilation syndrome by blunting ventilatory response to CO₂ Ghrelin • Falls after meals • Signals satiety ⸻ Pathophysiology of Obesity Obesity affects almost every organ system and produces significant perioperative physiological changes. ⸻ Respiratory System Physiological Changes • Increased oxygen consumption • Increased carbon dioxide production • Decreased lung compliance • Decreased chest wall compliance due to fat deposition • Increased airway resistance (especially in supine position) • Ventilation-perfusion mismatch • Increased intrapulmonary shunt • Restrictive ventilatory defect • Decreased pulmonary reserve • Rapid oxygen desaturation during apnea Lung Volumes • ↓ Functional Residual Capacity (FRC) • May be <1 L when BMI >40 • ↓ Forced Vital Capacity (FVC) • ↓ Total Lung Capacity (TLC) • ↓ Expiratory Reserve Volume (ERV) Clinical Implications • Difficult ventilation • Difficult oxygenation • Faster desaturation • Worsened by: • General anesthesia • Supine positioning • Postoperative pain ⸻ Obstructive Sleep Apnea (OSA) Definition Repeated upper airway obstruction during sleep resulting in episodes of apnea or hypopnea. Apnea: Complete cessation of airflow for ≥10 seconds despite respiratory effort. ⸻ Pathophysiology • Fat deposition in lateral pharyngeal walls • Reduced pharyngeal patency • Muscle relaxation during sleep • Reduced upper airway tone during REM sleep • Bernoulli effect contributes to airway collapse ⸻ Clinical Features • Loud snoring • Witnessed apnea • Nocturnal choking/gasping • Daytime somnolence • Morning headaches • Waking unrefreshed • Hypertension • LVH • RVH ⸻ Complications • Hypoxemia • Polycythemia • Pulmonary hypertension • Right ventricular failure (cor pulmonale) ⸻ Anaesthetic Implications • Increased sensitivity to sedatives • Increased sensitivity to opioids/narcotics • Increased sensitivity to anesthetic drugs • Postoperative period is critical • Oxygen therapy may mask apnea without correcting hypoventilation • Respiratory drive may become hypoxia-dependent rather than hypercapnia-dependent ⸻ Obesity Hypoventilation Syndrome (OHS) Also Known As Pickwickian syndrome ⸻ Definition Triad of: • BMI >30 kg/m² • Daytime hypercapnia • PaCO₂ >45 mmHg • (≈5.9 kPa) • No alternative cause of hypoventilation ⸻ Pathophysiology • Blunted respiratory center response • Reduced chest wall compliance • Leptin resistance • Blunted ventilatory response to CO₂ ⸻ Clinical Features • Daytime hypoventilation • Hypercapnia while awake • Increased sensitivity to sedatives and anesthetic drugs ⸻ Comparison: OSA vs OHS Feature OSA OHS Awake ventilation Normal Hypoventilation present Daytime PaCO₂ Normal >45 mmHg Primary abnormality Upper airway obstruction Central hypoventilation + mechanical restriction Diagnosis Polysomnography ABG after excluding other causes Association Often coexists with OHS >90% also have OSA ⸻ Cardiovascular System Hemodynamic Changes • Increased blood volume (although lower per kg body weight) • Increased cardiac output due to increased metabolic demand • Cardiac output increases by 20–30 mL/min for every 1 kg fat gained above IBW • Increase in cardiac output occurs mainly due to increased stroke volume rather than heart rate ⸻ Structural Cardiac Changes Left Ventricle • LV dilatation • Eccentric hypertrophy • Left ventricular hypertrophy • Diastolic dysfunction • Progression to systolic dysfunction if hypertrophy fails to compensate Left Atrium • Left atrial enlargement due to: • Increased blood volume • Increased venous return • Later due to LV hypertrophy and diastolic dysfunction Right Ventricle Affected due to: • Pulmonary hypertension • OSA • OHS • Increased hemodynamic burden ⸻ Obesity Cardiomyopathy Definition Cardiomyopathy directly caused by obesity, independent of hypertension or structural heart disease. ⸻ Pathophysiology Fat Infiltration Involves: • Sinus node • AV node • Right bundle branch • Myocardium Produces: • Sinoatrial block • Bundle branch block • AV block (rare) ⸻ Lipotoxicity • Triglyceride accumulation within myocytes • Adipokine-mediated myocardial injury ⸻ Hemodynamic Overload • Increased blood volume • Increased cardiac output • LV dilatation • LV hypertrophy Results in: • Diastolic dysfunction • Systolic dysfunction ⸻ Clinical Significance • Can occur without hypertension • Can occur without coronary artery disease • Supports routine preoperative echocardiography in morbid obesity ⸻ Complications • Congestive heart failure • Sudden cardiac death ⸻ Hypertension in Obesity Blood Pressure = Cardiac Output × Systemic Vascular Resistance Mechanisms • Increased blood flow to adipose tissue • Increased cardiac output • BP rises by approximately 6.5 mmHg for every 10% increase in body weight Despite a larger vascular bed, obesity causes increased SVR due to: • Sympathetic overactivity • Sleep-disordered breathing (OSA/OHS) • Adipose-derived inflammatory mediators: • IL-6 • Resistin • PAI-1 • Lipoprotein lipase ⸻ Coronary Artery Disease Obesity is an independent risk factor for: • Coronary artery disease • Ischemic heart disease Contributing factors: • Diabetes mellitus • Hypertension • Dyslipidemia • Accelerated atherosclerosis ⸻ Arrhythmias Higher incidence of: • Cardiac arrhythmias • Sudden cardiac death Mechanisms: • Cardiac hypertrophy • Fat infiltration • Increased catecholamines • Increased free fatty acids • OSA • Drug effects ⸻ Gastrointestinal & Hepatic System Hepatic Changes • Fatty liver • Non-alcoholic steatohepatitis (NASH) • Cirrhosis Gastrointestinal Changes • Increased gastric acid secretion • Increased gastric volume • Gastroesophageal reflux disease (GERD) • Hiatus hernia Anaesthetic Importance • Increased aspiration risk ⸻ Endocrine System • Insulin resistance • High incidence of diabetes mellitus • Tight perioperative glycemic control is important but difficult ⸻ Other Comorbidities Associated with Obesity System Associated Conditions Cardiac Hypertension, atherosclerosis, CAD, cardiac failure Respiratory OSA, OHS, asthma, pulmonary embolism, pulmonary hypertension Endocrine Diabetes mellitus, gout, glomerulosclerosis Hepatic Fatty liver, cholelithiasis Vascular Varicose veins, DVT Skeletal Degenerative arthritis, carpal tunnel syndrome Oncology Endometrial, breast, prostate, and colon cancers ⸻ Key Exam Pearls • BMI is also called the Quetelet Index. • Android obesity carries higher perioperative risk than gynoid obesity. • Morbidly obese patients desaturate rapidly because of decreased FRC and increased oxygen consumption. • OSA is due to upper airway collapse during sleep, whereas OHS is characterized by daytime hypoventilation with hypercapnia. • Obesity cardiomyopathy can occur without hypertension or coronary artery disease. • Obesity is an independent risk factor for CAD, hypertension, arrhythmias, and sudden cardiac death. • Fatty liver, GERD, and increased gastric volume contribute to a high aspiration risk. ANAESTHESIA AND MORBID OBESITY – MASTER NOTES PART 2 – Pre-Anaesthetic Assessment, OSA/OHS Evaluation, Investigations, Risk Stratification & Preoperative Preparation ⸻ Preanaesthesia Check-up (PAC) in Morbidly Obese Patient General Considerations • BMI >40 kg/m² = Morbid obesity. • High risk of perioperative complications due to multiple comorbidities. • Requires a comprehensive, individualized, and targeted preanaesthetic evaluation. ⸻ Objectives of Preoperative Assessment • Identify obesity-related comorbidities. • Assess airway difficulty. • Evaluate respiratory reserve. • Assess cardiovascular function. • Identify OSA/OHS. • Assess aspiration risk. • Evaluate venous access and monitoring requirements. • Plan perioperative optimization and postoperative care. ⸻ Detailed History 1. Medical Comorbidities • Ask leading questions to identify undiagnosed disease. • Review medication history for indirect clues. ⸻ 2. Diabetes Mellitus Symptoms: • Polyuria • Polydipsia • Nocturia • Recurrent infections (skin, conjunctiva, urinary tract) • Blurred vision • Irritability • Neuropathy • Slow wound healing ⸻ 3. Obstructive Sleep Apnoea (OSA) Ask for: • Habitual loud snoring • Witnessed apnea • Daytime sleepiness • Morning headaches • Nocturnal choking/gasping • Waking unrefreshed • Ability to lie supine • Sleeping in sitting position (suggestive of severe OSA/OHS) ⸻ 4. Respiratory Function Assess for: • Dyspnea • Hypoventilation • Oxygen desaturation on lying supine • Reduced exercise tolerance ⸻ 5. Cardiac Symptoms Look for features of: • Hypertension • Ischemic heart disease • Congestive heart failure • Pulmonary hypertension • Arrhythmias ⸻ 6. Gastrointestinal Symptoms • Gastroesophageal reflux • Heartburn • Hiatus hernia • Symptoms suggesting increased aspiration risk ⸻ 7. Dietary & Nutritional Status • Many patients are on weight-loss diets. • Nutritional deficiencies may be present. ⸻ 8. Drug History • Appetite suppressants (amphetamine derivatives) • Antihypertensives • Antidiabetic drugs • CPAP use • Anticoagulants ⸻ 9. Exercise Tolerance • Not a reliable indicator of cardiopulmonary reserve. • Follow AHA guidelines for perioperative cardiac assessment in non-cardiac surgery. ⸻ Physical Examination General Examination • Height • Weight • BMI • Fat distribution (android/gynoid) ⸻ Airway Assessment Evaluate: • Mallampati grading • Mouth opening • Thyromental distance • Neck mobility • Mandibular mobility • Presence of excess pharyngeal tissue Neck Circumference • 17 inches (43 cm) in males • 16 inches (41 cm) in females Suggests: • Difficult airway • Increased OSA risk ⸻ Respiratory Examination Assess: • Baseline oxygen saturation • Ability to lie supine • Respiratory effort • Chest expansion ⸻ Cardiovascular Examination Look for: • Hypertension • Cardiac failure • Pulmonary hypertension • Cor pulmonale ⸻ STOP-BANG Questionnaire Component Criteria S Loud snoring T Daytime tiredness/sleepiness O Observed apnea/choking P Hypertension B BMI >35 kg/m² A Age >50 years N Neck circumference >43 cm (male), >41 cm (female) G Male gender Interpretation • 1 point for each positive response. • 3 = High risk of OSA. • ≥5 = Very high risk. Performance • Sensitivity ≈90% • Specificity ≈28% • Positive predictive value ≈85% ⸻ Diagnosis of OSA Gold Standard Polysomnography (PSG) ⸻ Parameters Monitored • SpO₂ • ECG • EEG • EOG • EMG • Nasal/oral airflow • Respiratory effort • Snoring • Limb movements ⸻ PSG Detects • Sleep architecture • Apnea/hypopnea episodes • Type of apnea • Oxygen desaturation • Cardiac arrhythmias • REM-related disorders • Seizure activity (if present) ⸻ Indications for Polysomnography • Witnessed apnea (>10 seconds) • Excessive daytime sleepiness • Epworth Sleepiness Scale >10 • Loud snoring • BMI >30 kg/m² • Hypertension • Choking/gasping during sleep • Symptoms of narcolepsy • Violent/injurious sleep behaviors • Polycythemia • Pulmonary hypertension • Right heart failure • Nocturnal arrhythmias • CAD • CHF • Stroke/TIA • Unexplained nocturnal desaturation ⸻ Apnea-Hypopnea Index (AHI) Definition Number of apnea (complete cessation of airflow ≥10 sec) plus hypopnea (≥30% reduction in airflow with ≥3–4% oxygen desaturation) per hour of sleep. Also called: • Respiratory Disturbance Index (RDI) ⸻ Severity AHI Severity <5 Normal 5–15 Mild OSA 15–30 Moderate OSA >30 Severe OSA Clinical Significance Higher AHI is associated with: • Increased sympathetic activity • Endothelial dysfunction • Metabolic dysfunction • Hypertension • Ischemic heart disease • Stroke • Congestive heart failure ⸻ Preoperative Investigations 1. Routine Laboratory Tests • CBC • Renal function tests • Liver function tests • Serum electrolytes • Fasting blood glucose • HbA1c • Thyroid function tests ⸻ 2. Respiratory Evaluation Arterial Blood Gas (ABG) Assesses: • Hypercapnia • Hypoxemia • Baseline oxygenation • OHS Pulmonary Function Tests Indications: • Respiratory symptoms • Abnormal airway examination • Suspected airway obstruction • Large neck mass Chest X-ray Assess: • Cardiothoracic ratio • Pulmonary congestion • Chronic lung disease Polysomnography Indicated when OSA is suspected but not previously diagnosed. ⸻ 3. Cardiovascular Assessment ECG Assess: • Rhythm • LVH • RVH • Ischemia • Cor pulmonale Typical ECG Findings • Low-voltage complexes • LVH with/without strain • Prolonged QT/QTc • Inferolateral T-wave abnormalities • Right axis deviation • Right bundle branch block • P pulmonale Transthoracic Echocardiography Evaluate: • Systolic function • Diastolic function • Chamber dilatation • Valvular disease • Pulmonary hypertension Stress Testing (Dobutamine stress echo or nuclear scan) Indicated when ≥3 cardiac risk factors are present. Cardiac Catheterization If stress test is positive or CAD is strongly suspected. ⸻ 4. Functional Assessment • Exercise tolerance (if feasible) • Stair climbing/walk test • Breath-holding time (crude assessment of cardiorespiratory reserve) ⸻ 5. Thromboembolism Assessment • Doppler ultrasound of lower limbs • D-dimer when indicated ⸻ 6. Airway & Vascular Access Assessment • Neck circumference • Airway anatomy • Difficulty in venous access • Ultrasound-guided vascular mapping if required ⸻ Additional Investigations (Selected Patients) • ECG + Echocardiography • Dobutamine stress echocardiography • PFT with flow-volume loop (large neck mass/tracheal compression) • ABG • CT neck and chest (tracheal compression, deviation, retrosternal extension) • Lower limb Doppler USG • Polysomnography (if diagnosis uncertain) • Detailed airway assessment and postoperative ventilation planning • Assessment of arterial and venous access ⸻ Role of Preoperative Weight Reduction Benefits Although not proven to reduce perioperative mortality directly, modest weight loss may: • Reduce liver size • Reduce intra-abdominal pressure • Improve diaphragmatic excursion • Improve ventilatory mechanics • Improve insulin sensitivity • Improve glycemic control • Reduce OSA severity ⸻ Recommended Diet • Supervised hypocaloric diet • Protein intake: • 1.5 g/kg Ideal Body Weight/day • Avoid starvation and protein-deficient diets. ⸻ Risks • Vitamin B1, B6, B12 deficiency • Iron deficiency • Zinc deficiency • Magnesium deficiency • Phosphorus deficiency • Electrolyte imbalance • Cardiac arrhythmias • Latent malnutrition after bariatric surgery • Sudden cardiac death with rapid unsupervised weight loss ⸻ Surgical Risk Stratification Obesity Surgery Mortality Risk Stratification (OS-MRS) Risk Factors (1 point each) • BMI >50 kg/m² • Male gender • Age >45 years • Hypertension • Previous VTE/risk of pulmonary embolism • Sleep-disordered breathing (hypoventilation) • Pulmonary hypertension • Poor mobility ⸻ Risk Classes Class Score Mortality A 0–1 0.2–0.3% B 2–3 1.1–1.5% C 4–5 2.4–3.0% ⸻ Preoperative Preparation 1. Respiratory Optimization • Physiotherapy • Breathing exercises • Incentive spirometry • Improve respiratory capacity and perioperative oxygenation • Reduce atelectasis ⸻ 2. CPAP/BiPAP • Continue preoperative CPAP in patients already using it. • CPAP improves perioperative outcomes in OSA/OHS. ⸻ 3. Glycemic Optimization • Optimize diabetes. • Maintain good perioperative glucose control. ⸻ 4. Blood Pressure Optimization • Control hypertension before surgery. ⸻ 5. Anxiety Management • Reassurance and counseling. • Avoid sedatives and narcotics whenever possible. • If required, use only light premedication with careful monitoring. ⸻ 6. OSA Precautions Patients are highly sensitive to: • Sedatives • Opioids • Analgesics These drugs may precipitate: • Airway obstruction • Apnea • Hypoventilation • Desaturation Avoid unnecessary premedication and monitor closely, especially overnight before surgery. ⸻ 7. Aspiration Prophylaxis Because obese patients have increased gastric volume and acidity: • H₂ blockers (Ranitidine) • Proton pump inhibitors • Sodium citrate (high-risk reflux) • Metoclopramide Follow standard ASA fasting guidelines in patients without additional aspiration risk. Gastric Ultrasound May estimate gastric volume but has not been proven to accurately predict aspiration risk. ⸻ 8. DVT Prophylaxis Pharmacological • Unfractionated heparin: • 5,000 units SC before surgery • Then every 8–12 hours until ambulatory • LMWH (e.g., enoxaparin) Mechanical • Compression stockings • Pneumatic sequential compression devices (flow boots/calf pumps) • Continue intraoperatively and postoperatively. ⸻ 9. Antibiotic Prophylaxis Administer according to standard surgical guidelines. ⸻ 10. Avoid Intramuscular Injections Avoid IM injections because obesity causes: • Unpredictable absorption • Delayed drug uptake • Inconsistent pharmacokinetics ⸻ End of Part 2 ANAESTHIA AND MORBID OBESITY – MASTER NOTES PART 3 – Anaesthetic Management (Airway, Preoxygenation, Positioning, Drug Dosing, Monitoring, Ventilation & Regional Anaesthesia) ⸻ Principles of Anaesthetic Management Goals • Anticipate and manage difficult airway. • Maintain adequate oxygenation and ventilation. • Prevent rapid desaturation. • Maintain hemodynamic stability. • Optimize drug dosing according to body weight scalar. • Minimize aspiration risk. • Prevent residual neuromuscular blockade. • Reduce postoperative respiratory complications. • Provide effective multimodal analgesia. ⸻ 1. Preoperative Planning A thorough anaesthetic plan should include: • Airway assessment • Evaluation for OSA/OHS • Cardiovascular assessment • Pulmonary function assessment • Diabetes and hypertension optimization • Functional capacity assessment • Anticipation of postoperative ventilatory support ⸻ 2. Operating Theatre Preparation Equipment • OT table with adequate weight-bearing capacity • Trained personnel for positioning and transfer • Difficult airway cart immediately available • Appropriate-sized BP cuff • Long IV cannulas if required • Ultrasound machine for vascular access • Longer neuraxial needles if regional anaesthesia planned ⸻ Standard ASA Monitoring • ECG • Non-invasive blood pressure • Pulse oximetry • End-tidal CO₂ • Temperature ⸻ Additional Monitoring (When Indicated) Arterial Line Indications: • Major surgery • Severe cardiopulmonary disease • Expected rapid hemodynamic changes • Prolonged procedures Central Venous Access Consider when: • Peripheral venous access is difficult • Major surgery requiring invasive monitoring Additional Monitors • Neuromuscular monitoring • Depth of anaesthesia monitoring • Cardiac output monitoring (FloTrac, PiCCO) in selected patients ⸻ 3. Airway Management Why is Airway Difficult? Fat deposition causes: • Short bulky neck • Large neck circumference • Excess pharyngeal tissue • Reduced mouth opening • Limited neck extension • Reduced mandibular mobility • Short thyromental distance Patients with OSA/OHS have an even greater risk. ⸻ Airway Assessment Evaluate: • Mallampati classification • Mouth opening • Neck circumference • Neck mobility • Thyromental distance • Mandibular mobility • Ability to lie supine ⸻ Difficult Airway Strategy Always prepare: • Difficult airway cart • Video laryngoscope • Fibreoptic bronchoscope • Surgical airway backup • Second anaesthesiologist if available ⸻ Preferred Airway Techniques Anticipated Difficult Airway • Awake fibreoptic intubation (preferred) • Semi-recumbent/head-up position Majority of Patients • Asleep intubation • Four-handed/two-person mask ventilation • Ventilator-assisted mask ventilation if required Rescue Devices • Laryngeal Mask Airway (LMA) • Intubating LMA ⸻ 4. Positioning Ramped Position Definition: Shoulders elevated so that the external auditory meatus is aligned with the sternal notch. Also called: • Head-Elevated Laryngoscopy Position (HELP) ⸻ Benefits • Better laryngoscopic view • Easier mask ventilation • Improved preoxygenation • Delays desaturation • Improves oxygenation • Facilitates intubation ⸻ Other Useful Positions • Semi-upright • Head-up • Reverse Trendelenburg (25–30°) These positions: • Improve FRC • Reduce diaphragmatic splinting • Reduce atelectasis • Improve respiratory mechanics • Delay hypoxemia ⸻ Supine Position Poorly tolerated because: • Diaphragm displaced upwards • Reduced FRC • Increased closing volume • Airway closure • Increased shunt • Atelectasis • Worsening V/Q mismatch • Rapid hypoxemia ⸻ 5. Preoxygenation Definition Administration of 100% oxygen before induction to: • Replace nitrogen in lungs • Increase oxygen reserve • Prolong safe apnea time ⸻ Why Important? Morbidly obese patients have: • Decreased FRC • Increased oxygen consumption • Increased CO₂ production • Rapid desaturation • Difficult intubation ⸻ Methods Preferred Method 100% oxygen for 3 minutes with tidal breathing. ⸻ Alternative 4–8 vital capacity breaths of 100% oxygen. ⸻ Adjuncts PEEP/CPAP Benefits: • Improves FRC • Prevents atelectasis • Delays desaturation ⸻ Apneic Oxygenation Oxygen via: • Nasal cannula • Nasopharyngeal catheter Usually: • 15 L/min oxygen Benefits: • Extends safe apnea time • Delays desaturation ⸻ THRIVE (Transnasal Humidified Rapid Insufflation Ventilatory Exchange) Provides: • High-flow humidified oxygen • Apneic oxygenation • CPAP effect • Dead-space washout Benefits: • Improves oxygenation • Prolongs apnea • Reduces hypoxemia during difficult intubation ⸻ 6. Induction of Anaesthesia General Principles • Thorough preoxygenation • Head-up/ramped position • Short-acting anaesthetic agents preferred • Anticipate difficult mask ventilation • Apply PEEP when appropriate ⸻ Difficult Mask Ventilation Management: • Two-person/four-handed mask ventilation • Oral airway • Nasal airway • PEEP • Head-up position ⸻ 7. Pharmacokinetic Changes in Obesity Change Effect ↑ Adipose tissue ↑ Volume of distribution for lipophilic drugs ↑ Lean body mass Alters Vd of hydrophilic drugs ↑ Blood volume & cardiac output ↑ Drug clearance (some drugs) ↓ Total body water (fraction) ↓ Vd of hydrophilic drugs ↑ α₁-acid glycoprotein ↑ Binding of basic drugs → ↓ Free drug Albumin Usually unchanged ↑ Renal blood flow, GFR & secretion ↑ Renal clearance ↓ Hepatic blood flow (CHF) ↓ Hepatic clearance of selected drugs ⸻ 8. Drug Dosing General Principles Drug/Drug Group Dosing Scalar Lipophilic drugs (benzodiazepines, barbiturates) Ideal Body Weight (IBW) Hydrophilic drugs Lean Body Weight (LBW) or IBW + 20% Succinylcholine Total Body Weight (TBW) Propofol induction IBW Propofol infusion TBW / Corrected weight Thiopentone IBW Midazolam TBW Fentanyl TBW Morphine IBW Remifentanil IBW Rocuronium TBW Vecuronium IBW Atracurium TBW Cisatracurium IBW Local anaesthetic infiltration IBW Spinal/Epidural LA Reduce dose by approximately 20–25% ⸻ 9. Choice of Anaesthetic Agents Preferred Characteristics • Rapid onset • Rapid recovery • Minimal metabolism • Easy titration ⸻ Inhalational Agents Desflurane • Lowest blood-gas solubility • Fastest emergence • Rapid recovery Sevoflurane • Good hemodynamic stability • Preferred in CAD and OSA Isoflurane • Less expensive • Slower emergence Nitrous Oxide • Rapid onset and recovery • Analgesic • Limited use because of reduced oxygen reserve ⸻ Preferred Short-Acting Drugs • Propofol • Remifentanil • Alfentanil • Atracurium • Cisatracurium • Sevoflurane • Desflurane ⸻ Avoid Long-Acting Drugs • Morphine • Diazepam • Pancuronium ⸻ 10. Intraoperative Ventilation Respiratory Problems • Reduced FRC • Reduced lung compliance • Increased oxygen consumption • Increased airway resistance • Higher airway pressures ⸻ Ventilation Strategy • IPPV usually required • Low tidal volume (lung-protective ventilation) • Moderate PEEP • Recruitment maneuvers • Higher FiO₂ during induction and as required ⸻ Monitoring • Continuous ETCO₂ monitoring • ABG during prolonged surgery when indicated ⸻ 11. Neuromuscular Blockade • Neuromuscular monitoring is essential. • Use peripheral nerve stimulator. • Ensure complete reversal before extubation. • Avoid residual paralysis. ⸻ 12. Regional Anaesthesia Advantages • Avoids airway manipulation • Reduces opioid requirement • Better postoperative analgesia • Earlier recovery • May reduce postoperative decline in lung volumes • Accelerates recovery of spirometry values ⸻ Challenges • Difficult landmarks • Impalpable spinous processes • Increased depth to epidural/subarachnoid space • False loss of resistance • Technically difficult ⸻ Helpful Measures • Ultrasound guidance • Longer spinal/epidural needles • Nerve stimulator when appropriate ⸻ Physiological Changes • Increased epidural fat • Decreased CSF volume • Engorged epidural veins Result: • Greater cephalad spread of local anaesthetic ⸻ Dose Adjustment • Reduce spinal/epidural local anaesthetic dose by 20–25%. ⸻ Epidural Anaesthesia (EDA) Advantages: • Reduces postoperative lung volume decline • Accelerates recovery of pulmonary function • Reduces opioid requirement Limitations: • Difficult anatomy • Deep epidural space • False loss of resistance • Abdominal muscle blockade may impair forced expiration ⸻ Multimodal Analgesia Regional techniques should be combined with: • Paracetamol • NSAIDs (when appropriate) • Opioids • Rectus sheath block • Wound infiltration ⸻ 13. Positioning and Pressure Care Arm Position • Avoid hyperabduction (>90°). • Prevent brachial plexus injury. ⸻ Padding Protect: • Shoulders • Buttocks • Back • Sacrum • Heels Prevents: • Pressure sores • Nerve injuries • Gluteal compartment syndrome • Rhabdomyolysis • Renal failure ⸻ Operating Table • Ensure adequate weight-bearing capacity. • Two OT tables with support board may be required in exceptional cases. ⸻ Preferred Surgical Position • Lateral position preferred when feasible. • Prone position is poorly tolerated due to worsening respiratory mechanics. ⸻ 14. Temperature Management • Forced-air warming • Fluid warmers Benefits: • Prevent hypothermia • Reduce shivering • Reduce wound infection ⸻ End of Part 3 ANAESTHESIA AND MORBID OBESITY – MASTER NOTES PART 4 – Postoperative Management, OSA Care, Analgesia, NIV, VTE Prophylaxis, Glucose Control & Obese Children ⸻ 1. Postoperative Care Objectives • Maintain airway patency. • Ensure adequate oxygenation and ventilation. • Prevent respiratory complications. • Prevent venous thromboembolism. • Provide effective analgesia with minimal opioid use. • Encourage early mobilization. • Maintain normoglycemia. ⸻ Postoperative Risks Morbidly obese patients have a higher incidence of: • Airway obstruction • Hypoventilation • Hypoxemia • Atelectasis • Respiratory failure • Opioid-induced respiratory depression • Deep vein thrombosis (DVT) • Pulmonary embolism (PE) • Pressure injuries ⸻ Recovery Area Patients may require: • PACU with prolonged observation • High Dependency Unit (HDU) • Intensive Care Unit (ICU) Depending on: • Severity of OSA/OHS • Cardiopulmonary disease • Extent of surgery • Requirement for postoperative ventilation ⸻ 2. Extubation Criteria Extubate only when the patient is: • Fully awake • Hemodynamically stable • Normothermic • Adequately ventilating • Fully reversed from neuromuscular blockade Neuromuscular recovery should be confirmed with monitoring. ⸻ Position During Extubation Preferred positions: • Sitting • Semi-upright • Head-up These positions: • Improve FRC • Reduce airway collapse • Improve oxygenation Avoid extubation in the fully supine position whenever possible. ⸻ Immediate Post-extubation Care • Supplemental oxygen • Continuous pulse oximetry • Observe for airway obstruction • Monitor respiratory rate • Monitor level of consciousness • Monitor for hypoventilation ⸻ 3. Oxygen Therapy Provide supplemental oxygen as required. Important consideration in OSA: • Oxygen may correct hypoxemia while masking recurrent apnea. • Continue close respiratory monitoring. ⸻ 4. Non-Invasive Ventilation (NIV) Continuous Positive Airway Pressure (CPAP) Mechanism • Pneumatic splint to upper airway • Prevents pharyngeal collapse • Improves lung compliance • Improves Functional Residual Capacity (FRC) ⸻ Indications • Continue postoperatively in patients already using CPAP. • Consider CPAP for high-risk patients for several postoperative nights. ⸻ Benefits • Reduces airway obstruction • Improves oxygenation • Decreases postoperative respiratory complications • Improves postoperative recovery • Reduces hospital stay ⸻ Bi-level Positive Airway Pressure (BiPAP) Features • Separate inspiratory and expiratory pressures • Better tolerated in some patients Benefits • Improves ventilation • Improves oxygenation • Useful in selected OHS patients ⸻ 5. Management of OSA (ASA Principles) General Principles • Avoid sedatives whenever possible. • Minimize opioid use. • Prefer short-acting anesthetic agents. • Use capnography during sedation. • Continue perioperative CPAP. • Extubate fully awake. ⸻ 6. Postoperative Analgesia Goals • Adequate pain relief • Early mobilization • Preservation of respiratory function • Reduction of opioid-related respiratory depression ⸻ Multimodal Analgesia Preferred techniques: • Regional anesthesia • Epidural analgesia • Peripheral nerve blocks • Rectus sheath block • Wound infiltration • Paracetamol • NSAIDs (when appropriate) ⸻ Opioids Use cautiously because they may cause: • Airway obstruction • Apnea • Hypoventilation • Respiratory depression Avoid continuous opioid infusions whenever possible. Patient-controlled analgesia (PCA) may be used with careful monitoring. ⸻ Intramuscular Injections Avoid IM injections because obesity causes: • Delayed absorption • Unpredictable absorption • Variable pharmacokinetics ⸻ NSAIDs Effective opioid-sparing agents. Use cautiously in: • Diabetic nephropathy • Patients with increased intra-abdominal pressure (e.g., laparoscopy) ⸻ Paracetamol • Standard dosing • Increased dosing frequency may be considered when appropriate ⸻ TENS May reduce opioid requirement as part of multimodal analgesia. ⸻ 7. Venous Thromboembolism (VTE) Prophylaxis Risk Factors • Obesity • Surgery • Immobility • OSA • Hypercoagulable state ⸻ Mechanical Prophylaxis • Compression stockings • Flow boots • Calf pumps • Intermittent Pneumatic Compression Device (IPCD) Continue intraoperatively and postoperatively. ⸻ IPCD Mechanism • Simulates calf muscle pump • Improves venous return • Promotes fibrinolysis ⸻ Contraindications to IPCD • Acute DVT • Severe peripheral vascular disease • Pulmonary edema ⸻ Pharmacological Prophylaxis • Low Molecular Weight Heparin (LMWH) • Unfractionated Heparin Continue until the patient is fully ambulatory according to surgical protocol. ⸻ 8. Early Mobilization Benefits: • Reduces DVT • Reduces pulmonary embolism • Prevents atelectasis • Improves respiratory function • Accelerates recovery Useful aid: • Trapeze bars to facilitate movement ⸻ 9. Glucose Control Surgical stress produces: • Increased catabolism • Increased insulin requirement Maintain: • Normoglycemia Benefits: • Reduced surgical site infection • Reduced myocardial infarction risk • Improved wound healing ⸻ 10. Pressure Area Care Protect pressure points: • Sacrum • Heels • Buttocks • Shoulders • Back Prevent: • Pressure sores • Nerve injury • Compartment syndrome • Rhabdomyolysis ⸻ 11. Postoperative Monitoring Monitor: • SpO₂ • Respiratory rate • Heart rate • Blood pressure • ETCO₂ (when indicated) • Pain score • Urine output • Consciousness level Patients with severe OSA/OHS require prolonged observation. ⸻ 12. Obese Children General Points • Increasing prevalence of childhood obesity. • Respiratory physiology is affected despite fewer comorbidities than adults. • Anesthetic risk increases with increasing BMI. ⸻ Important Features Compared with adults: • Fewer chronic systemic diseases • Reduced pulmonary reserve • Greater risk of perioperative respiratory complications ⸻ 13. Key Postoperative Pearls • Extubate only when fully awake. • Prefer head-up or semi-upright position for extubation and recovery. • Continue CPAP/BiPAP in patients who were using it preoperatively. • Avoid excessive opioid use. • Regional techniques reduce opioid-related respiratory depression. • Early mobilization is essential to reduce DVT, PE, and atelectasis. • Continuous postoperative respiratory monitoring is particularly important in patients with OSA/OHS. • Maintain normoglycemia to reduce postoperative infection and cardiovascular complications. ⸻ End of Part 4 ANAESTHESIA AND MORBID OBESITY – MASTER NOTES PART 5 – Special Situations, Bariatric Surgery, Obstetric Anaesthesia, Day-Care Surgery, CPR, Guidelines & Exam Pearls ⸻ 1. Bariatric Surgery Types of Bariatric Surgery A. Restrictive Procedures • Sleeve gastrectomy • Adjustable gastric band B. Combined Restrictive and Malabsorptive Procedure • Roux-en-Y gastric bypass C. Malabsorptive Procedure • Biliopancreatic diversion ⸻ Benefits of Bariatric Surgery Produces significant weight reduction and improves: • Diabetes mellitus • Obstructive sleep apnea (OSA) • Hypertension ⸻ Anaesthetic Considerations • Difficult airway • Rapid desaturation • Increased aspiration risk • Altered pharmacokinetics • Need for meticulous positioning • Careful VTE prophylaxis • Early postoperative mobilization ⸻ 2. Obese Obstetric Patients Anaesthetic Problems • Difficult airway • Rapid oxygen desaturation • Increased aspiration risk • Difficult neuraxial block • Difficult rapid sequence induction (RSI) • Large breasts • Short bulky neck ⸻ Regional Anaesthesia Preferred Technique Regional anaesthesia should be used whenever possible. ⸻ Advantages of Epidural Anaesthesia • Gradually titratable block • Less hypotension • Excellent postoperative analgesia ⸻ General Anaesthesia Concerns • Difficult mask ventilation • Difficult intubation • RSI challenges • Increased aspiration risk ⸻ Management • Thorough preoxygenation • Ramped/head-up positioning • Awake fibreoptic intubation if difficult airway anticipated • Short-handle laryngoscope when required • Difficult airway equipment immediately available ⸻ 3. Day-Care Surgery in Obese Patients Suitable Patients • BMI <40 kg/m² • Optimized comorbidities ⸻ Patients with OSA Suitable for ambulatory surgery only if: • Compliant with CPAP therapy • Minimal postoperative opioid requirement is expected ⸻ 4. Cardiopulmonary Resuscitation (CPR) Challenges • Difficult chest compressions • Difficult ventilation • Difficult IV access • Increased thoracic impedance ⸻ Recommendations • Standard ACLS drug doses • Maximal defibrillation energy when indicated • Intraosseous (IO) access if IV access is difficult ⸻ 5. AAGBI/SOBA Recommendations Preoperative • Identify OSA and metabolic syndrome. • Ensure availability of specialized bariatric equipment. • Assign an anaesthesiologist experienced in obesity management when appropriate. ⸻ Intraoperative • Use ramped positioning. • Have a robust difficult airway plan. • Avoid long-acting opioids. • Use neuromuscular monitoring routinely. ⸻ Postoperative • Early mobilization • Adequate VTE prophylaxis • ICU/HDU admission according to comorbidities and surgical risk ⸻ 6. Summary of Major Anaesthetic Principles Airway • Always anticipate difficult mask ventilation before difficult intubation. • Thorough airway assessment is essential. • Prepare a complete difficult airway strategy. • Awake fibreoptic intubation is preferred in anticipated difficult airway. • Video laryngoscopy is a valuable adjunct. ⸻ Oxygenation • Thorough preoxygenation with 100% oxygen. • Head-up/ramped positioning. • Use PEEP when appropriate. • Consider apneic oxygenation or THRIVE during difficult airway management. ⸻ Ventilation • Lung-protective ventilation • Moderate PEEP • Recruitment maneuvers • Continuous ETCO₂ monitoring • ABG when indicated ⸻ Drug Selection Prefer short-acting drugs: • Propofol • Remifentanil • Alfentanil • Sevoflurane • Desflurane • Atracurium • Cisatracurium Avoid prolonged effects from long-acting sedatives, opioids, and neuromuscular blocking drugs whenever possible. ⸻ Monitoring Standard monitoring: • ECG • NIBP • SpO₂ • ETCO₂ • Temperature Additional monitoring when indicated: • Arterial line • Central venous access • Cardiac output monitoring • Neuromuscular monitoring • Depth of anaesthesia monitoring ⸻ Regional Anaesthesia Advantages: • Avoids airway manipulation • Decreases opioid requirement • Improves postoperative analgesia • Facilitates early recovery Challenges: • Difficult landmarks • Increased neuraxial depth • Greater cephalad spread of local anaesthetic Reduce spinal/epidural local anaesthetic dose by approximately 20–25%. ⸻ Postoperative Care • Extubate fully awake. • Prefer head-up/semi-upright recovery. • Continue CPAP/BiPAP when indicated. • Continuous respiratory monitoring. • Multimodal analgesia. • Early mobilization. • Adequate thromboprophylaxis. • Maintain normoglycaemia. ⸻ 7. One-Line Exam Pearls • BMI is also called the Quetelet Index. • Android obesity has greater perioperative risk than gynoid obesity. • Morbidly obese patients desaturate rapidly because of decreased Functional Residual Capacity (FRC) and increased oxygen consumption. • Ramped (HELP) position aligns the external auditory meatus with the sternal notch and improves preoxygenation, mask ventilation, and laryngoscopy. • Obese patients tolerate the supine position poorly because of reduced FRC, increased closing volume, diaphragmatic splinting, atelectasis, V/Q mismatch, and hypoxemia. • Three minutes of tidal breathing with 100% oxygen is the preferred preoxygenation technique. • Apneic oxygenation and THRIVE prolong safe apnea time during intubation. • Awake fibreoptic intubation is the safest technique when a difficult airway is anticipated. • Always anticipate difficult mask ventilation before difficult intubation. • OSA causes upper airway obstruction during sleep, whereas OHS is characterized by daytime hypercapnia and hypoventilation. • Patients with OSA/OHS are highly sensitive to sedatives and opioids. • Polysomnography is the gold standard for diagnosing OSA. • STOP-BANG is the preferred screening tool for OSA. • Desflurane provides the fastest emergence among volatile anaesthetic agents. • Sevoflurane offers better haemodynamic stability and is preferred in patients with CAD and OSA. • Use short-acting anaesthetic agents whenever possible. • Drug dosing should be based on the appropriate weight scalar (TBW, IBW, or LBW), depending on the drug. • Neuromuscular monitoring is essential to prevent residual paralysis. • Regional anaesthesia reduces opioid-related respiratory depression but is technically more challenging. • Reduce spinal/epidural local anaesthetic dose by approximately 20–25% because of increased cephalad spread. • Extubate fully awake in the head-up or semi-upright position. • Continue CPAP/BiPAP perioperatively in appropriate patients. • Early mobilization and adequate VTE prophylaxis are essential. • Maintain normoglycaemia to reduce postoperative infection and cardiovascular complications. • Pressure-area protection is important to prevent pressure sores, nerve injury, compartment syndrome, rhabdomyolysis, and renal failure. ⸻ End of Master Notes – Anaesthesia and Morbid Obesity

Reading File
Running Command

mkdir -p /tmp/workspace/anaesthesia-obesity-notes && ls /tmp/workspace/

Writing File

~/anaesthesia-obesity-notes/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm, cm
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.platypus.flowables import Flowable
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os

# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a3557")
MED_BLUE    = colors.HexColor("#2563a8")
LIGHT_BLUE  = colors.HexColor("#dbeafe")
ACCENT_TEAL = colors.HexColor("#0e7490")
ACCENT_RED  = colors.HexColor("#b91c1c")
GOLD        = colors.HexColor("#b45309")
SOFT_GRAY   = colors.HexColor("#f1f5f9")
BORDER_GRAY = colors.HexColor("#cbd5e1")
WHITE       = colors.white
TEXT_DARK   = colors.HexColor("#1e293b")
TEXT_MED    = colors.HexColor("#334155")

# ── Output path ──────────────────────────────────────────────────────────────
OUTPUT = "/tmp/workspace/anaesthesia-obesity-notes/Anaesthesia_Morbid_Obesity_Master_Notes.pdf"

# ── Page geometry ────────────────────────────────────────────────────────────
PAGE_W, PAGE_H = A4
L_MARGIN = R_MARGIN = 2.0 * cm
T_MARGIN = 2.2 * cm
B_MARGIN = 2.0 * cm

# ── Header / Footer canvas callback ─────────────────────────────────────────
def on_page(canvas, doc):
    canvas.saveState()
    w, h = A4
    # Top coloured band
    canvas.setFillColor(DARK_BLUE)
    canvas.rect(0, h - 1.3*cm, w, 1.3*cm, fill=1, stroke=0)
    canvas.setFillColor(WHITE)
    canvas.setFont("Helvetica-Bold", 8)
    canvas.drawString(L_MARGIN, h - 0.85*cm, "ANAESTHESIA AND MORBID OBESITY – MASTER NOTES")
    canvas.setFont("Helvetica", 8)
    canvas.drawRightString(w - R_MARGIN, h - 0.85*cm, "Prepared for Medical Education")

    # Bottom footer
    canvas.setFillColor(SOFT_GRAY)
    canvas.rect(0, 0, w, 1.1*cm, fill=1, stroke=0)
    canvas.setStrokeColor(BORDER_GRAY)
    canvas.setLineWidth(0.4)
    canvas.line(0, 1.1*cm, w, 1.1*cm)
    canvas.setFillColor(TEXT_MED)
    canvas.setFont("Helvetica", 7.5)
    canvas.drawString(L_MARGIN, 0.45*cm, "For educational purposes only – not a substitute for clinical judgement")
    canvas.setFont("Helvetica-Bold", 8)
    canvas.drawRightString(w - R_MARGIN, 0.45*cm, f"Page {doc.page}")
    canvas.restoreState()

# ── Build styles ──────────────────────────────────────────────────────────────
def build_styles():
    s = {}

    # Cover title
    s["cover_main"] = ParagraphStyle(
        "cover_main", fontName="Helvetica-Bold", fontSize=26,
        textColor=WHITE, alignment=TA_CENTER, spaceAfter=6, leading=32)
    s["cover_sub"] = ParagraphStyle(
        "cover_sub", fontName="Helvetica", fontSize=13,
        textColor=colors.HexColor("#93c5fd"), alignment=TA_CENTER, spaceAfter=4)
    s["cover_tag"] = ParagraphStyle(
        "cover_tag", fontName="Helvetica-Oblique", fontSize=10,
        textColor=colors.HexColor("#bfdbfe"), alignment=TA_CENTER)

    # Part header (big section divider)
    s["part_title"] = ParagraphStyle(
        "part_title", fontName="Helvetica-Bold", fontSize=15,
        textColor=WHITE, alignment=TA_LEFT, spaceBefore=0, spaceAfter=0,
        leftIndent=0, leading=20)
    s["part_sub"] = ParagraphStyle(
        "part_sub", fontName="Helvetica", fontSize=9.5,
        textColor=colors.HexColor("#bfdbfe"), alignment=TA_LEFT,
        spaceBefore=2, spaceAfter=0, leading=13)

    # Section heading H1
    s["h1"] = ParagraphStyle(
        "h1", fontName="Helvetica-Bold", fontSize=12.5,
        textColor=WHITE, spaceBefore=14, spaceAfter=4,
        leftIndent=0, leading=16, backColor=MED_BLUE,
        borderPad=(5, 5, 5, 6))
    # H2
    s["h2"] = ParagraphStyle(
        "h2", fontName="Helvetica-Bold", fontSize=11,
        textColor=DARK_BLUE, spaceBefore=10, spaceAfter=3,
        leftIndent=0, leading=14, borderWidth=0,
        borderColor=MED_BLUE, borderPad=0)
    # H3
    s["h3"] = ParagraphStyle(
        "h3", fontName="Helvetica-BoldOblique", fontSize=10,
        textColor=ACCENT_TEAL, spaceBefore=7, spaceAfter=2,
        leftIndent=6, leading=13)
    # Body
    s["body"] = ParagraphStyle(
        "body", fontName="Helvetica", fontSize=9.5,
        textColor=TEXT_DARK, spaceBefore=2, spaceAfter=2,
        leftIndent=0, leading=14, alignment=TA_LEFT)
    # Bullet L1
    s["bullet1"] = ParagraphStyle(
        "bullet1", fontName="Helvetica", fontSize=9.5,
        textColor=TEXT_DARK, spaceBefore=1, spaceAfter=1,
        leftIndent=14, firstLineIndent=-10, leading=13)
    # Bullet L2
    s["bullet2"] = ParagraphStyle(
        "bullet2", fontName="Helvetica", fontSize=9,
        textColor=TEXT_MED, spaceBefore=1, spaceAfter=1,
        leftIndent=28, firstLineIndent=-10, leading=12)
    # Definition term
    s["def_term"] = ParagraphStyle(
        "def_term", fontName="Helvetica-Bold", fontSize=9.5,
        textColor=DARK_BLUE, spaceBefore=4, spaceAfter=1,
        leftIndent=0, leading=13)
    # Definition body (indented)
    s["def_body"] = ParagraphStyle(
        "def_body", fontName="Helvetica", fontSize=9.5,
        textColor=TEXT_DARK, spaceBefore=1, spaceAfter=1,
        leftIndent=16, leading=13)
    # Pearl / highlight box text
    s["pearl"] = ParagraphStyle(
        "pearl", fontName="Helvetica", fontSize=9,
        textColor=colors.HexColor("#7c3aed"), spaceBefore=2, spaceAfter=2,
        leftIndent=16, firstLineIndent=-12, leading=13)
    # Formula box
    s["formula"] = ParagraphStyle(
        "formula", fontName="Helvetica-Bold", fontSize=11,
        textColor=DARK_BLUE, spaceBefore=4, spaceAfter=4,
        alignment=TA_CENTER, leading=16,
        backColor=colors.HexColor("#eff6ff"), borderPad=6)
    # Small caption
    s["caption"] = ParagraphStyle(
        "caption", fontName="Helvetica-Oblique", fontSize=8,
        textColor=colors.HexColor("#64748b"), spaceBefore=1, spaceAfter=4,
        alignment=TA_CENTER, leading=11)

    return s

# ── Helper: coloured section banner ─────────────────────────────────────────
def section_banner(text, sub=None, styles=None):
    """Returns a KeepTogether with a blue banner for a PART header."""
    items = []
    items.append(Spacer(1, 8))
    data = [[Paragraph(text, styles["part_title"])]]
    if sub:
        data.append([Paragraph(sub, styles["part_sub"])])
    t = Table(data, colWidths=[PAGE_W - L_MARGIN - R_MARGIN])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), DARK_BLUE),
        ("TOPPADDING",    (0, 0), (-1, -1), 10),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 10),
        ("LEFTPADDING",   (0, 0), (-1, -1), 14),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 14),
        ("ROUNDEDCORNERS", [4]),
    ]))
    items.append(t)
    items.append(Spacer(1, 8))
    return KeepTogether(items)

def h1_block(text, styles):
    """Blue pill heading."""
    t = Table([[Paragraph(f"  {text}", styles["h1"])]], colWidths=[PAGE_W - L_MARGIN - R_MARGIN])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), MED_BLUE),
        ("TOPPADDING",    (0, 0), (-1, -1), 6),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 6),
        ("LEFTPADDING",   (0, 0), (-1, -1), 10),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 10),
        ("ROUNDEDCORNERS", [3]),
    ]))
    return t

def h2_block(text, styles):
    items = []
    items.append(Spacer(1, 3))
    items.append(HRFlowable(width="100%", thickness=2, color=MED_BLUE, spaceAfter=2))
    items.append(Paragraph(text, styles["h2"]))
    return KeepTogether(items)

def bullet(text, styles, level=1):
    style = styles[f"bullet{level}"]
    dot = "\u2022" if level == 1 else "\u25e6"
    return Paragraph(f"{dot}&nbsp;&nbsp;{text}", style)

def pearl_box(items_list, styles):
    """Gold-bordered pearl/exam box."""
    rows = [[Paragraph("\u2605&nbsp;&nbsp;" + p, styles["pearl"])] for p in items_list]
    t = Table(rows, colWidths=[PAGE_W - L_MARGIN - R_MARGIN - 4])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, -1), colors.HexColor("#faf5ff")),
        ("LEFTPADDING",   (0, 0), (-1, -1), 10),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 10),
        ("TOPPADDING",    (0, 0), (-1, -1), 3),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 3),
        ("BOX", (0, 0), (-1, -1), 1.2, colors.HexColor("#7c3aed")),
        ("LINEBELOW", (0, 0), (-1, -2), 0.3, colors.HexColor("#e9d5ff")),
    ]))
    return t

def std_table(headers, rows, col_widths, styles):
    """Standard styled table."""
    full_w = PAGE_W - L_MARGIN - R_MARGIN
    data = [[Paragraph(f"<b>{h}</b>", styles["body"]) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(c), styles["body"]) for c in row])
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, 0), DARK_BLUE),
        ("TEXTCOLOR",     (0, 0), (-1, 0), WHITE),
        ("FONTNAME",      (0, 0), (-1, 0), "Helvetica-Bold"),
        ("FONTSIZE",      (0, 0), (-1, 0), 9.5),
        ("ROWBACKGROUNDS",(0, 1), (-1, -1), [WHITE, SOFT_GRAY]),
        ("FONTSIZE",      (0, 1), (-1, -1), 9),
        ("TOPPADDING",    (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("LEFTPADDING",   (0, 0), (-1, -1), 7),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 7),
        ("BOX",           (0, 0), (-1, -1), 0.8, BORDER_GRAY),
        ("INNERGRID",     (0, 0), (-1, -1), 0.4, BORDER_GRAY),
        ("ALIGN",         (0, 0), (-1, -1), "LEFT"),
        ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ]))
    return t

def teal_note(text, styles):
    t = Table([[Paragraph(f"<i>{text}</i>", styles["body"])]], colWidths=[PAGE_W - L_MARGIN - R_MARGIN])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, -1), colors.HexColor("#f0fdfa")),
        ("LEFTPADDING",   (0, 0), (-1, -1), 10),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 10),
        ("TOPPADDING",    (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("BOX",           (0, 0), (-1, -1), 1, ACCENT_TEAL),
    ]))
    return t

# ════════════════════════════════════════════════════════════════════════════
# BUILD STORY
# ════════════════════════════════════════════════════════════════════════════
def build_story(styles):
    story = []
    SP = lambda n=6: Spacer(1, n)

    # ────────────────────────────────────────────────────────────────────────
    # COVER PAGE
    # ────────────────────────────────────────────────────────────────────────
    story.append(Spacer(1, 3.5*cm))
    cover_bg = Table(
        [[Paragraph("ANAESTHESIA AND", styles["cover_main"])],
         [Paragraph("MORBID OBESITY", styles["cover_main"])],
         [Spacer(1, 8)],
         [Paragraph("MASTER NOTES", styles["cover_sub"])],
         [Spacer(1, 6)],
         [Paragraph("Parts 1 – 5  |  Complete Reference", styles["cover_tag"])],
         [Spacer(1, 10)],
         [Paragraph("Definition · Classification · Pathophysiology · Preoperative Assessment", styles["cover_tag"])],
         [Paragraph("Anaesthetic Management · Postoperative Care · Special Situations", styles["cover_tag"])],
        ],
        colWidths=[PAGE_W - 4*cm]
    )
    cover_bg.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, -1), DARK_BLUE),
        ("TOPPADDING",    (0, 0), (-1, -1), 8),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 8),
        ("LEFTPADDING",   (0, 0), (-1, -1), 28),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 28),
        ("ROUNDEDCORNERS", [8]),
    ]))
    story.append(cover_bg)
    story.append(Spacer(1, 1.5*cm))

    # TOC-style summary on cover
    toc_data = [
        [Paragraph("<b>Part</b>", styles["body"]), Paragraph("<b>Topic</b>", styles["body"])],
        ["Part 1", "Definition, BMI Classification, Causes, Pathophysiology & Systemic Changes"],
        ["Part 2", "Pre-Anaesthetic Assessment, OSA/OHS Evaluation, Investigations & Preparation"],
        ["Part 3", "Airway Management, Preoxygenation, Drug Dosing, Ventilation & Regional Anaesthesia"],
        ["Part 4", "Postoperative Management, NIV, VTE Prophylaxis, Analgesia & Glucose Control"],
        ["Part 5", "Bariatric Surgery, Obstetric Anaesthesia, Day-Care, CPR & Exam Pearls"],
    ]
    toc = Table(toc_data, colWidths=[2.8*cm, PAGE_W - L_MARGIN - R_MARGIN - 2.8*cm])
    toc.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, 0), DARK_BLUE),
        ("TEXTCOLOR",     (0, 0), (-1, 0), WHITE),
        ("FONTNAME",      (0, 0), (-1, 0), "Helvetica-Bold"),
        ("ROWBACKGROUNDS",(0, 1), (-1, -1), [WHITE, SOFT_GRAY]),
        ("FONTNAME",      (0, 1), (0, -1), "Helvetica-Bold"),
        ("TEXTCOLOR",     (0, 1), (0, -1), MED_BLUE),
        ("FONTSIZE",      (0, 0), (-1, -1), 9.5),
        ("TOPPADDING",    (0, 0), (-1, -1), 6),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 6),
        ("LEFTPADDING",   (0, 0), (-1, -1), 8),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 8),
        ("BOX",           (0, 0), (-1, -1), 0.8, BORDER_GRAY),
        ("INNERGRID",     (0, 0), (-1, -1), 0.3, BORDER_GRAY),
    ]))
    story.append(toc)
    story.append(PageBreak())

    # ════════════════════════════════════════════════════════════════════════
    # PART 1
    # ════════════════════════════════════════════════════════════════════════
    story.append(section_banner(
        "PART 1",
        "Definition, Classification, Causes, Pathophysiology & Systemic Changes",
        styles))

    # --- Definition of Obesity ---
    story.append(h1_block("Definition of Obesity", styles))
    story.append(SP(6))

    story.append(Paragraph("<b>General Definition</b>", styles["h3"]))
    story.append(bullet("Body weight >10% above ideal/expected weight, considering height, age, build, and sex.", styles))

    story.append(Paragraph("<b>By Body Fat Content</b>", styles["h3"]))
    story.append(bullet("Normal: 15–18% body weight as fat", styles))
    story.append(bullet("Obese:", styles))
    story.append(bullet("Male: ≥25% body fat", styles, 2))
    story.append(bullet("Female: ≥30% body fat", styles, 2))
    story.append(bullet("Morbid obesity: Actual body weight >200% of Ideal Body Weight (IBW)", styles))

    # --- BMI ---
    story.append(SP(8))
    story.append(h1_block("Body Mass Index (BMI)", styles))
    story.append(SP(6))

    story.append(Paragraph("<b>Definition</b>", styles["h3"]))
    story.append(bullet("Also called Quetelet Index", styles))
    story.append(bullet("Introduced by Lambert Adolphe Jacques Quetelet (1835)", styles))
    story.append(SP(6))

    # Formula box
    formula_t = Table([[Paragraph("BMI = Weight (kg) / Height² (m²)", styles["formula"])]],
                      colWidths=[PAGE_W - L_MARGIN - R_MARGIN])
    formula_t.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, -1), LIGHT_BLUE),
        ("BOX",           (0, 0), (-1, -1), 1.5, MED_BLUE),
        ("TOPPADDING",    (0, 0), (-1, -1), 10),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 10),
        ("ROUNDEDCORNERS", [4]),
    ]))
    story.append(formula_t)
    story.append(SP(8))

    # BMI table
    story.append(Paragraph("<b>BMI Classification</b>", styles["h3"]))
    bmi_rows = [
        ("<18.5", "Underweight"),
        ("18.5–24.99", "Normal"),
        ("25–26.9", "Overweight"),
        ("27–30", "Mild Obesity"),
        (">30", "Moderate Obesity / Obese"),
        (">35", "Severe Obesity"),
        (">35 + comorbidity  OR  >40 without comorbidity", "Morbid Obesity"),
        (">50", "Super Obesity"),
        (">55", "Super-Morbid Obesity"),
    ]
    story.append(std_table(["BMI (kg/m²)", "Category"], bmi_rows,
                           [5*cm, PAGE_W - L_MARGIN - R_MARGIN - 5*cm], styles))
    story.append(SP(6))

    story.append(Paragraph("<b>Important Points</b>", styles["h3"]))
    story.append(bullet("Risk of perioperative complications increases sharply once BMI exceeds 30 kg/m².", styles))
    story.append(bullet("Android (central) obesity: Greater cardiovascular, metabolic, and airway risk.", styles))
    story.append(bullet("Gynoid (peripheral) obesity: Lower perioperative risk.", styles))

    # --- Causes ---
    story.append(SP(8))
    story.append(h1_block("Causes of Obesity", styles))
    story.append(SP(4))
    story.append(Paragraph("Obesity is multifactorial.", styles["body"]))
    story.append(bullet("Genetic factors", styles))
    story.append(bullet("Environmental factors", styles))
    story.append(bullet("Hormonal regulation – Leptin, Adiponectin, Ghrelin, Peptide YY", styles))
    story.append(SP(6))

    story.append(Paragraph("<b>Hormonal Changes</b>", styles["h3"]))
    story.append(Paragraph("<b>Leptin</b>", styles["def_term"]))
    story.append(bullet("Increased in obesity; leptin resistance develops", styles))
    story.append(bullet("Contributes to obesity hypoventilation syndrome by blunting ventilatory response to CO₂", styles))
    story.append(Paragraph("<b>Ghrelin</b>", styles["def_term"]))
    story.append(bullet("Falls after meals; signals satiety", styles))

    # --- Respiratory ---
    story.append(SP(8))
    story.append(h1_block("Respiratory System Changes", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Physiological Changes</b>", styles["h3"]))
    for item in [
        "Increased oxygen consumption",
        "Increased carbon dioxide production",
        "Decreased lung compliance",
        "Decreased chest wall compliance due to fat deposition",
        "Increased airway resistance (especially in supine position)",
        "Ventilation-perfusion mismatch",
        "Increased intrapulmonary shunt",
        "Restrictive ventilatory defect",
        "Decreased pulmonary reserve",
        "Rapid oxygen desaturation during apnea",
    ]:
        story.append(bullet(item, styles))

    story.append(SP(4))
    story.append(Paragraph("<b>Lung Volumes</b>", styles["h3"]))
    lv_rows = [
        ("FRC (Functional Residual Capacity)", "Decreased; may be <1 L when BMI >40"),
        ("FVC (Forced Vital Capacity)", "Decreased"),
        ("TLC (Total Lung Capacity)", "Decreased"),
        ("ERV (Expiratory Reserve Volume)", "Decreased"),
    ]
    story.append(std_table(["Volume", "Change in Obesity"], lv_rows,
                           [6*cm, PAGE_W - L_MARGIN - R_MARGIN - 6*cm], styles))

    story.append(SP(6))
    story.append(Paragraph("<b>Clinical Implications</b>", styles["h3"]))
    for item in ["Difficult ventilation", "Difficult oxygenation", "Faster desaturation"]:
        story.append(bullet(item, styles))
    story.append(bullet("Worsened by: General anaesthesia, Supine positioning, Postoperative pain", styles))

    # --- OSA ---
    story.append(SP(8))
    story.append(h1_block("Obstructive Sleep Apnoea (OSA)", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Definition</b>", styles["h3"]))
    story.append(Paragraph(
        "Repeated upper airway obstruction during sleep resulting in episodes of apnoea or hypopnoea.",
        styles["body"]))
    story.append(teal_note("Apnoea: Complete cessation of airflow for ≥10 seconds despite respiratory effort.", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Pathophysiology</b>", styles["h3"]))
    for item in [
        "Fat deposition in lateral pharyngeal walls → reduced pharyngeal patency",
        "Muscle relaxation and reduced upper airway tone during REM sleep",
        "Bernoulli effect contributes to airway collapse",
    ]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Clinical Features</b>", styles["h3"]))
    for item in ["Loud snoring", "Witnessed apnoea", "Nocturnal choking/gasping",
                 "Daytime somnolence", "Morning headaches", "Waking unrefreshed",
                 "Hypertension", "LVH", "RVH"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Complications</b>", styles["h3"]))
    for item in ["Hypoxaemia", "Polycythaemia", "Pulmonary hypertension", "Right ventricular failure (cor pulmonale)"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Anaesthetic Implications</b>", styles["h3"]))
    for item in [
        "Increased sensitivity to sedatives, opioids, and anaesthetic drugs",
        "Postoperative period is critical",
        "Oxygen therapy may mask apnoea without correcting hypoventilation",
        "Respiratory drive may become hypoxia-dependent rather than hypercapnia-dependent",
    ]:
        story.append(bullet(item, styles))

    # --- OHS ---
    story.append(SP(8))
    story.append(h1_block("Obesity Hypoventilation Syndrome (OHS) – Pickwickian Syndrome", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Definition (Triad)</b>", styles["h3"]))
    story.append(teal_note(
        "1. BMI >30 kg/m²  |  2. Daytime hypercapnia (PaCO₂ >45 mmHg / ≈5.9 kPa)  |  3. No alternative cause of hypoventilation",
        styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Pathophysiology</b>", styles["h3"]))
    for item in ["Blunted respiratory centre response", "Reduced chest wall compliance",
                 "Leptin resistance", "Blunted ventilatory response to CO₂"]:
        story.append(bullet(item, styles))

    # OSA vs OHS table
    story.append(SP(6))
    story.append(Paragraph("<b>Comparison: OSA vs OHS</b>", styles["h3"]))
    comp_rows = [
        ("Awake ventilation", "Normal", "Hypoventilation present"),
        ("Daytime PaCO₂", "Normal", ">45 mmHg"),
        ("Primary abnormality", "Upper airway obstruction", "Central hypoventilation + mechanical restriction"),
        ("Diagnosis", "Polysomnography", "ABG after excluding other causes"),
        ("Association", "Often coexists with OHS", ">90% also have OSA"),
    ]
    story.append(std_table(
        ["Feature", "OSA", "OHS"], comp_rows,
        [4.5*cm, 5.5*cm, PAGE_W - L_MARGIN - R_MARGIN - 10*cm], styles))

    # --- CVS ---
    story.append(SP(8))
    story.append(h1_block("Cardiovascular System", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Haemodynamic Changes</b>", styles["h3"]))
    for item in [
        "Increased blood volume (though lower per kg body weight)",
        "Increased cardiac output due to increased metabolic demand",
        "Cardiac output increases by 20–30 mL/min for every 1 kg fat gained above IBW",
        "Increase in cardiac output occurs mainly due to increased stroke volume, not heart rate",
    ]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Structural Cardiac Changes</b>", styles["h3"]))
    story.append(Paragraph("<u>Left Ventricle</u>", styles["def_term"]))
    for item in ["LV dilatation", "Eccentric hypertrophy", "Left ventricular hypertrophy",
                 "Diastolic dysfunction", "Progression to systolic dysfunction if hypertrophy fails"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<u>Left Atrium</u>", styles["def_term"]))
    for item in ["Left atrial enlargement due to: increased blood volume, increased venous return",
                 "Later: LV hypertrophy and diastolic dysfunction"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<u>Right Ventricle</u>", styles["def_term"]))
    story.append(bullet("Affected due to pulmonary hypertension, OSA, OHS, and increased haemodynamic burden", styles))

    story.append(SP(6))
    story.append(Paragraph("<b>Obesity Cardiomyopathy</b>", styles["h3"]))
    story.append(Paragraph(
        "Cardiomyopathy directly caused by obesity, independent of hypertension or structural heart disease.",
        styles["body"]))
    story.append(SP(4))

    story.append(Paragraph("<u>Fat Infiltration</u> – involves sinus node, AV node, right bundle branch, myocardium:", styles["def_term"]))
    for item in ["Sinoatrial block", "Bundle branch block", "AV block (rare)"]:
        story.append(bullet(item, styles))
    story.append(Paragraph("<u>Lipotoxicity</u>", styles["def_term"]))
    for item in ["Triglyceride accumulation within myocytes", "Adipokine-mediated myocardial injury"]:
        story.append(bullet(item, styles))
    story.append(Paragraph("<u>Haemodynamic Overload</u> → Diastolic and Systolic Dysfunction", styles["def_term"]))

    story.append(SP(4))
    story.append(Paragraph("<b>Hypertension in Obesity</b>", styles["h3"]))
    story.append(teal_note("Blood Pressure = Cardiac Output × Systemic Vascular Resistance", styles))
    for item in [
        "BP rises by approximately 6.5 mmHg for every 10% increase in body weight",
        "Increased SVR despite larger vascular bed – due to sympathetic overactivity, OSA/OHS, and inflammatory mediators (IL-6, Resistin, PAI-1)",
    ]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Arrhythmias</b>", styles["h3"]))
    story.append(bullet("Higher incidence of cardiac arrhythmias and sudden cardiac death", styles))
    story.append(bullet("Mechanisms: cardiac hypertrophy, fat infiltration, catecholamines, free fatty acids, OSA, drug effects", styles))

    # --- GI / Endocrine ---
    story.append(SP(8))
    story.append(h1_block("Gastrointestinal, Hepatic & Endocrine System", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Hepatic Changes</b>", styles["h3"]))
    for item in ["Fatty liver", "Non-alcoholic steatohepatitis (NASH)", "Cirrhosis"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Gastrointestinal Changes</b>", styles["h3"]))
    for item in ["Increased gastric acid secretion", "Increased gastric volume",
                 "Gastroesophageal reflux disease (GERD)", "Hiatus hernia", "⚠ Increased aspiration risk"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Endocrine</b>", styles["h3"]))
    for item in ["Insulin resistance", "High incidence of diabetes mellitus",
                 "Tight perioperative glycaemic control is important but difficult"]:
        story.append(bullet(item, styles))

    # --- Comorbidities table ---
    story.append(SP(8))
    story.append(h1_block("Other Comorbidities Associated with Obesity", styles))
    story.append(SP(4))
    comorbid_rows = [
        ("Cardiac", "Hypertension, atherosclerosis, CAD, cardiac failure"),
        ("Respiratory", "OSA, OHS, asthma, pulmonary embolism, pulmonary hypertension"),
        ("Endocrine", "Diabetes mellitus, gout, glomerulosclerosis"),
        ("Hepatic", "Fatty liver, cholelithiasis"),
        ("Vascular", "Varicose veins, DVT"),
        ("Skeletal", "Degenerative arthritis, carpal tunnel syndrome"),
        ("Oncology", "Endometrial, breast, prostate, and colon cancers"),
    ]
    story.append(std_table(["System", "Associated Conditions"], comorbid_rows,
                           [3.5*cm, PAGE_W - L_MARGIN - R_MARGIN - 3.5*cm], styles))

    # --- Exam Pearls Part 1 ---
    story.append(SP(8))
    story.append(h1_block("Key Exam Pearls – Part 1", styles))
    story.append(SP(4))
    p1_pearls = [
        "BMI is also called the Quetelet Index.",
        "Android obesity carries higher perioperative risk than gynoid obesity.",
        "Morbidly obese patients desaturate rapidly because of decreased FRC and increased oxygen consumption.",
        "OSA is due to upper airway collapse during sleep; OHS is characterized by daytime hypoventilation with hypercapnia.",
        "Obesity cardiomyopathy can occur without hypertension or coronary artery disease.",
        "Obesity is an independent risk factor for CAD, hypertension, arrhythmias, and sudden cardiac death.",
        "Fatty liver, GERD, and increased gastric volume contribute to a high aspiration risk.",
    ]
    story.append(pearl_box(p1_pearls, styles))
    story.append(PageBreak())

    # ════════════════════════════════════════════════════════════════════════
    # PART 2
    # ════════════════════════════════════════════════════════════════════════
    story.append(section_banner(
        "PART 2",
        "Pre-Anaesthetic Assessment, OSA/OHS Evaluation, Investigations, Risk Stratification & Preoperative Preparation",
        styles))

    story.append(h1_block("Preanaesthesia Check-up (PAC)", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Objectives of Preoperative Assessment</b>", styles["h3"]))
    for item in [
        "Identify obesity-related comorbidities",
        "Assess airway difficulty",
        "Evaluate respiratory reserve",
        "Assess cardiovascular function",
        "Identify OSA/OHS",
        "Assess aspiration risk",
        "Evaluate venous access and monitoring requirements",
        "Plan perioperative optimisation and postoperative care",
    ]:
        story.append(bullet(item, styles))

    story.append(SP(6))
    story.append(h1_block("Detailed History", styles))
    story.append(SP(4))

    for section_title, items in [
        ("1. Diabetes Mellitus Symptoms", [
            "Polyuria, polydipsia, nocturia",
            "Recurrent infections (skin, conjunctiva, urinary tract)",
            "Blurred vision, irritability, neuropathy, slow wound healing",
        ]),
        ("2. OSA Screening Questions", [
            "Habitual loud snoring",
            "Witnessed apnoea",
            "Daytime sleepiness",
            "Morning headaches",
            "Nocturnal choking/gasping",
            "Waking unrefreshed",
            "Ability to lie supine – sleeping in sitting position suggests severe OSA/OHS",
        ]),
        ("3. Respiratory Function", [
            "Dyspnoea, hypoventilation",
            "Oxygen desaturation on lying supine",
            "Reduced exercise tolerance",
        ]),
        ("4. Cardiac Symptoms", [
            "Hypertension, ischaemic heart disease",
            "Congestive heart failure, pulmonary hypertension, arrhythmias",
        ]),
        ("5. Gastrointestinal", [
            "Gastroesophageal reflux, heartburn",
            "Hiatus hernia – symptoms suggesting increased aspiration risk",
        ]),
        ("6. Drug History", [
            "Appetite suppressants (amphetamine derivatives)",
            "Antihypertensives, antidiabetic drugs",
            "CPAP use, anticoagulants",
        ]),
    ]:
        story.append(Paragraph(f"<b>{section_title}</b>", styles["h3"]))
        for item in items:
            story.append(bullet(item, styles))

    story.append(SP(8))
    story.append(h1_block("Physical Examination", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Airway Assessment</b>", styles["h3"]))
    for item in ["Mallampati grading", "Mouth opening", "Thyromental distance",
                 "Neck mobility", "Mandibular mobility", "Presence of excess pharyngeal tissue"]:
        story.append(bullet(item, styles))
    story.append(teal_note(
        "Neck Circumference: ≥17 inches (43 cm) in males  |  ≥16 inches (41 cm) in females  →  Suggests difficult airway + increased OSA risk",
        styles))

    story.append(SP(8))
    story.append(h1_block("STOP-BANG Questionnaire", styles))
    story.append(SP(4))
    sb_rows = [
        ("S", "Loud <b>S</b>noring"),
        ("T", "Daytime <b>T</b>iredness/sleepiness"),
        ("O", "<b>O</b>bserved apnoea/choking"),
        ("P", "Hy<b>p</b>ertension"),
        ("B", "<b>B</b>MI >35 kg/m²"),
        ("A", "<b>A</b>ge >50 years"),
        ("N", "<b>N</b>eck circumference >43 cm (M) / >41 cm (F)"),
        ("G", "Male <b>G</b>ender"),
    ]
    # Render bold within cells
    sb_data = [
        [Paragraph("<b>Letter</b>", styles["body"]), Paragraph("<b>Criterion</b>", styles["body"])]
    ] + [
        [Paragraph(f"<b>{r[0]}</b>", styles["body"]), Paragraph(r[1], styles["body"])]
        for r in sb_rows
    ]
    sb_t = Table(sb_data, colWidths=[1.5*cm, PAGE_W - L_MARGIN - R_MARGIN - 1.5*cm])
    sb_t.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, 0), DARK_BLUE),
        ("TEXTCOLOR",     (0, 0), (-1, 0), WHITE),
        ("FONTNAME",      (0, 0), (-1, 0), "Helvetica-Bold"),
        ("ROWBACKGROUNDS",(0, 1), (-1, -1), [WHITE, SOFT_GRAY]),
        ("FONTSIZE",      (0, 0), (-1, -1), 9.5),
        ("TOPPADDING",    (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("LEFTPADDING",   (0, 0), (-1, -1), 8),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 8),
        ("BOX",           (0, 0), (-1, -1), 0.8, BORDER_GRAY),
        ("INNERGRID",     (0, 0), (-1, -1), 0.4, BORDER_GRAY),
        ("ALIGN",         (0, 0), (0, -1), "CENTER"),
    ]))
    story.append(sb_t)
    story.append(SP(4))
    story.append(bullet("Score ≥3 = High risk of OSA  |  Score ≥5 = Very high risk", styles))
    story.append(bullet("Sensitivity ≈90%  |  Specificity ≈28%  |  PPV ≈85%", styles))

    story.append(SP(8))
    story.append(h1_block("Diagnosis of OSA – Polysomnography (PSG)", styles))
    story.append(SP(4))
    story.append(teal_note("Polysomnography (PSG) is the Gold Standard for diagnosing OSA.", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Parameters Monitored</b>", styles["h3"]))
    story.append(bullet("SpO₂, ECG, EEG, EOG, EMG, Nasal/oral airflow, Respiratory effort, Snoring, Limb movements", styles))

    story.append(Paragraph("<b>PSG Detects</b>", styles["h3"]))
    for item in ["Sleep architecture", "Apnoea/hypopnoea episodes and type",
                 "Oxygen desaturation", "Cardiac arrhythmias", "REM-related disorders"]:
        story.append(bullet(item, styles))

    story.append(SP(6))
    story.append(h1_block("Apnoea-Hypopnoea Index (AHI)", styles))
    story.append(SP(4))
    story.append(Paragraph(
        "Number of apnoeas (complete cessation ≥10 sec) plus hypopnoeas (≥30% reduction in airflow with ≥3–4% O₂ desaturation) per hour of sleep. Also called: Respiratory Disturbance Index (RDI).",
        styles["body"]))
    story.append(SP(4))
    ahi_rows = [("<5", "Normal"), ("5–15", "Mild OSA"), ("15–30", "Moderate OSA"), (">30", "Severe OSA")]
    story.append(std_table(["AHI", "Severity"], ahi_rows,
                           [3*cm, PAGE_W - L_MARGIN - R_MARGIN - 3*cm], styles))
    story.append(SP(4))
    story.append(bullet("Higher AHI is associated with: sympathetic overactivity, endothelial dysfunction, hypertension, IHD, stroke, CHF", styles))

    story.append(SP(8))
    story.append(h1_block("Preoperative Investigations", styles))
    story.append(SP(4))

    inv_data = [
        ("Routine Lab", "CBC, RFT, LFT, Electrolytes, FBG, HbA1c, TFTs"),
        ("ABG", "Assess hypercapnia, hypoxaemia, baseline oxygenation, OHS"),
        ("PFTs", "Respiratory symptoms, abnormal airway exam, suspected obstruction"),
        ("Chest X-ray", "Cardiothoracic ratio, pulmonary congestion, chronic lung disease"),
        ("ECG", "Rhythm, LVH, RVH, ischaemia, cor pulmonale"),
        ("Echo (TTE)", "Systolic/diastolic function, chamber dilatation, valvular disease, PAH"),
        ("Stress Test", "Dobutamine stress echo or nuclear scan if ≥3 cardiac risk factors"),
        ("Cardiac Cath", "If stress test positive or CAD strongly suspected"),
        ("Polysomnography", "OSA suspected but not previously diagnosed"),
        ("Lower limb Doppler", "Thromboembolism assessment"),
    ]
    story.append(std_table(
        ["Investigation", "Purpose/Indication"], inv_data,
        [4*cm, PAGE_W - L_MARGIN - R_MARGIN - 4*cm], styles))

    story.append(SP(8))
    story.append(h1_block("ECG Findings in Morbid Obesity", styles))
    story.append(SP(4))
    for item in ["Low-voltage complexes", "LVH with/without strain", "Prolonged QT/QTc",
                 "Inferolateral T-wave abnormalities", "Right axis deviation",
                 "Right bundle branch block", "P pulmonale"]:
        story.append(bullet(item, styles))

    story.append(SP(8))
    story.append(h1_block("Surgical Risk Stratification – OS-MRS", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Obesity Surgery Mortality Risk Score (OS-MRS)</b>", styles["h3"]))
    story.append(Paragraph("1 point each for:", styles["body"]))
    for item in ["BMI >50 kg/m²", "Male gender", "Age >45 years", "Hypertension",
                 "Previous VTE/risk of pulmonary embolism",
                 "Sleep-disordered breathing (hypoventilation)", "Pulmonary hypertension", "Poor mobility"]:
        story.append(bullet(item, styles))
    story.append(SP(4))
    osmrs_rows = [("A", "0–1", "0.2–0.3%"), ("B", "2–3", "1.1–1.5%"), ("C", "4–5", "2.4–3.0%")]
    story.append(std_table(["Class", "Score", "Mortality"], osmrs_rows,
                           [2.5*cm, 3*cm, PAGE_W - L_MARGIN - R_MARGIN - 5.5*cm], styles))

    story.append(SP(8))
    story.append(h1_block("Preoperative Preparation", styles))
    story.append(SP(4))

    for section_title, items in [
        ("1. Respiratory Optimisation", [
            "Physiotherapy, breathing exercises, incentive spirometry",
            "Improve respiratory capacity and reduce atelectasis",
        ]),
        ("2. CPAP/BiPAP", [
            "Continue preoperative CPAP in patients already using it",
            "CPAP improves perioperative outcomes in OSA/OHS",
        ]),
        ("3. Glycaemic Optimisation", ["Optimise diabetes; maintain good perioperative glucose control"]),
        ("4. Blood Pressure Optimisation", ["Control hypertension before surgery"]),
        ("5. Anxiety Management", [
            "Reassurance and counselling",
            "Avoid sedatives and narcotics whenever possible",
            "If required, use only light premedication with careful monitoring",
        ]),
        ("6. Aspiration Prophylaxis", [
            "H₂ blockers (Ranitidine), Proton pump inhibitors, Sodium citrate, Metoclopramide",
            "Increased aspiration risk due to increased gastric volume and acidity",
        ]),
        ("7. DVT Prophylaxis", [
            "UFH 5,000 units SC before surgery then every 8–12 hours until ambulatory",
            "LMWH (e.g., enoxaparin)",
            "Compression stockings and pneumatic sequential compression devices",
        ]),
        ("8. Antibiotic Prophylaxis", ["Administer according to standard surgical guidelines"]),
        ("9. Avoid IM Injections", ["Unpredictable absorption and delayed uptake in obesity"]),
    ]:
        story.append(Paragraph(f"<b>{section_title}</b>", styles["h3"]))
        for item in items:
            story.append(bullet(item, styles))

    story.append(SP(6))
    story.append(Paragraph("<b>Role of Preoperative Weight Reduction</b>", styles["h3"]))
    story.append(bullet("Modest weight loss may: reduce liver size, improve diaphragmatic excursion, improve insulin sensitivity, reduce OSA severity", styles))
    story.append(bullet("Recommended: supervised hypocaloric diet with protein 1.5 g/kg IBW/day", styles))
    story.append(bullet("Risks: vitamin deficiencies (B1, B6, B12), electrolyte imbalance, arrhythmias, sudden cardiac death with rapid unsupervised weight loss", styles))
    story.append(PageBreak())

    # ════════════════════════════════════════════════════════════════════════
    # PART 3
    # ════════════════════════════════════════════════════════════════════════
    story.append(section_banner(
        "PART 3",
        "Airway Management, Preoxygenation, Positioning, Drug Dosing, Monitoring, Ventilation & Regional Anaesthesia",
        styles))

    story.append(h1_block("Principles of Anaesthetic Management", styles))
    story.append(SP(4))
    goals = [
        "Anticipate and manage difficult airway",
        "Maintain adequate oxygenation and ventilation",
        "Prevent rapid desaturation",
        "Maintain haemodynamic stability",
        "Optimise drug dosing according to body weight scalar",
        "Minimise aspiration risk",
        "Prevent residual neuromuscular blockade",
        "Reduce postoperative respiratory complications",
        "Provide effective multimodal analgesia",
    ]
    for g in goals:
        story.append(bullet(g, styles))

    story.append(SP(8))
    story.append(h1_block("Airway Management", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Why is Airway Difficult?</b>", styles["h3"]))
    for item in ["Short bulky neck", "Large neck circumference", "Excess pharyngeal tissue",
                 "Reduced mouth opening", "Limited neck extension", "Reduced mandibular mobility",
                 "Short thyromental distance", "Patients with OSA/OHS have even greater risk"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Difficult Airway Strategy – Always Prepare:</b>", styles["h3"]))
    for item in ["Difficult airway cart", "Video laryngoscope", "Fibreoptic bronchoscope",
                 "Surgical airway backup", "Second anaesthesiologist if available"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Preferred Airway Techniques</b>", styles["h3"]))
    story.append(bullet("Anticipated difficult airway: Awake fibreoptic intubation (preferred) + semi-recumbent/head-up position", styles))
    story.append(bullet("Majority: Asleep intubation with four-handed/two-person mask ventilation", styles))
    story.append(bullet("Rescue devices: LMA, Intubating LMA", styles))

    story.append(SP(8))
    story.append(h1_block("Positioning", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Ramped Position (HELP – Head-Elevated Laryngoscopy Position)</b>", styles["h3"]))
    story.append(teal_note(
        "Shoulders elevated so that external auditory meatus is aligned with the sternal notch.",
        styles))
    story.append(bullet("Benefits: Better laryngoscopic view, easier mask ventilation, improved preoxygenation, delays desaturation, facilitates intubation", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Head-Up / Reverse Trendelenburg (25–30°)</b>", styles["h3"]))
    story.append(bullet("Improves FRC, reduces diaphragmatic splinting, reduces atelectasis, delays hypoxaemia", styles))

    story.append(Paragraph("<b>Supine Position – Poorly Tolerated</b>", styles["h3"]))
    for item in ["Diaphragm displaced upwards", "Reduced FRC", "Increased closing volume",
                 "Airway closure", "Increased shunt", "Atelectasis", "Worsening V/Q mismatch", "Rapid hypoxaemia"]:
        story.append(bullet(item, styles))

    story.append(SP(8))
    story.append(h1_block("Preoxygenation", styles))
    story.append(SP(4))
    story.append(Paragraph("Administration of 100% oxygen before induction to replace nitrogen, increase oxygen reserve, and prolong safe apnoea time.", styles["body"]))
    story.append(SP(4))

    story.append(Paragraph("<b>Methods</b>", styles["h3"]))
    story.append(bullet("Preferred: 100% oxygen for 3 minutes with tidal breathing", styles))
    story.append(bullet("Alternative: 4–8 vital capacity breaths of 100% oxygen", styles))

    story.append(Paragraph("<b>Adjuncts to Preoxygenation</b>", styles["h3"]))
    story.append(bullet("PEEP/CPAP: improves FRC, prevents atelectasis, delays desaturation", styles))
    story.append(bullet("Apneic oxygenation: oxygen via nasal cannula or nasopharyngeal catheter at 15 L/min", styles))
    story.append(bullet("THRIVE (Transnasal Humidified Rapid Insufflation Ventilatory Exchange): provides high-flow humidified O₂, apnoeic oxygenation, CPAP effect, dead-space washout – prolongs safe apnoea time", styles))

    story.append(SP(8))
    story.append(h1_block("Pharmacokinetic Changes in Obesity", styles))
    story.append(SP(4))
    pk_rows = [
        ("↑ Adipose tissue", "↑ Volume of distribution for lipophilic drugs"),
        ("↑ Lean body mass", "Alters Vd of hydrophilic drugs"),
        ("↑ Blood volume & cardiac output", "↑ Drug clearance (some drugs)"),
        ("↓ Total body water (fraction)", "↓ Vd of hydrophilic drugs"),
        ("↑ α₁-acid glycoprotein", "↑ Binding of basic drugs → ↓ Free drug"),
        ("Albumin", "Usually unchanged"),
        ("↑ Renal blood flow, GFR & secretion", "↑ Renal clearance"),
        ("↓ Hepatic blood flow (in CHF)", "↓ Hepatic clearance of selected drugs"),
    ]
    story.append(std_table(
        ["Pharmacokinetic Change", "Effect"],
        pk_rows, [6.5*cm, PAGE_W - L_MARGIN - R_MARGIN - 6.5*cm], styles))

    story.append(SP(8))
    story.append(h1_block("Drug Dosing Weight Scalars", styles))
    story.append(SP(4))
    dose_rows = [
        ("Succinylcholine", "Total Body Weight (TBW)"),
        ("Rocuronium", "Total Body Weight (TBW)"),
        ("Midazolam", "Total Body Weight (TBW)"),
        ("Fentanyl", "Total Body Weight (TBW)"),
        ("Atracurium", "Total Body Weight (TBW)"),
        ("Propofol (induction)", "Ideal Body Weight (IBW)"),
        ("Propofol (infusion)", "Total Body Weight / Corrected Weight"),
        ("Thiopentone", "Ideal Body Weight (IBW)"),
        ("Morphine", "Ideal Body Weight (IBW)"),
        ("Remifentanil", "Ideal Body Weight (IBW)"),
        ("Vecuronium", "Ideal Body Weight (IBW)"),
        ("Cisatracurium", "Ideal Body Weight (IBW)"),
        ("Local anaesthetic (infiltration)", "Ideal Body Weight (IBW)"),
        ("Lipophilic drugs (benzodiazepines, barbiturates)", "Ideal Body Weight (IBW)"),
        ("Hydrophilic drugs", "Lean Body Weight (LBW) or IBW + 20%"),
        ("Spinal/Epidural LA", "Reduce dose by approximately 20–25%"),
    ]
    story.append(std_table(
        ["Drug / Drug Group", "Dosing Scalar"],
        dose_rows, [9*cm, PAGE_W - L_MARGIN - R_MARGIN - 9*cm], styles))

    story.append(SP(8))
    story.append(h1_block("Choice of Anaesthetic Agents", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Inhalational Agents</b>", styles["h3"]))
    agent_rows = [
        ("Desflurane", "Lowest blood-gas solubility, fastest emergence, rapid recovery"),
        ("Sevoflurane", "Good haemodynamic stability, preferred in CAD and OSA"),
        ("Isoflurane", "Less expensive, slower emergence"),
        ("Nitrous Oxide", "Rapid onset/recovery, analgesic – limited use due to reduced O₂ reserve"),
    ]
    story.append(std_table(["Agent", "Characteristics"], agent_rows,
                           [4*cm, PAGE_W - L_MARGIN - R_MARGIN - 4*cm], styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Preferred Short-Acting Drugs</b>", styles["h3"]))
    story.append(bullet("Propofol, Remifentanil, Alfentanil, Atracurium, Cisatracurium, Sevoflurane, Desflurane", styles))

    story.append(Paragraph("<b>Avoid Long-Acting Drugs</b>", styles["h3"]))
    story.append(bullet("Morphine, Diazepam, Pancuronium", styles))

    story.append(SP(8))
    story.append(h1_block("Intraoperative Ventilation Strategy", styles))
    story.append(SP(4))
    for item in ["IPPV usually required", "Low tidal volume (lung-protective ventilation)",
                 "Moderate PEEP", "Recruitment manoeuvres", "Higher FiO₂ during induction and as required",
                 "Continuous ETCO₂ monitoring", "ABG during prolonged surgery when indicated"]:
        story.append(bullet(item, styles))

    story.append(SP(8))
    story.append(h1_block("Regional Anaesthesia", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Advantages</b>", styles["h3"]))
    for item in ["Avoids airway manipulation", "Reduces opioid requirement",
                 "Better postoperative analgesia", "Earlier recovery",
                 "May reduce postoperative decline in lung volumes"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Challenges</b>", styles["h3"]))
    for item in ["Difficult landmarks", "Impalpable spinous processes",
                 "Increased depth to epidural/subarachnoid space", "False loss of resistance"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Physiological Changes Affecting Neuraxial Blocks</b>", styles["h3"]))
    for item in ["Increased epidural fat", "Decreased CSF volume", "Engorged epidural veins",
                 "Result: greater cephalad spread → reduce dose by 20–25%"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Helpful Measures</b>", styles["h3"]))
    story.append(bullet("Ultrasound guidance, longer spinal/epidural needles, nerve stimulator when appropriate", styles))

    story.append(SP(8))
    story.append(h1_block("Monitoring", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Standard ASA Monitoring</b>", styles["h3"]))
    story.append(bullet("ECG, NIBP, SpO₂, End-tidal CO₂, Temperature", styles))
    story.append(Paragraph("<b>Additional Monitoring (When Indicated)</b>", styles["h3"]))
    for item in ["Arterial line (major surgery, severe cardiopulmonary disease, expected haemodynamic changes)",
                 "Central venous access (difficult peripheral access, major surgery)",
                 "Neuromuscular monitoring – essential to prevent residual paralysis",
                 "Depth of anaesthesia monitoring",
                 "Cardiac output monitoring (FloTrac, PiCCO) in selected patients"]:
        story.append(bullet(item, styles))
    story.append(PageBreak())

    # ════════════════════════════════════════════════════════════════════════
    # PART 4
    # ════════════════════════════════════════════════════════════════════════
    story.append(section_banner(
        "PART 4",
        "Postoperative Management, OSA Care, Analgesia, NIV, VTE Prophylaxis, Glucose Control & Obese Children",
        styles))

    story.append(h1_block("Postoperative Care – Objectives", styles))
    story.append(SP(4))
    for item in ["Maintain airway patency", "Ensure adequate oxygenation and ventilation",
                 "Prevent respiratory complications", "Prevent venous thromboembolism",
                 "Provide effective analgesia with minimal opioid use",
                 "Encourage early mobilisation", "Maintain normoglycaemia"]:
        story.append(bullet(item, styles))

    story.append(SP(8))
    story.append(h1_block("Extubation", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Criteria – Extubate Only When:</b>", styles["h3"]))
    for item in ["Fully awake", "Haemodynamically stable", "Normothermic",
                 "Adequately ventilating", "Fully reversed from neuromuscular blockade"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Position During Extubation</b>", styles["h3"]))
    story.append(teal_note(
        "Preferred: Sitting / Semi-upright / Head-up  –  Improves FRC, reduces airway collapse, improves oxygenation",
        styles))

    story.append(SP(8))
    story.append(h1_block("Non-Invasive Ventilation (NIV)", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>CPAP (Continuous Positive Airway Pressure)</b>", styles["h3"]))
    story.append(bullet("Mechanism: pneumatic splint to upper airway; prevents pharyngeal collapse; improves FRC and lung compliance", styles))
    story.append(bullet("Continue postoperatively in patients already using CPAP", styles))
    story.append(bullet("Benefits: reduces airway obstruction, improves oxygenation, decreases postoperative respiratory complications, reduces hospital stay", styles))

    story.append(Paragraph("<b>BiPAP (Bi-level Positive Airway Pressure)</b>", styles["h3"]))
    story.append(bullet("Separate inspiratory and expiratory pressures; better tolerated in some patients", styles))
    story.append(bullet("Useful in selected OHS patients", styles))

    story.append(SP(8))
    story.append(h1_block("Postoperative Analgesia – Multimodal Approach", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Preferred Techniques</b>", styles["h3"]))
    for item in ["Regional anaesthesia", "Epidural analgesia", "Peripheral nerve blocks",
                 "Rectus sheath block", "Wound infiltration", "Paracetamol", "NSAIDs (when appropriate)"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Opioids – Use Cautiously</b>", styles["h3"]))
    story.append(bullet("May cause: airway obstruction, apnoea, hypoventilation, respiratory depression", styles))
    story.append(bullet("Avoid continuous opioid infusions whenever possible; PCA with careful monitoring if needed", styles))

    story.append(Paragraph("<b>Avoid IM Injections</b>", styles["h3"]))
    story.append(bullet("Delayed and unpredictable absorption in obesity", styles))

    story.append(Paragraph("<b>NSAIDs</b>", styles["h3"]))
    story.append(bullet("Effective opioid-sparing agents; use cautiously in diabetic nephropathy", styles))

    story.append(SP(8))
    story.append(h1_block("VTE Prophylaxis", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Mechanical Prophylaxis</b>", styles["h3"]))
    for item in ["Compression stockings", "Flow boots, calf pumps",
                 "Intermittent Pneumatic Compression Device (IPCD) – simulates calf muscle pump, improves venous return, promotes fibrinolysis",
                 "Continue intraoperatively and postoperatively"]:
        story.append(bullet(item, styles))
    story.append(Paragraph("<b>IPCD Contraindications</b>", styles["h3"]))
    story.append(bullet("Acute DVT, severe peripheral vascular disease, pulmonary oedema", styles))
    story.append(Paragraph("<b>Pharmacological Prophylaxis</b>", styles["h3"]))
    story.append(bullet("LMWH or Unfractionated Heparin – continue until fully ambulatory", styles))

    story.append(SP(8))
    story.append(h1_block("Glucose Control", styles))
    story.append(SP(4))
    story.append(bullet("Maintain normoglycaemia – surgical stress increases catabolism and insulin requirement", styles))
    story.append(bullet("Benefits: reduced surgical site infection, reduced MI risk, improved wound healing", styles))

    story.append(SP(8))
    story.append(h1_block("Pressure Area Care", styles))
    story.append(SP(4))
    story.append(bullet("Protect: sacrum, heels, buttocks, shoulders, back", styles))
    story.append(bullet("Prevent: pressure sores, nerve injury, compartment syndrome, rhabdomyolysis, renal failure", styles))

    story.append(SP(8))
    story.append(h1_block("Obese Children", styles))
    story.append(SP(4))
    story.append(bullet("Increasing prevalence of childhood obesity", styles))
    story.append(bullet("Compared with adults: fewer chronic diseases but reduced pulmonary reserve and greater risk of perioperative respiratory complications", styles))
    story.append(bullet("Anaesthetic risk increases with increasing BMI", styles))

    story.append(SP(8))
    story.append(h1_block("Early Mobilisation", styles))
    story.append(SP(4))
    story.append(bullet("Reduces DVT, PE, atelectasis; improves respiratory function; accelerates recovery", styles))
    story.append(bullet("Trapeze bars may facilitate movement", styles))
    story.append(PageBreak())

    # ════════════════════════════════════════════════════════════════════════
    # PART 5
    # ════════════════════════════════════════════════════════════════════════
    story.append(section_banner(
        "PART 5",
        "Special Situations, Bariatric Surgery, Obstetric Anaesthesia, Day-Care, CPR, Guidelines & Exam Pearls",
        styles))

    story.append(h1_block("Bariatric Surgery", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Types of Bariatric Surgery</b>", styles["h3"]))
    bs_rows = [
        ("Restrictive", "Sleeve gastrectomy, Adjustable gastric band"),
        ("Restrictive + Malabsorptive", "Roux-en-Y gastric bypass"),
        ("Malabsorptive", "Biliopancreatic diversion"),
    ]
    story.append(std_table(["Category", "Procedure"], bs_rows,
                           [5*cm, PAGE_W - L_MARGIN - R_MARGIN - 5*cm], styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Benefits</b>", styles["h3"]))
    story.append(bullet("Significant weight reduction; improves diabetes mellitus, OSA, and hypertension", styles))

    story.append(Paragraph("<b>Anaesthetic Considerations</b>", styles["h3"]))
    for item in ["Difficult airway", "Rapid desaturation", "Increased aspiration risk",
                 "Altered pharmacokinetics", "Meticulous positioning", "Careful VTE prophylaxis",
                 "Early postoperative mobilisation"]:
        story.append(bullet(item, styles))

    story.append(SP(8))
    story.append(h1_block("Obese Obstetric Patients", styles))
    story.append(SP(4))

    story.append(Paragraph("<b>Anaesthetic Problems</b>", styles["h3"]))
    for item in ["Difficult airway", "Rapid oxygen desaturation", "Increased aspiration risk",
                 "Difficult neuraxial block", "Difficult RSI", "Large breasts", "Short bulky neck"]:
        story.append(bullet(item, styles))

    story.append(Paragraph("<b>Regional Anaesthesia (Preferred)</b>", styles["h3"]))
    story.append(bullet("Epidural: gradually titratable block, less hypotension, excellent postoperative analgesia", styles))

    story.append(Paragraph("<b>General Anaesthesia – Key Points</b>", styles["h3"]))
    for item in ["Thorough preoxygenation", "Ramped/head-up positioning",
                 "Awake fibreoptic intubation if difficult airway anticipated",
                 "Short-handle laryngoscope when required", "Difficult airway equipment immediately available"]:
        story.append(bullet(item, styles))

    story.append(SP(8))
    story.append(h1_block("Day-Care Surgery in Obese Patients", styles))
    story.append(SP(4))
    story.append(bullet("Suitable: BMI <40 kg/m² with optimised comorbidities", styles))
    story.append(bullet("OSA: suitable for ambulatory surgery only if compliant with CPAP and minimal postoperative opioid use expected", styles))

    story.append(SP(8))
    story.append(h1_block("Cardiopulmonary Resuscitation (CPR)", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Challenges</b>", styles["h3"]))
    for item in ["Difficult chest compressions", "Difficult ventilation", "Difficult IV access",
                 "Increased thoracic impedance"]:
        story.append(bullet(item, styles))
    story.append(Paragraph("<b>Recommendations</b>", styles["h3"]))
    story.append(bullet("Standard ACLS drug doses", styles))
    story.append(bullet("Maximal defibrillation energy when indicated", styles))
    story.append(bullet("Intraosseous (IO) access if IV access is difficult", styles))

    story.append(SP(8))
    story.append(h1_block("AAGBI/SOBA Recommendations", styles))
    story.append(SP(4))
    story.append(Paragraph("<b>Preoperative</b>", styles["h3"]))
    story.append(bullet("Identify OSA and metabolic syndrome", styles))
    story.append(bullet("Ensure availability of specialised bariatric equipment", styles))
    story.append(bullet("Assign an anaesthesiologist experienced in obesity management", styles))

    story.append(Paragraph("<b>Intraoperative</b>", styles["h3"]))
    story.append(bullet("Use ramped positioning; robust difficult airway plan", styles))
    story.append(bullet("Avoid long-acting opioids; use neuromuscular monitoring routinely", styles))

    story.append(Paragraph("<b>Postoperative</b>", styles["h3"]))
    story.append(bullet("Early mobilisation, adequate VTE prophylaxis", styles))
    story.append(bullet("ICU/HDU admission according to comorbidities and surgical risk", styles))

    story.append(SP(8))
    story.append(h1_block("Summary – Major Anaesthetic Principles", styles))
    story.append(SP(4))

    principle_data = [
        ("Airway", "Always anticipate difficult mask ventilation before difficult intubation. Awake fibreoptic intubation preferred when difficulty anticipated. Video laryngoscopy is a valuable adjunct."),
        ("Oxygenation", "3 min tidal breathing with 100% O₂. Ramped/head-up position. Use PEEP. Consider apnoeic oxygenation or THRIVE."),
        ("Ventilation", "Lung-protective ventilation. Moderate PEEP. Recruitment manoeuvres. Continuous ETCO₂. ABG when indicated."),
        ("Drugs", "Prefer short-acting agents: Propofol, Remifentanil, Atracurium, Cisatracurium, Sevoflurane, Desflurane. Dose by appropriate weight scalar."),
        ("Regional", "Reduces opioid-related respiratory depression. Reduce spinal/epidural LA dose by 20–25% (greater cephalad spread)."),
        ("Postoperative", "Extubate fully awake, head-up. Continue CPAP/BiPAP. Continuous respiratory monitoring. Multimodal analgesia. Early mobilisation. VTE prophylaxis. Normoglycaemia."),
    ]
    story.append(std_table(
        ["Principle", "Key Points"], principle_data,
        [3.5*cm, PAGE_W - L_MARGIN - R_MARGIN - 3.5*cm], styles))

    story.append(SP(10))
    story.append(h1_block("One-Line Exam Pearls – Master List", styles))
    story.append(SP(4))

    all_pearls = [
        "BMI is also called the Quetelet Index.",
        "Android obesity has greater perioperative risk than gynoid obesity.",
        "Morbidly obese patients desaturate rapidly because of decreased FRC and increased oxygen consumption.",
        "Ramped (HELP) position aligns the external auditory meatus with the sternal notch; improves preoxygenation, mask ventilation, and laryngoscopy.",
        "Obese patients tolerate the supine position poorly – reduced FRC, increased closing volume, diaphragmatic splinting, atelectasis, V/Q mismatch, hypoxaemia.",
        "Three minutes of tidal breathing with 100% oxygen is the preferred preoxygenation technique.",
        "Apnoeic oxygenation and THRIVE prolong safe apnoea time during intubation.",
        "Awake fibreoptic intubation is the safest technique when a difficult airway is anticipated.",
        "Always anticipate difficult mask ventilation before difficult intubation.",
        "OSA causes upper airway obstruction during sleep; OHS is characterised by daytime hypercapnia and hypoventilation.",
        "Patients with OSA/OHS are highly sensitive to sedatives and opioids.",
        "Polysomnography is the gold standard for diagnosing OSA.",
        "STOP-BANG is the preferred screening tool for OSA.",
        "Desflurane provides the fastest emergence among volatile anaesthetic agents.",
        "Sevoflurane offers better haemodynamic stability and is preferred in patients with CAD and OSA.",
        "Use short-acting anaesthetic agents whenever possible.",
        "Drug dosing should be based on the appropriate weight scalar (TBW, IBW, or LBW) depending on the drug.",
        "Neuromuscular monitoring is essential to prevent residual paralysis.",
        "Regional anaesthesia reduces opioid-related respiratory depression but is technically more challenging.",
        "Reduce spinal/epidural LA dose by approximately 20–25% because of increased cephalad spread.",
        "Extubate fully awake in the head-up or semi-upright position.",
        "Continue CPAP/BiPAP perioperatively in appropriate patients.",
        "Early mobilisation and adequate VTE prophylaxis are essential.",
        "Maintain normoglycaemia to reduce postoperative infection and cardiovascular complications.",
        "Pressure-area protection prevents pressure sores, nerve injury, compartment syndrome, rhabdomyolysis, and renal failure.",
    ]
    story.append(pearl_box(all_pearls, styles))

    # Final spacer
    story.append(Spacer(1, 1*cm))

    return story

# ════════════════════════════════════════════════════════════════════════════
# MAIN
# ════════════════════════════════════════════════════════════════════════════
def main():
    styles = build_styles()

    doc = SimpleDocTemplate(
        OUTPUT,
        pagesize=A4,
        leftMargin=L_MARGIN,
        rightMargin=R_MARGIN,
        topMargin=T_MARGIN + 1.3*cm,   # extra for header band
        bottomMargin=B_MARGIN + 1.1*cm, # extra for footer band
        title="Anaesthesia and Morbid Obesity – Master Notes",
        author="Medical Education",
        subject="Anaesthesiology",
    )

    story = build_story(styles)
    doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
    print(f"PDF created: {OUTPUT}")

if __name__ == "__main__":
    main()
Running Command

cd /tmp/workspace/anaesthesia-obesity-notes && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/anaesthesia-obesity-notes/Anaesthesia_Morbid_Obesity_Master_Notes.pdf

Your PDF is ready. Here's the download link:

Anaesthesia Morbid Obesity Master Notes

PDF Document · PDF


What's included in the PDF:
The document covers all 5 parts of your master notes with professional medical formatting:
  • Cover page with a table of contents summary listing all 5 parts
  • Running header (dark blue band) and footer with page numbers on every page
  • Part banners (dark blue section dividers) to clearly separate each part
  • Colour-coded headings - blue H1 banners, navy H2 underlined headers, teal H3 subheadings
  • Formatted tables for all classifications: BMI classification, OSA vs OHS comparison, AHI severity, Drug dosing scalars, OS-MRS risk stratification, Pharmacokinetic changes, Bariatric surgery types, and more
  • Teal info boxes for key definitions (e.g., HELP position, OHS triad, Apnoea definition)
  • Formula box for the BMI formula
  • STOP-BANG questionnaire as a styled table
  • Purple pearl boxes with star bullets for all exam pearls - including the full 25-point master pearl list at the end of Part 5
  • Bullet lists at two indent levels throughout for organised content
This is a shared conversation. Sign in to Orris to start your own chat.