Discuss the principles of day-care surgery..What are the selection criteria for "Day Care Surgery"? Explain the concept of 'Fastrack surgery".. is it same as Daycare? - from standard textbooks like sabiston/bailey/shwartz. kindly make it into a table/ memory aid in a downloadable pdf format
mkdir -p /tmp/workspace/daycare-surgery && ls /tmp/workspace/daycare-surgery/
cat << 'PYEOF' > /tmp/workspace/daycare-surgery/build_pdf.py from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.lib import colors from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether, PageBreak ) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY # ── Colour palette ────────────────────────────────────────────────────────── TEAL = colors.HexColor('#006D6F') TEAL_LIGHT = colors.HexColor('#E0F4F4') AMBER = colors.HexColor('#D97706') AMBER_LIGHT= colors.HexColor('#FEF3C7') BLUE_LIGHT = colors.HexColor('#EFF6FF') BLUE = colors.HexColor('#1D4ED8') RED_LIGHT = colors.HexColor('#FEF2F2') RED = colors.HexColor('#DC2626') GREEN_LIGHT= colors.HexColor('#F0FDF4') GREEN = colors.HexColor('#16A34A') PURPLE = colors.HexColor('#7C3AED') PURPLE_LIGHT= colors.HexColor('#F5F3FF') GREY = colors.HexColor('#F1F5F9') DGREY = colors.HexColor('#334155') WHITE = colors.white BLACK = colors.black # ── Document setup ─────────────────────────────────────────────────────────── doc = SimpleDocTemplate( '/tmp/workspace/daycare-surgery/DayCare_Surgery_Memory_Aid.pdf', pagesize=A4, leftMargin=1.8*cm, rightMargin=1.8*cm, topMargin=2*cm, bottomMargin=2*cm ) W = A4[0] - 3.6*cm # usable width styles = getSampleStyleSheet() # Custom styles H1 = ParagraphStyle('H1', parent=styles['Normal'], fontSize=18, textColor=WHITE, fontName='Helvetica-Bold', spaceAfter=4, spaceBefore=0, alignment=TA_CENTER) H2 = ParagraphStyle('H2', parent=styles['Normal'], fontSize=13, textColor=WHITE, fontName='Helvetica-Bold', spaceAfter=2, spaceBefore=0, alignment=TA_CENTER) H3 = ParagraphStyle('H3', parent=styles['Normal'], fontSize=11, textColor=TEAL, fontName='Helvetica-Bold', spaceAfter=4, spaceBefore=6) BODY = ParagraphStyle('BODY', parent=styles['Normal'], fontSize=9, textColor=DGREY, fontName='Helvetica', spaceAfter=3, spaceBefore=0, leading=13) BOLD = ParagraphStyle('BOLD', parent=styles['Normal'], fontSize=9, textColor=DGREY, fontName='Helvetica-Bold', spaceAfter=2, spaceBefore=0) SMALL = ParagraphStyle('SMALL', parent=styles['Normal'], fontSize=8, textColor=colors.HexColor('#64748B'), fontName='Helvetica', spaceAfter=2, spaceBefore=0, alignment=TA_CENTER) FOOT = ParagraphStyle('FOOT', parent=styles['Normal'], fontSize=7.5, textColor=colors.HexColor('#94A3B8'), fontName='Helvetica-Oblique', spaceAfter=0, spaceBefore=0, alignment=TA_CENTER) BULLET = ParagraphStyle('BULLET', parent=styles['Normal'], fontSize=9, textColor=DGREY, fontName='Helvetica', spaceAfter=2, spaceBefore=0, leftIndent=10, leading=12) CELL = ParagraphStyle('CELL', parent=styles['Normal'], fontSize=8.5, fontName='Helvetica', textColor=DGREY, leading=12) CELL_B = ParagraphStyle('CELL_B', parent=styles['Normal'], fontSize=8.5, fontName='Helvetica-Bold', textColor=DGREY, leading=12) CELL_HEAD = ParagraphStyle('CELL_HEAD', parent=styles['Normal'], fontSize=9, fontName='Helvetica-Bold', textColor=WHITE, leading=12, alignment=TA_CENTER) def header_box(text, bg=TEAL, style=H2, pad=0.25*cm): """Returns a 1-cell table that looks like a coloured section header.""" t = Table([[Paragraph(text, style)]], colWidths=[W]) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), bg), ('TOPPADDING', (0,0), (-1,-1), pad*40), ('BOTTOMPADDING', (0,0), (-1,-1), pad*40), ('LEFTPADDING', (0,0), (-1,-1), 8), ('RIGHTPADDING', (0,0), (-1,-1), 8), ('ROUNDEDCORNERS', [4,4,4,4]), ])) return t def section_rule(): return HRFlowable(width=W, thickness=1.5, color=TEAL_LIGHT, spaceAfter=4, spaceBefore=4) # ───────────────────────────────────────────────────────────────────────────── story = [] # ════════════════════════════ TITLE PAGE BLOCK ═════════════════════════════ title_data = [[Paragraph( '<font color="white"><b>Day-Care Surgery & Fast-Track Surgery</b></font>', ParagraphStyle('T', fontName='Helvetica-Bold', fontSize=20, textColor=WHITE, alignment=TA_CENTER, leading=26))]] title_table = Table(title_data, colWidths=[W]) title_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), TEAL), ('TOPPADDING', (0,0), (-1,-1), 16), ('BOTTOMPADDING', (0,0), (-1,-1), 16), ])) story.append(title_table) story.append(Spacer(1, 0.2*cm)) sub_data = [[Paragraph( '<font color="#334155">Principles • Selection Criteria • Fast-Track vs Day-Care<br/>' '<i>Based on Miller\'s Anesthesia 10e, Schwartz\'s Principles of Surgery 11e, ' 'Current Surgical Therapy 14e & Bailey & Love 28e</i></font>', ParagraphStyle('S', fontName='Helvetica', fontSize=9.5, textColor=DGREY, alignment=TA_CENTER, leading=14))]] sub_table = Table(sub_data, colWidths=[W]) sub_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), TEAL_LIGHT), ('TOPPADDING', (0,0), (-1,-1), 8), ('BOTTOMPADDING', (0,0), (-1,-1), 8), ])) story.append(sub_table) story.append(Spacer(1, 0.5*cm)) # ═══════════════════════════ SECTION 1: DEFINITION ═══════════════════════════ story.append(header_box('1. DEFINITION & HISTORICAL CONTEXT', TEAL)) story.append(Spacer(1, 0.15*cm)) def_data = [ [Paragraph('<b>IAAS Definition</b>', CELL_B), Paragraph('"A surgical day case is a patient admitted for investigation or operation on a ' 'planned non-resident basis who none the less requires facilities for recovery. ' 'The procedure should not require an overnight stay in a hospital bed."', CELL)], [Paragraph('<b>Key Requirement</b>', CELL_B), Paragraph('Intention of same-day discharge from the outset. Admission, operation, ' 'and discharge all occur on the same calendar day.', CELL)], [Paragraph('<b>Short-Stay Surgery</b>', CELL_B), Paragraph('Embraces same principles but allows ONE overnight stay. Used for patients ' 'with significant comorbidities, lack of social support, or late/extensive procedures.', CELL)], [Paragraph('<b>Historical Milestone</b>', CELL_B), Paragraph('James H. Nicoll, Glasgow (1898-1908): ~9,000 ambulatory procedures in children. ' 'First freestanding ASC: Phoenix, Arizona, 1970. Now ~80% of elective surgery in the USA.', CELL)], ] def_table = Table(def_data, colWidths=[3.5*cm, W-3.5*cm]) def_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (0,-1), TEAL_LIGHT), ('BACKGROUND', (1,0), (1,-1), WHITE), ('ROWBACKGROUNDS', (1,0), (1,-1), [WHITE, GREY]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ])) story.append(def_table) story.append(Spacer(1, 0.4*cm)) # ═══════════════════════════ SECTION 2: PRINCIPLES ══════════════════════════ story.append(header_box('2. PRINCIPLES OF DAY-CARE SURGERY', TEAL)) story.append(Spacer(1, 0.15*cm)) principle_data = [ [Paragraph('<b>PRINCIPLE</b>', CELL_HEAD), Paragraph('<b>DETAIL</b>', CELL_HEAD), Paragraph('<b>KEY POINT</b>', CELL_HEAD)], [Paragraph('1. Reduced Tissue Trauma', CELL_B), Paragraph('Minimally invasive techniques (laparoscopy, endoscopy, local/regional anaesthesia) ' 'to limit physiological disturbance', CELL), Paragraph('Less catabolism → faster recovery', CELL)], [Paragraph('2. Enhanced Recovery', CELL_B), Paragraph('Minimal adverse events; early mobilisation; early oral intake; avoidance ' 'of prolonged fasting', CELL), Paragraph('ERAS principles apply', CELL)], [Paragraph('3. Effective Analgesia', CELL_B), Paragraph('Multimodal opioid-sparing analgesia: paracetamol + NSAID + regional block ' '± local infiltration. Take-home analgesic packs', CELL), Paragraph('Avoid opioid-only regimens', CELL)], [Paragraph('4. PONV Control', CELL_B), Paragraph('Assess Apfel risk score. Combination prophylaxis for high-risk patients. ' '5-HT3 antagonist + dexamethasone ± scopolamine patch', CELL), Paragraph('PONV is leading cause of unanticipated admission', CELL)], [Paragraph('5. Patient Information', CELL_B), Paragraph('Written pre- and post-op instructions. 24-hour contact number. ' 'Early warning signs. Fasting instructions. Medication management', CELL), Paragraph('Informed patient = safer patient', CELL)], [Paragraph('6. Appropriate Selection', CELL_B), Paragraph('Procedure, patient fitness, social support and facility capabilities must all align. ' 'Dynamic, not rigid, selection process', CELL), Paragraph('See Selection Criteria table', CELL)], [Paragraph('7. Qualified Team', CELL_B), Paragraph('Anaesthesiologist as perioperative physician. Dedicated nursing staff. ' 'Protocol-driven discharge', CELL), Paragraph('ASA guidelines 2018', CELL)], [Paragraph('8. Cost-Efficiency', CELL_B), Paragraph('Elimination of overnight stay costs. ASC procedures cost 1/2 to 1/3 of ' 'hospital equivalents. Same reimbursement in many systems', CELL), Paragraph('Incentivises best practice', CELL)], [Paragraph('9. Patient Satisfaction', CELL_B), Paragraph('Home recovery in familiar environment preferred by patients. ' 'Reduced risk of hospital-acquired infection. Less disruption to routine', CELL), Paragraph('High satisfaction ratings sustained since 1970s', CELL)], [Paragraph('10. Safety Net', CELL_B), Paragraph('Written aftercare instructions, 24h telephone support, ' 'smartphone follow-up apps. Early symptom detection is better at home than inpatient', CELL), Paragraph('Ambulatory mortality <1:11,000 – better than general population', CELL)], ] col_w = [3.8*cm, (W-3.8*cm)*0.62, (W-3.8*cm)*0.38] princ_table = Table(principle_data, colWidths=col_w, repeatRows=1) princ_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), TEAL), ('ROWBACKGROUNDS', (0,1), (-1,-1), [BLUE_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(princ_table) story.append(Spacer(1, 0.4*cm)) # ══════════════════════════ SECTION 3: FACILITY TYPES ═══════════════════════ story.append(header_box('3. TYPES OF AMBULATORY SURGERY FACILITIES', AMBER)) story.append(Spacer(1, 0.15*cm)) fac_data = [ [Paragraph('<b>TYPE</b>', CELL_HEAD), Paragraph('<b>DESCRIPTION</b>', CELL_HEAD), Paragraph('<b>ADVANTAGE / DISADVANTAGE</b>', CELL_HEAD)], [Paragraph('Hospital Integrated', CELL_B), Paragraph('Shared inpatient OR; separate pre-op and recovery areas', CELL), Paragraph('+ Access to inpatient backup\n– Often inefficient; long waits', CELL)], [Paragraph('Hospital Satellite', CELL_B), Paragraph('Distinct unit within hospital campus', CELL), Paragraph('+ Efficient; dedicated staff\n– Requires more planning', CELL)], [Paragraph('Freestanding ASC', CELL_B), Paragraph('Independent centre, not on hospital grounds; first opened Phoenix 1970', CELL), Paragraph('+ Maximum efficiency & surgeon control; 1/2–1/3 cost\n– No inpatient backup on-site', CELL)], [Paragraph('Office-Based', CELL_B), Paragraph('Surgeon\'s office; minor/local/sedation procedures', CELL), Paragraph('+ Lowest overhead; most convenient\n– Highest adverse event rate if standards not met', CELL)], ] fac_table = Table(fac_data, colWidths=[3.2*cm, (W-3.2*cm)*0.5, (W-3.2*cm)*0.5], repeatRows=1) fac_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), AMBER), ('ROWBACKGROUNDS', (0,1), (-1,-1), [AMBER_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(fac_table) story.append(Spacer(1, 0.4*cm)) # ═══════════════════════ PAGE 2 – SELECTION CRITERIA ════════════════════════ story.append(PageBreak()) story.append(header_box('4. SELECTION CRITERIA FOR DAY-CARE SURGERY', RED)) story.append(Spacer(1, 0.15*cm)) story.append(Paragraph( 'Patient selection is a <b>dynamic, multi-factorial process</b> involving the triad: ' '<b>Procedure × Patient × Facility.</b> Absolute contraindications are now few.', ParagraphStyle('NOTE', fontName='Helvetica-Oblique', fontSize=9, textColor=DGREY, spaceAfter=6, spaceBefore=2, leftIndent=4))) # Sub-header: PATIENT FACTORS story.append(header_box(' PATIENT FACTORS ', colors.HexColor('#7C3AED'), H2, 0.15*cm)) story.append(Spacer(1, 0.1*cm)) pat_data = [ [Paragraph('<b>FACTOR</b>', CELL_HEAD), Paragraph('<b>SUITABLE (INCLUDE)</b>', CELL_HEAD), Paragraph('<b>CAUTION / EXCLUDE</b>', CELL_HEAD)], [Paragraph('ASA Status', CELL_B), Paragraph('ASA I–III (stable/optimised)\nASA III with controlled comorbidity', CELL), Paragraph('ASA IV (absolute contraindication to general anaesthesia)\nASA III unstable – defer until optimised', CELL)], [Paragraph('Cardiovascular', CELL_B), Paragraph('Stable IHD, well-controlled HTN, compensated HF', CELL), Paragraph('MI < 3 months, unstable angina, decompensated HF, severe valve disease, ' 'high-grade AV block, coronary stent <30 days', CELL)], [Paragraph('Respiratory', CELL_B), Paragraph('Stable asthma, COPD (well-controlled), OSA (moderate, no complex needs)', CELL), Paragraph('Acute respiratory illness, severe uncontrolled COPD, ' 'complex OSA requiring inpatient CPAP setup', CELL)], [Paragraph('Metabolic / Endocrine', CELL_B), Paragraph('Stable DM (patient self-manages), controlled thyroid disease', CELL), Paragraph('DKA, HHS, uncontrolled DM, end-stage renal disease not on regular dialysis', CELL)], [Paragraph('Neurological', CELL_B), Paragraph('Well-controlled epilepsy, stable Parkinson\'s, mild cognitive impairment', CELL), Paragraph('Recent CVA/TIA < 3 months, severe neurological condition', CELL)], [Paragraph('Age', CELL_B), Paragraph('No arbitrary age limit – age alone NOT a contraindication\nNon-frail elderly: suitable', CELL), Paragraph('Frailty (high frailty score) = relative contraindication\nPaediatric: neonates & ex-premature < 60 weeks PCA need extra caution', CELL)], [Paragraph('Obesity / BMI', CELL_B), Paragraph('BMI < 40: generally suitable with appropriate equipment\nBMI >40: not routinely excluded', CELL), Paragraph('Morbid obesity with OSA + difficult airway in isolated facility – caution\nObesity itself does NOT increase unanticipated admission rate', CELL)], [Paragraph('Coagulation', CELL_B), Paragraph('Stable anticoagulation (DOAC bridging or brief hold)', CELL), Paragraph('Bleeding disorders not adequately managed; active anticoagulation + high-bleed procedure', CELL)], ] pat_table = Table(pat_data, colWidths=[3*cm, (W-3*cm)*0.47, (W-3*cm)*0.53], repeatRows=1) pat_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), PURPLE), ('ROWBACKGROUNDS', (0,1), (-1,-1), [PURPLE_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(pat_table) story.append(Spacer(1, 0.35*cm)) # Sub-header: SURGICAL PROCEDURE FACTORS story.append(header_box(' PROCEDURE FACTORS ', RED, H2, 0.15*cm)) story.append(Spacer(1, 0.1*cm)) proc_data = [ [Paragraph('<b>CRITERION</b>', CELL_HEAD), Paragraph('<b>SUITABLE</b>', CELL_HEAD), Paragraph('<b>NOT SUITABLE</b>', CELL_HEAD)], [Paragraph('Duration', CELL_B), Paragraph('Typically < 2 hours (ideally 30-90 min)', CELL), Paragraph('> 3 hours (relative); late in the day + long = exclude', CELL)], [Paragraph('Blood Loss', CELL_B), Paragraph('Minimal anticipated blood loss, low transfusion risk', CELL), Paragraph('Significant expected haemorrhage requiring blood products', CELL)], [Paragraph('Pain Management', CELL_B), Paragraph('Controllable with oral multimodal analgesia post-op', CELL), Paragraph('Severe pain requiring IV opioid infusion/PCA overnight', CELL)], [Paragraph('Technique', CELL_B), Paragraph('Laparoscopic, endoscopic, local/regional anaesthesia preferred', CELL), Paragraph('Procedures requiring prolonged ICU/HDU monitoring post-op', CELL)], [Paragraph('Fluid/Electrolytes', CELL_B), Paragraph('No major fluid shifts anticipated', CELL), Paragraph('Procedures with significant 3rd-space loss or electrolyte disturbance', CELL)], [Paragraph('Examples – SUITABLE', CELL_B), Paragraph('Laparoscopic cholecystectomy, hernia repair (open/lap), ' 'arthroscopy, cataract, adenotonsillectomy (adult), ' 'diagnostic laparoscopy, varicose veins, minor plastic surgery, ' 'colonoscopy, ERCP, thyroid lobectomy (selected cases)', CELL), Paragraph('', CELL)], [Paragraph('Examples – NOT SUITABLE', CELL_B), Paragraph('', CELL), Paragraph('Major bowel resection, oesophagectomy, pneumonectomy, ' 'Whipple\'s procedure, cardiac surgery, major vascular surgery, ' 'pelvic exenteration', CELL)], ] proc_table = Table(proc_data, colWidths=[3*cm, (W-3*cm)*0.5, (W-3*cm)*0.5], repeatRows=1) proc_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), RED), ('ROWBACKGROUNDS', (0,1), (-1,-1), [RED_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(proc_table) story.append(Spacer(1, 0.35*cm)) # Sub-header: SOCIAL FACTORS story.append(header_box(' SOCIAL & LOGISTIC FACTORS ', GREEN, H2, 0.15*cm)) story.append(Spacer(1, 0.1*cm)) soc_data = [ [Paragraph('<b>FACTOR</b>', CELL_HEAD), Paragraph('<b>REQUIRED</b>', CELL_HEAD)], [Paragraph('Escort', CELL_B), Paragraph('Responsible adult to accompany and stay with patient for 24 hours post-op', CELL)], [Paragraph('Transport', CELL_B), Paragraph('Reliable transport home (not public transport alone within 24h of GA)', CELL)], [Paragraph('Communication', CELL_B), Paragraph('Patient (or carer) able to understand and comply with discharge instructions', CELL)], [Paragraph('Distance', CELL_B), Paragraph('Reasonable distance from hospital/emergency services (generally < 1 hour)', CELL)], [Paragraph('Home Environment', CELL_B), Paragraph('Safe home environment; telephone access; no living alone without carer', CELL)], [Paragraph('Follow-up', CELL_B), Paragraph('Ability to attend follow-up appointment; access to 24-hour emergency contact', CELL)], ] soc_table = Table(soc_data, colWidths=[3.5*cm, W-3.5*cm], repeatRows=1) soc_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), GREEN), ('ROWBACKGROUNDS', (0,1), (-1,-1), [GREEN_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(soc_table) story.append(Spacer(1, 0.4*cm)) # ═════════════════════════ PAGE 3 – DISCHARGE CRITERIA ══════════════════════ story.append(PageBreak()) story.append(header_box('5. DISCHARGE CRITERIA (Brigham & Women\'s Hospital / PADSS)', BLUE)) story.append(Spacer(1, 0.15*cm)) # Two-column layout for discharge criteria left_items = [ ('Alert & Oriented', 'Oriented to time and place'), ('Stable Vital Signs', 'No orthostatic hypotension; cardiovascular stability including on standing'), ('Pain Controlled', 'Managed by oral analgesia (not IV opioids)'), ('PONV Controlled', 'Nausea/vomiting mild or absent'), ('No Unexpected Bleeding', 'Wound/operative site acceptable'), ] right_items = [ ('Mobility', 'Able to walk without dizziness (procedure-dependent)'), ('Written Instructions', 'Patient/escort given written aftercare + prescriptions'), ('Patient Acceptance', 'Patient accepts readiness and is comfortable with discharge'), ('Adult Escort', 'Responsible adult present to accompany home'), ('Voiding', 'NOT mandatory for low-risk patients; bladder USS for high-risk (post-spinal)'), ] def make_disc_col(items, bg): rows = [[Paragraph('<b>CRITERION</b>', CELL_HEAD), Paragraph('<b>DETAIL</b>', CELL_HEAD)]] for crit, detail in items: rows.append([Paragraph(f'✓ {crit}', CELL_B), Paragraph(detail, CELL)]) cw = [(W/2-0.2*cm)*0.4, (W/2-0.2*cm)*0.6] t = Table(rows, colWidths=cw, repeatRows=1) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), bg), ('ROWBACKGROUNDS', (0,1), (-1,-1), [BLUE_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) return t disc_outer = Table( [[make_disc_col(left_items, BLUE), Spacer(0.4*cm, 0), make_disc_col(right_items, BLUE)]], colWidths=[W/2-0.2*cm, 0.4*cm, W/2-0.2*cm] ) disc_outer.setStyle(TableStyle([('VALIGN',(0,0),(-1,-1),'TOP')])) story.append(disc_outer) story.append(Spacer(1, 0.2*cm)) # PADSS scoring story.append(Paragraph('<b>Post-Anaesthetic Discharge Scoring System (PADSS) – Score ≥ 9/10 = fit for discharge</b>', ParagraphStyle('N', fontName='Helvetica-Bold', fontSize=9, textColor=BLUE, spaceAfter=4, spaceBefore=4))) padss_data = [ [Paragraph('<b>Parameter</b>', CELL_HEAD), Paragraph('<b>2 Points</b>', CELL_HEAD), Paragraph('<b>1 Point</b>', CELL_HEAD), Paragraph('<b>0 Points</b>', CELL_HEAD)], [Paragraph('Vital Signs', CELL_B), Paragraph('Within 20% of pre-op', CELL), Paragraph('20–40% of pre-op', CELL), Paragraph('>40% of pre-op', CELL)], [Paragraph('Activity / LOC', CELL_B), Paragraph('Steady gait, no dizziness', CELL), Paragraph('With assistance', CELL), Paragraph('None/dizziness', CELL)], [Paragraph('Nausea/Vomiting', CELL_B), Paragraph('Minimal', CELL), Paragraph('Moderate', CELL), Paragraph('Severe', CELL)], [Paragraph('Pain', CELL_B), Paragraph('Minimal VAS ≤3 (oral analgesia)', CELL), Paragraph('Moderate VAS 4–6', CELL), Paragraph('Severe VAS >7', CELL)], [Paragraph('Surgical Bleeding', CELL_B), Paragraph('Minimal', CELL), Paragraph('Moderate', CELL), Paragraph('Severe', CELL)], ] padss_cw = [3*cm, (W-3*cm)/3, (W-3*cm)/3, (W-3*cm)/3] padss_table = Table(padss_data, colWidths=padss_cw, repeatRows=1) padss_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), BLUE), ('ROWBACKGROUNDS', (0,1), (-1,-1), [BLUE_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(padss_table) story.append(Spacer(1, 0.4*cm)) # ═══════════════════════ SECTION 6: FAST-TRACK ══════════════════════════════ story.append(header_box('6. FAST-TRACK SURGERY – CONCEPT & COMPARISON', colors.HexColor('#0F766E'))) story.append(Spacer(1, 0.15*cm)) story.append(Paragraph( '<b>Fast-Track Surgery</b> (also called <b>Enhanced Recovery After Surgery – ERAS</b>) is a ' 'multimodal, evidence-based perioperative care pathway designed to attenuate the surgical ' 'stress response, accelerate return of normal function, and shorten hospital stay for <b>major ' 'surgical procedures</b> that have traditionally required prolonged hospitalisation.', ParagraphStyle('FT', fontName='Helvetica', fontSize=9.5, textColor=DGREY, spaceAfter=6, spaceBefore=2, leading=14))) story.append(Spacer(1, 0.15*cm)) # ─── IS FAST-TRACK = DAY-CARE? ───────────────────────────────────────────── story.append(Paragraph('<b>IS FAST-TRACK THE SAME AS DAY-CARE SURGERY?</b>', ParagraphStyle('Q', fontName='Helvetica-Bold', fontSize=10, textColor=colors.HexColor('#0F766E'), spaceAfter=4, spaceBefore=2))) comp_data = [ [Paragraph('<b>FEATURE</b>', CELL_HEAD), Paragraph('<b>DAY-CARE SURGERY</b>', CELL_HEAD), Paragraph('<b>FAST-TRACK / ERAS SURGERY</b>', CELL_HEAD)], [Paragraph('Definition', CELL_B), Paragraph('Admission, operation & discharge on the SAME day', CELL), Paragraph('Multimodal perioperative protocol to reduce stress response & shorten stay ' 'for major procedures', CELL)], [Paragraph('Overnight Stay', CELL_B), Paragraph('NO – zero overnight stay is the defining criterion', CELL), Paragraph('Usually YES – 1–3 days for major surgery (vs traditional 7–14 days)', CELL)], [Paragraph('Procedures', CELL_B), Paragraph('Minor to intermediate procedures\n(hernia, cholecystectomy, endoscopy, ' 'cataract, arthroscopy)', CELL), Paragraph('Major procedures: colorectal resection, liver surgery, oesophagectomy, ' 'cystectomy, pancreatectomy, hip/knee arthroplasty', CELL)], [Paragraph('Patient Complexity', CELL_B), Paragraph('Generally ASA I–III, controlled comorbidities', CELL), Paragraph('ASA I–IV; designed for complex patients undergoing major surgery', CELL)], [Paragraph('Primary Goal', CELL_B), Paragraph('Avoid hospitalisation entirely', CELL), Paragraph('Minimise length of stay; reduce complications; accelerate recovery', CELL)], [Paragraph('Analgesia Strategy', CELL_B), Paragraph('Short-acting drugs; oral multimodal; no PCA needed', CELL), Paragraph('Epidural / TAP block / PCA initially; transition to oral by Day 1–2', CELL)], [Paragraph('Key Anaesthetic Approach', CELL_B), Paragraph('Short-acting propofol TIVA or volatile; LMA preferred;\nfast wake-up essential', CELL), Paragraph('Regional preference; goal-directed fluid therapy; minimise opioids; ' 'normothermia; carbohydrate loading pre-op', CELL)], [Paragraph('Nutrition', CELL_B), Paragraph('Oral fluids 2h pre-op; solids 6h pre-op;\nresume diet same day post-op', CELL), Paragraph('Carbohydrate drink 2h pre-op; early enteral feeding within 24h', CELL)], [Paragraph('Relationship', CELL_B), Paragraph('ERAS principles NOW applied to day-care patients\n(ambulatory ERAS = modified protocol)', CELL), Paragraph('ERAS is the macro-framework; day-care is a specific outcome target\nFor ambulatory ERAS: same elements, modified for outpatient setting', CELL)], [Paragraph('Origin / History', CELL_B), Paragraph('Nicoll 1898; freestanding ASC 1970\nFormal guidelines: ASA 2003/2018', CELL), Paragraph('Kehlet (Denmark) 1997: "fast-track colonic surgery"\nERAS Society guidelines: 2005 onwards', CELL)], [Paragraph('ANSWER: Same?', CELL_B), Paragraph('<b>NO – they are related but distinct concepts.</b>\nFast-track/ERAS reduces stay for major surgery.\nDay-care eliminates stay for minor/intermediate surgery.\nModified ambulatory ERAS = applying ERAS principles within a day-care framework.', CELL), Paragraph('', CELL)], ] comp_table = Table(comp_data, colWidths=[3.2*cm, (W-3.2*cm)*0.47, (W-3.2*cm)*0.53], repeatRows=1) comp_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#0F766E')), ('ROWBACKGROUNDS', (0,1), (-1,-1), [TEAL_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), # Highlight the "ANSWER" row ('BACKGROUND', (0,-1), (-1,-1), colors.HexColor('#DCFCE7')), ('TEXTCOLOR', (0,-1), (0,-1), colors.HexColor('#166534')), ])) story.append(comp_table) story.append(Spacer(1, 0.4*cm)) # ═══════════════════════ PAGE 4 – ERAS COMPONENTS ═══════════════════════════ story.append(PageBreak()) story.append(header_box('7. FAST-TRACK / ERAS – KEY PERIOPERATIVE COMPONENTS', colors.HexColor('#0F766E'))) story.append(Spacer(1, 0.15*cm)) eras_data = [ [Paragraph('<b>PHASE</b>', CELL_HEAD), Paragraph('<b>COMPONENT</b>', CELL_HEAD), Paragraph('<b>DETAIL</b>', CELL_HEAD)], [Paragraph('PRE-OPERATIVE', ParagraphStyle('PH', fontName='Helvetica-Bold', fontSize=9, textColor=WHITE, leading=12)), Paragraph('Patient Education', CELL_B), Paragraph('Counselling, expectation management, written information', CELL)], [Paragraph('', CELL), Paragraph('Carbohydrate Loading', CELL_B), Paragraph('Oral carbohydrate drink 2–3h before surgery (avoids insulin resistance)', CELL)], [Paragraph('', CELL), Paragraph('Prehabilitation', CELL_B), Paragraph('Exercise, nutritional optimisation, smoking/alcohol cessation ≥ 4 weeks pre-op', CELL)], [Paragraph('', CELL), Paragraph('Avoid Prolonged Fasting', CELL_B), Paragraph('Clear fluids until 2h, solids until 6h before induction', CELL)], [Paragraph('', CELL), Paragraph('No Bowel Prep', CELL_B), Paragraph('Mechanical bowel prep abandoned in colorectal ERAS (except rectal surgery)', CELL)], [Paragraph('', CELL), Paragraph('Antibiotic Prophylaxis', CELL_B), Paragraph('Single dose, 30–60 min before incision', CELL)], [Paragraph('INTRA-OPERATIVE', ParagraphStyle('PH', fontName='Helvetica-Bold', fontSize=9, textColor=WHITE, leading=12)), Paragraph('Minimally Invasive Technique', CELL_B), Paragraph('Laparoscopic / robotic preferred over open', CELL)], [Paragraph('', CELL), Paragraph('Regional / Epidural Anaesthesia', CELL_B), Paragraph('Reduces opioid requirement; facilitates early mobilisation', CELL)], [Paragraph('', CELL), Paragraph('Opioid-Sparing Anaesthesia', CELL_B), Paragraph('Paracetamol + NSAID + ketamine + lidocaine infusion + dexamethasone', CELL)], [Paragraph('', CELL), Paragraph('Goal-Directed Fluid Therapy', CELL_B), Paragraph('Avoid hypo- and hypervolaemia; use stroke volume variation / oesophageal Doppler', CELL)], [Paragraph('', CELL), Paragraph('Normothermia', CELL_B), Paragraph('Active warming; target core temp >36°C throughout', CELL)], [Paragraph('', CELL), Paragraph('Avoid Drains/NGT/Catheters', CELL_B), Paragraph('Remove urinary catheter within 24h; avoid routine NG tubes and surgical drains', CELL)], [Paragraph('POST-OPERATIVE', ParagraphStyle('PH', fontName='Helvetica-Bold', fontSize=9, textColor=WHITE, leading=12)), Paragraph('Early Oral Nutrition', CELL_B), Paragraph('Resume oral diet within 4–6h of surgery; enteral feeding if unable', CELL)], [Paragraph('', CELL), Paragraph('Early Mobilisation', CELL_B), Paragraph('Out of bed within 6–8h; structured physiotherapy from Day 1', CELL)], [Paragraph('', CELL), Paragraph('Multimodal Analgesia', CELL_B), Paragraph('Paracetamol + NSAID ± regional block ± tramadol; opioids only as rescue', CELL)], [Paragraph('', CELL), Paragraph('PONV Prophylaxis', CELL_B), Paragraph('Ondansetron + dexamethasone for high-risk; total IV anaesthesia (propofol)', CELL)], [Paragraph('', CELL), Paragraph('VTE Prophylaxis', CELL_B), Paragraph('LMWH + compression stockings from Day 0; continue 28 days for cancer surgery', CELL)], [Paragraph('', CELL), Paragraph('Alvimopan', CELL_B), Paragraph('Peripheral mu-opioid antagonist – controversial in opioid-sparing ERAS; ' 'benefit seen mainly with high opioid use', CELL)], ] # colour the phase rows eras_table = Table(eras_data, colWidths=[2.8*cm, 3.8*cm, W-6.6*cm], repeatRows=1) eras_style = [ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#0F766E')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 5), # Phase rows ('BACKGROUND', (0,1), (0,6), colors.HexColor('#0D9488')), ('BACKGROUND', (0,7), (0,12), colors.HexColor('#0369A1')), ('BACKGROUND', (0,13), (0,18), colors.HexColor('#7C3AED')), ] for i, row in enumerate(eras_data): if i % 2 == 0 and i > 0: eras_style.append(('BACKGROUND', (1,i), (-1,i), TEAL_LIGHT)) elif i > 0: eras_style.append(('BACKGROUND', (1,i), (-1,i), WHITE)) eras_table.setStyle(TableStyle(eras_style)) story.append(eras_table) story.append(Spacer(1, 0.4*cm)) # ═══════════════════════════ SECTION 8: MEMORY AID ══════════════════════════ story.append(header_box('8. MEMORY AIDS & MNEMONICS', AMBER)) story.append(Spacer(1, 0.15*cm)) mnem_data = [ [Paragraph('<b>MNEMONIC</b>', CELL_HEAD), Paragraph('<b>STANDS FOR</b>', CELL_HEAD), Paragraph('<b>WHAT IT HELPS REMEMBER</b>', CELL_HEAD)], [Paragraph('SAFE-D\n(Day-care patient)', CELL_B), Paragraph( '<b>S</b>ocial support adequate\n' '<b>A</b>SA I–III (controlled)\n' '<b>F</b>it (stable comorbidities)\n' '<b>E</b>scort available\n' '<b>D</b>uration < 2 hours / Distance < 1 hour from hospital', CELL), Paragraph('Quick screening for day-care suitability', CELL)], [Paragraph('PONV RISK\n(Apfel Score)', CELL_B), Paragraph( '<b>F</b>emale sex\n' '<b>H</b>istory of PONV or motion sickness\n' '<b>N</b>on-smoker\n' '<b>O</b>pioid use post-op\n' 'Score 0=10%, 1=20%, 2=30%, 3=50%, 4=80%', CELL), Paragraph('Prophylaxis: 1 antiemetic per risk point (> 2 = combination therapy)', CELL)], [Paragraph('ERAS = "FORCE"', CELL_B), Paragraph( '<b>F</b>luids (goal-directed)\n' '<b>O</b>ral intake early (carbs pre-op, eat post-op Day 0/1)\n' '<b>R</b>egional anaesthesia / opioid Reduction\n' '<b>C</b>areful incision (MIS preferred)\n' '<b>E</b>arly mobilisation', CELL), Paragraph('Core intraoperative & postoperative ERAS elements', CELL)], [Paragraph('PADSS Scoring\n(9/10 = discharge)', CELL_B), Paragraph( '<b>V</b>ital signs (within 20% = 2pts)\n' '<b>A</b>ctivity (steady gait = 2pts)\n' '<b>N</b>ausea (minimal = 2pts)\n' '<b>P</b>ain (VAS ≤3 oral = 2pts)\n' '<b>S</b>urgical bleeding (minimal = 2pts)', CELL), Paragraph('VANPS – score 9 or 10 out of 10 needed for safe discharge', CELL)], ] mnem_table = Table(mnem_data, colWidths=[3*cm, (W-3*cm)*0.5, (W-3*cm)*0.5], repeatRows=1) mnem_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), AMBER), ('ROWBACKGROUNDS', (0,1), (-1,-1), [AMBER_LIGHT, WHITE]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (-1,-1), 5), ])) story.append(mnem_table) story.append(Spacer(1, 0.4*cm)) # ═══════════════════════════ SECTION 9: CONTRAINDICATIONS SUMMARY ════════════ story.append(header_box('9. ABSOLUTE vs RELATIVE CONTRAINDICATIONS TO DAY-CARE SURGERY', RED)) story.append(Spacer(1, 0.15*cm)) contra_data = [ [Paragraph('<b>ABSOLUTE CONTRAINDICATIONS</b>', CELL_HEAD), Paragraph('<b>RELATIVE CONTRAINDICATIONS</b>', CELL_HEAD)], [Paragraph( '• MI within 3 months (60 days if complicated)\n' '• Decompensated / acute heart failure\n' '• Severe valve disease with haemodynamic compromise\n' '• High-grade AV block\n' '• Malignant hypertension (end-organ damage ≥3 targets)\n' '• DKA / Hyperosmolar hyperglycaemic state\n' '• Acute respiratory failure\n' '• Recent severe CVA\n' '• End-stage renal disease (not on regular dialysis)\n' '• Coronary stent <30 days (bare metal) / <1 year (drug-eluting)\n' '• Active anticoagulation + high-bleed procedure\n' '• No responsible adult escort available', CELL), Paragraph( '• High frailty score (use frailty assessment tool)\n' '• Morbid obesity (BMI >40) + difficult airway in isolated facility\n' '• Moderate/severe OSA requiring complex CPAP setup\n' '• Poorly controlled DM, asthma, or epilepsy (defer until optimised)\n' '• Procedure duration > 3 hours\n' '• Anticipated significant blood loss\n' '• Anxiety disorders / needle phobia (consider short-stay)\n' '• Distance > 1 hour from hospital\n' '• Paediatric: neonates / ex-premature < 60 weeks PCA\n' '• ASA IV (may proceed with caution for minor procedures + local anaesthesia)', CELL)], ] contra_table = Table(contra_data, colWidths=[W/2, W/2], repeatRows=1) contra_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (0,0), RED), ('BACKGROUND', (1,0), (1,0), AMBER), ('BACKGROUND', (0,1), (0,1), RED_LIGHT), ('BACKGROUND', (1,1), (1,1), AMBER_LIGHT), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CBD5E1')), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (-1,-1), 6), ])) story.append(contra_table) story.append(Spacer(1, 0.4*cm)) # ═══════════════════════ FOOTER / REFERENCES ════════════════════════════════ story.append(section_rule()) story.append(Paragraph( '<b>Sources:</b> Miller\'s Anesthesia 10e (Ch. 68, Ambulatory Anaesthesia) | ' 'Schwartz\'s Principles of Surgery 11e (Ch. 52, Ambulatory Surgery Centers) | ' 'Current Surgical Therapy 14e (Patient Selection for Ambulatory Surgery, ' 'Fast-Track Anaesthetic Technique) | Bailey & Love\'s Short Practice of Surgery 28e', ParagraphStyle('REF', fontName='Helvetica-Oblique', fontSize=7.5, textColor=colors.HexColor('#64748B'), spaceAfter=2, spaceBefore=2, leading=11))) story.append(Paragraph( 'Compiled by Orris AI | For educational purposes only | Always refer to current institutional guidelines', FOOT)) # ── Build ─────────────────────────────────────────────────────────────────── doc.build(story) print("PDF built successfully!") PYEOF python3 /tmp/workspace/daycare-surgery/build_pdf.py
ls -lh /tmp/workspace/daycare-surgery/DayCare_Surgery_Memory_Aid.pdf
| # | Principle | Key Point |
|---|---|---|
| 1 | Reduced tissue trauma | MIS preferred; less catabolism |
| 2 | Enhanced recovery | Early mobility, early oral intake |
| 3 | Effective multimodal analgesia | Paracetamol + NSAID + regional block; opioid-sparing |
| 4 | PONV control | Apfel score; combination prophylaxis for high-risk |
| 5 | Patient information | Written instructions + 24h contact number |
| 6 | Dynamic patient selection | Procedure × Patient × Facility triad |
| 7 | Qualified perioperative team | Anaesthesiologist as perioperative physician |
| 8 | Cost-efficiency | 1/2 to 1/3 cost of inpatient equivalent |
| 9 | Patient satisfaction | Home recovery preferred; less HAI |
| 10 | Safety net | Aftercare instructions, phone follow-up, smartphone apps |
| Feature | Day-Care Surgery | Fast-Track / ERAS Surgery |
|---|---|---|
| Overnight stay | NONE (same-day discharge) | Usually 1-3 days (vs. 7-14 days traditional) |
| Procedures | Minor-intermediate | MAJOR (colectomy, oesophagectomy, cystectomy, etc.) |
| Primary goal | Eliminate hospitalisation | Minimise length of stay; reduce complications |
| Anaesthesia | Short-acting TIVA/volatile; LMA | Regional/epidural; goal-directed fluids |
| Origin | Nicoll 1898; ASC Phoenix 1970 | Kehlet 1997; ERAS Society 2005 |
DayCare Surgery Memory Aid
PDF Document · PDF