For a 4-person presentation on “Principles of safe general surgey". Make a ppt following given prompt. Take reference from Bailey & love book. 👩⚕️ Person 1 — Preoperative Safety & Patient Assessment Introduction: What is safe surgery? Principles of safe general surgery Preoperative assessment History and examination Comorbidities and risk factors Investigations ASA grading Optimization of the patient before surgery Diabetes, hypertension, anemia, etc. Nutrition and hydration Informed consent Identification of patient, procedure and surgical site Preoperative antibiotic prophylaxis DVT prophylaxis 👨⚕️ Person 2 — Asepsis, Infection Prevention & Operating Room Safety Principles of aseptic surgery Hand hygiene Surgical scrub Sterilization and disinfection Surgical gowning and gloving Preparation and draping of the surgical site Prevention of surgical-site infection Safe operating-room practices Surgical safety checklist / WHO Safe Surgery Checklist Sign in Time out Sign out 👩⚕️ Person 3 — Intraoperative Safety & Prevention of Surgical Complications Safe anesthesia principles Airway and respiratory safety Monitoring of vital parameters Maintaining hemodynamic stability Safe positioning of the patient Prevention of pressure/nerve injuries Prevention of hypothermia Fluid and electrolyte management Blood loss and transfusion safety Safe use of surgical instruments and energy devices Prevention of wrong-site/wrong-patient surgery Prevention of retained surgical instruments/swabs 👨⚕️ Person 4 — Postoperative Safety & Management Immediate postoperative monitoring Airway, breathing and circulation Pain management Fluid and electrolyte management Wound and drain care Prevention of postoperative complications: Surgical-site infection DVT/PE Pneumonia Urinary retention/UTI Ileus Bleeding Early mobilization and nutrition Recognition of deterioration and emergency management Safe discharge and follow-up
Which presentation section should I develop into detailed, slide-ready content first?
WHO Surgical Safety Checklist official 2009 safe surgery guidelines
surgical safety checklist AND postoperative complications
https://www.who.int/teams/integrated-health-services/patient…
~/
WHO Surgical Safety Checklist sign in time out sign out medical diagram
surgical hand antisepsis operating theatre sterile gown gloving
mkdir -p "/tmp/workspace/safe-general-surgery-ppt/src" "/tmp/workspace/safe-general-surgery-ppt/output"
~/safe-general-surgery-ppt/src/create_presentation.py
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR
from pptx.dml.color import RGBColor
from pptx.enum.dml import MSO_THEME_COLOR
from pptx.enum.text import MSO_AUTO_SIZE
from pptx.oxml.xmlchemy import OxmlElement
OUT = '/tmp/workspace/safe-general-surgery-ppt/output/Principles_of_Safe_General_Surgery.pptx'
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
BLANK = prs.slide_layouts[6]
# Palette
NAVY = RGBColor(13, 35, 57)
BLUE = RGBColor(25, 108, 167)
TEAL = RGBColor(26, 149, 148)
GREEN = RGBColor(41, 135, 91)
AMBER = RGBColor(222, 142, 40)
RED = RGBColor(183, 67, 66)
INK = RGBColor(29, 42, 54)
MUTED = RGBColor(93, 110, 123)
LIGHT = RGBColor(243, 247, 249)
WHITE = RGBColor(255,255,255)
PALE_BLUE = RGBColor(228, 241, 250)
PALE_TEAL = RGBColor(226, 245, 243)
PALE_AMBER = RGBColor(253, 244, 227)
PALE_RED = RGBColor(252, 235, 235)
GREY = RGBColor(218, 227, 232)
speaker_colors = [BLUE, TEAL, AMBER, GREEN]
speaker_names = ['PERSON 1 | PREOPERATIVE', 'PERSON 2 | ASEPSIS & OR', 'PERSON 3 | INTRAOPERATIVE', 'PERSON 4 | POSTOPERATIVE']
def set_bg(slide, color=WHITE):
shape = slide.background.fill
shape.solid(); shape.fore_color.rgb = color
def rect(slide, x,y,w,h, fill, line=None, radius=False):
shape = slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE if radius else MSO_SHAPE.RECTANGLE, Inches(x), Inches(y), Inches(w), Inches(h))
shape.fill.solid(); shape.fill.fore_color.rgb = fill
shape.line.color.rgb = line if line else fill
if radius:
shape.adjustments[0] = 0.12
return shape
def line(slide, x1,y1,x2,y2,color,width=1.5):
sh = slide.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Inches(x1), Inches(y1), Inches(x2), Inches(y2))
sh.line.color.rgb=color; sh.line.width=Pt(width)
return sh
def tb(slide, text, x,y,w,h, size=18, color=INK, bold=False, font='Aptos', align=PP_ALIGN.LEFT, valign=MSO_ANCHOR.TOP, margin=0.05, italic=False):
sh=slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h))
tf=sh.text_frame; tf.clear(); tf.word_wrap=True
tf.margin_left=tf.margin_right=Inches(margin); tf.margin_top=tf.margin_bottom=Inches(margin)
tf.vertical_anchor=valign
p=tf.paragraphs[0]; p.alignment=align
r=p.add_run(); r.text=text; r.font.name=font; r.font.size=Pt(size); r.font.bold=bold; r.font.italic=italic; r.font.color.rgb=color
return sh
def bullets(slide, items, x,y,w,h, size=17, color=INK, bullet_color=None, line_space=1.06):
sh=slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h)); tf=sh.text_frame
tf.clear(); tf.word_wrap=True; tf.margin_left=Inches(0.08); tf.margin_right=Inches(0.03); tf.margin_top=Inches(0.02); tf.margin_bottom=Inches(0.02)
for i,item in enumerate(items):
if isinstance(item, tuple): level, text = item
else: level, text = 0, item
p=tf.paragraphs[0] if i==0 else tf.add_paragraph()
p.text=text; p.level=level; p.font.name='Aptos'; p.font.size=Pt(size if level==0 else size-2); p.font.color.rgb=color
p.space_after=Pt(7 if level==0 else 3); p.line_spacing=line_space
if level==0:
p.text = '• ' + text
return sh
def title(slide, text, subtitle=None, section=None, sn=0, dark=False):
if dark:
color=WHITE; muted=RGBColor(210,226,237)
else:
color=NAVY; muted=MUTED
tb(slide,text,0.62,0.36,11.7,0.55,29,color,True)
line(slide,0.63,1.06,12.68,1.06, speaker_colors[sn] if section is not None else BLUE, 2.5)
if subtitle: tb(slide,subtitle,0.64,1.16,11.5,0.34,12.5,muted)
if section is not None:
rect(slide,11.08,0.35,1.62,0.34,speaker_colors[sn],speaker_colors[sn],True)
tb(slide,section,11.13,0.40,1.52,0.19,8.2,WHITE,True,align=PP_ALIGN.CENTER)
def footer(slide, num, citation='Bailey & Love, 28th ed. | educational summary'):
line(slide,0.62,7.12,12.7,7.12,GREY,0.7)
tb(slide,citation,0.65,7.18,10.7,0.17,7.6,MUTED)
tb(slide,str(num).zfill(2),12.1,7.15,0.5,0.2,8.5,NAVY,True,align=PP_ALIGN.RIGHT)
def speaker_badge(slide, sn):
x=0.66+sn*3.08
rect(slide,x,6.55,2.82,0.31, speaker_colors[sn], speaker_colors[sn], True)
tb(slide,speaker_names[sn],x+0.08,6.62,2.66,0.12,7.5,WHITE,True,align=PP_ALIGN.CENTER)
def card(slide, x,y,w,h, heading, body, accent=BLUE, icon=None, fs=15):
rect(slide,x,y,w,h,WHITE,GREY,True)
rect(slide,x,y,0.11,h,accent,accent,True)
if icon:
rect(slide,x+0.25,y+0.28,0.44,0.44,accent,accent,True)
tb(slide,icon,x+0.25,y+0.36,0.44,0.18,12,WHITE,True,align=PP_ALIGN.CENTER)
tx=x+0.82
else: tx=x+0.3
tb(slide,heading,tx,y+0.27,w-(tx-x)-0.22,0.28,15.5,NAVY,True)
bullets(slide,body,tx,y+0.72,w-(tx-x)-0.23,h-0.84,fs,INK)
def checkpoint(slide, x,y,w,h, num, heading, content, accent):
rect(slide,x,y,w,h,WHITE,GREY,True)
rect(slide,x+0.22,y+0.22,0.46,0.46,accent,accent,True)
tb(slide,str(num),x+0.22,y+0.30,0.46,0.18,12,WHITE,True,align=PP_ALIGN.CENTER)
tb(slide,heading,x+0.82,y+0.22,w-1.0,0.27,15,NAVY,True)
tb(slide,content,x+0.82,y+0.59,w-1.02,h-0.75,12.5,MUTED)
# 1 Title
s=prs.slides.add_slide(BLANK); set_bg(s,NAVY)
# decorative rings
for x,y,d,c in [(10.9,0.45,1.65,TEAL),(11.45,1.03,0.92,BLUE),(10.15,5.65,1.05,AMBER)]:
shp=s.shapes.add_shape(MSO_SHAPE.OVAL,Inches(x),Inches(y), Inches(d), Inches(d)); shp.fill.background(); shp.line.color.rgb=c; shp.line.width=Pt(3)
tb(s,'PRINCIPLES OF\nSAFE GENERAL SURGERY',0.72,1.22,8.7,1.55,35,WHITE,True)
tb(s,'A four-person presentation | patient-centred, team-based and systems-aware care',0.75,3.0,8.5,0.35,17,RGBColor(207,224,233))
rect(s,0.75,3.75,7.9,0.70,RGBColor(21,56,81),RGBColor(21,56,81),True)
tb(s,'Preoperative • Asepsis & OR • Intraoperative • Postoperative',0.97,3.97,7.45,0.22,14,WHITE,True,align=PP_ALIGN.CENTER)
tb(s,'Based primarily on Bailey & Love’s Short Practice of Surgery, 28th edition',0.76,6.56,8.8,0.24,10.5,RGBColor(171,199,215))
tb(s,'General Surgery',10.18,6.56,2.2,0.24,10.5,WHITE,True,align=PP_ALIGN.RIGHT)
# 2 Architecture
s=prs.slides.add_slide(BLANK); set_bg(s,LIGHT); title(s,'Safe surgery is a continuous safety system','Four linked phases, each with independent checks and shared accountability.')
steps=[('01','PREOPERATIVE','Right patient. Right plan. Risk reduced.',BLUE),('02','OR & ASEPSIS','Clean field. Clear team communication.',TEAL),('03','INTRAOPERATIVE','Physiology protected. Errors trapped.',AMBER),('04','POSTOPERATIVE','Deterioration detected. Recovery enabled.',GREEN)]
for i,(n,h,b,c) in enumerate(steps):
x=0.72+i*3.12
rect(s,x,2.05,2.68,2.72,WHITE,GREY,True)
rect(s,x,2.05,2.68,0.12,c,c,True)
tb(s,n,x+0.25,2.39,0.5,0.25,16,c,True)
tb(s,h,x+0.25,2.85,2.15,0.38,17,NAVY,True)
tb(s,b,x+0.25,3.56,2.1,0.7,13,MUTED)
if i<3: line(s,x+2.76,3.38,x+3.00,3.38,c,2)
tb(s,'Core principle',0.72,5.46,1.5,0.28,14,NAVY,True)
tb(s,'Prevent predictable harm, identify deviation early, and make recovery safer through reliable team processes.',0.72,5.84,11.8,0.5,21,INK,True)
footer(s,2,'Bailey & Love, 28th ed., Ch. 15 Patient safety')
# 3 person 1
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'1. Preoperative safety: know the patient, plan the operation','Every avoidable risk should be identified and addressed before incision.',speaker_names[0],0)
card(s,0.72,1.76,3.85,3.82,'Structured assessment',['Confirm indication, urgency and expected physiological stress','History: comorbidity, medicines, allergies, previous anaesthesia and bleeding','Examination: airway, cardiopulmonary reserve, functional status, hydration and infection'],BLUE,'A',14)
card(s,4.75,1.76,3.85,3.82,'Risk stratification',['Use ASA physical-status grade as a communication tool, not a stand-alone prediction','Consider procedure-specific risk and patient frailty','Target investigations to the patient and planned surgery'],BLUE,'R',14)
card(s,8.78,1.76,3.85,3.82,'Shared decision-making',['Explain benefits, material risks, alternatives and consequences of no treatment','Assess capacity and allow questions','Document consent and ensure a clear postoperative plan'],BLUE,'C',14)
speaker_badge(s,0); footer(s,3,'Bailey & Love, 28th ed., Ch. 24 Perioperative care; Ch. 15 Patient safety')
#4 optimization ASA
s=prs.slides.add_slide(BLANK); set_bg(s,LIGHT); title(s,'Optimize before surgery where time allows','Aim for the best achievable physiological state, without unsafe delay in urgent disease.',speaker_names[0],0)
items=[('Diabetes','Plan perioperative glucose monitoring and medication/insulin adjustment; avoid both hypo- and hyperglycaemia.'),('Cardiovascular disease','Assess symptoms and functional capacity; control hypertension and coordinate high-risk cases with anaesthesia/medicine.'),('Anaemia','Identify cause, correct iron deficiency or other reversible factors, and plan blood conservation.'),('Nutrition & hydration','Screen for malnutrition, support nutrition when feasible, correct dehydration and electrolyte disturbance.')]
for i,(h,b) in enumerate(items):
x=0.72+(i%2)*6.05; y=1.75+(i//2)*2.15
checkpoint(s,x,y,5.62,1.58,i+1,h,b,BLUE)
rect(s,0.72,6.16,11.7,0.45,PALE_BLUE,PALE_BLUE,True); tb(s,'ASA I to VI describes pre-anaesthetic physical status. Document it clearly alongside procedure urgency and key risk modifiers.',0.93,6.29,11.3,0.15,11.5,NAVY,True)
speaker_badge(s,0); footer(s,4,'Bailey & Love, 28th ed., Ch. 24 Perioperative care')
#5 identity and prophylaxis
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'The pre-incision safety bundle','Verification and prophylaxis must be completed, recorded and communicated.',speaker_names[0],0)
checkpoint(s,0.75,1.72,5.75,1.42,1,'IDENTITY, PROCEDURE, SITE','Use at least two identifiers. Reconcile consent, theatre list, imaging and visible site mark. Resolve any mismatch before proceeding.',BLUE)
checkpoint(s,0.75,3.43,5.75,1.42,2,'ANTIBIOTIC PROPHYLAXIS','Select for operation and local policy. Give within an appropriate pre-incision window; re-dose during prolonged surgery or major blood loss when indicated.',BLUE)
checkpoint(s,6.78,1.72,5.75,1.42,3,'VTE PREVENTION','Assess thrombosis and bleeding risks. Use early mobilisation plus mechanical and/or pharmacological prophylaxis according to local protocol.',BLUE)
checkpoint(s,6.78,3.43,5.75,1.42,4,'READY FOR ANAESTHESIA','Confirm fasting status, allergies, blood availability if needed, equipment and postoperative destination.',BLUE)
rect(s,0.75,5.47,11.78,0.55,PALE_BLUE,PALE_BLUE,True); tb(s,'STOP THE LINE: uncertainty about identity, site, consent or readiness is a reason to pause, escalate and correct.',0.98,5.66,11.25,0.18,14,NAVY,True,align=PP_ALIGN.CENTER)
speaker_badge(s,0); footer(s,5,'Bailey & Love, 28th ed., Ch. 15 Patient safety; Ch. 24 Perioperative care')
#6 person 2
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'2. Asepsis: break the chain of infection','A sterile field is created through reliable micro-actions, not a single action.',speaker_names[1],1)
for i,(h,b,ic) in enumerate([('Hand hygiene','Before and after patient contact; surgical hand antisepsis before gowning.','1'),('Sterilization','Validated cleaning, packaging, sterilization and traceability of instruments.','2'),('Barrier technique','Sterile gown and gloves; replace contaminated or damaged barriers promptly.','3'),('Skin preparation','Appropriate hair removal only if needed; antisepsis, adequate drying and sterile draping.','4')]):
x=0.72+(i%2)*6.02; y=1.72+(i//2)*2.1
card(s,x,y,5.62,1.6,h,[b],TEAL,ic,13.2)
rect(s,0.72,6.10,11.72,0.54,PALE_TEAL,PALE_TEAL,True); tb(s,'The sterile field is a shared responsibility. Anyone who sees a break in asepsis should speak up immediately.',0.97,6.29,11.2,0.17,13,NAVY,True,align=PP_ALIGN.CENTER)
speaker_badge(s,1); footer(s,6,'Bailey & Love, 28th ed., Ch. 7 Operating theatre practice; Ch. 15 Patient safety')
#7 SSI prevention
s=prs.slides.add_slide(BLANK); set_bg(s,LIGHT); title(s,'Preventing surgical-site infection is a perioperative task','Control patient, procedure, environmental and team factors.',speaker_names[1],1)
cols=[('Before incision',['Treat remote infection where feasible','Optimise glycaemia, nutrition and smoking status','Appropriate hair removal and skin antisepsis','Appropriate prophylactic antibiotics'],TEAL),('During surgery',['Maintain asepsis and gentle tissue handling','Haemostasis and avoid unnecessary devascularisation','Limit contamination and operative time','Maintain normothermia and oxygenation'],TEAL),('After surgery',['Aseptic wound and drain handling','Review wound only when clinically needed','Prompt recognition of erythema, discharge, fever or pain','Use antimicrobial stewardship'],TEAL)]
for i,(h,bs,c) in enumerate(cols):
x=0.72+i*4.1
rect(s,x,1.78,3.72,4.45,WHITE,GREY,True); rect(s,x,1.78,3.72,0.47,c,c,True)
tb(s,h,x+0.22,2.0,3.25,0.23,16,NAVY,True)
bullets(s,bs,x+0.22,2.62,3.16,3.15,14.1)
speaker_badge(s,1); footer(s,7,'Bailey & Love, 28th ed., Ch. 7 Preparation of the surgical site')
#8 WHO checklist
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'WHO Surgical Safety Checklist: three deliberate team pauses','The checklist supports teamwork and communication. It does not replace clinical judgement.',speaker_names[1],1)
phases=[('SIGN IN','Before induction of anaesthesia','Identity, site, procedure and consent\nAllergy and airway/aspiration risk\nPulse oximeter functioning\nBlood-loss risk and readiness',BLUE),('TIME OUT','Before skin incision','Team introductions\nConfirm patient, procedure and site\nAntibiotic prophylaxis given\nCritical steps, concerns and imaging',TEAL),('SIGN OUT','Before patient leaves operating room','Name procedure performed\nInstrument, sponge and needle counts\nSpecimen labelling\nEquipment issues and recovery plan',AMBER)]
for i,(h,sub,b,c) in enumerate(phases):
x=0.72+i*4.09
rect(s,x,1.78,3.68,3.78,WHITE,GREY,True); rect(s,x,1.78,3.68,0.55,c,c,True)
tb(s,h,x+0.22,2.08,3.1,0.25,18,NAVY,True)
tb(s,sub,x+0.22,2.48,3.1,0.22,11.2,MUTED,italic=True)
for j,t in enumerate(b.split('\n')):
tb(s,'• '+t,x+0.25,2.99+j*0.47,3.13,0.34,13.2,INK)
line(s,2.1,6.05,11.15,6.05,TEAL,2)
tb(s,'Confirm out loud. Make concerns speakable. Record completion.',1.4,6.26,10.5,0.3,15,NAVY,True,align=PP_ALIGN.CENTER)
speaker_badge(s,1); footer(s,8,'Bailey & Love, 28th ed., Ch. 15 Patient safety | WHO Surgical Safety Checklist, 2009')
#9 person3
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'3. Intraoperative safety: protect physiology and prevent error','Continuous monitoring, anticipation and communication are the operating team’s safety net.',speaker_names[2],2)
card(s,0.72,1.70,3.82,3.9,'Anaesthesia & airway',['Pre-induction check and clear airway plan','Monitor oxygenation, ventilation and circulation','Anticipate aspiration, difficult airway and postoperative respiratory support'],AMBER,'A',14)
card(s,4.76,1.70,3.82,3.9,'Physiology',['Use appropriate monitoring and trend changes','Maintain perfusion, temperature and glucose control','Escalate early when instability persists'],AMBER,'P',14)
card(s,8.80,1.70,3.82,3.9,'Team communication',['State critical operative steps and anticipated blood loss','Use closed-loop communication for key instructions','Share a plan for complications, specimen and recovery'],AMBER,'T',14)
speaker_badge(s,2); footer(s,9,'Bailey & Love, 28th ed., Ch. 15 Patient safety; Ch. 24 Perioperative care')
#10 position fluids blood
s=prs.slides.add_slide(BLANK); set_bg(s,LIGHT); title(s,'Control the preventable physiological hazards','Position, temperature, fluids and transfusion require active management, not observation alone.',speaker_names[2],2)
checkpoint(s,0.72,1.72,5.62,1.42,1,'SAFE POSITIONING','Padding, neutral alignment, protected eyes and pressure points. Avoid excessive stretch, compression and unsupported limbs.',AMBER)
checkpoint(s,6.72,1.72,5.62,1.42,2,'NORMOTHERMIA','Monitor core temperature when appropriate; reduce exposure, use active warming and warm fluids/blood when indicated.',AMBER)
checkpoint(s,0.72,3.48,5.62,1.42,3,'FLUIDS & ELECTROLYTES','Assess losses and response using clinical context and measured parameters. Correct deficits; avoid both under-resuscitation and overload.',AMBER)
checkpoint(s,6.72,3.48,5.62,1.42,4,'BLOOD SAFETY','Anticipate blood loss, ensure blood is correctly identified, use a transfusion check, monitor response and document events.',AMBER)
rect(s,0.72,5.55,11.62,0.52,PALE_AMBER,PALE_AMBER,True); tb(s,'Reassess after every major change: blood loss, positioning change, new instability or unexpected operative finding.',0.94,5.73,11.2,0.18,13.2,NAVY,True,align=PP_ALIGN.CENTER)
speaker_badge(s,2); footer(s,10,'Bailey & Love, 28th ed., Ch. 7 Patient positioning; Ch. 24 Perioperative care')
#11 instruments & never events
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'Never-event prevention: build in independent barriers','Error traps must be deliberate, visible and completed before closure or transfer.',speaker_names[2],2)
for i,(h,bul,c) in enumerate([('Wrong patient / site / procedure',['Verify identifiers, consent, marked site and imaging','Complete the time out with the entire team'],RED),('Retained swab / instrument',['Standardized counts at start, cavity closure and skin closure','Reconcile discrepancy before leaving theatre; escalate and image if unresolved'],RED),('Energy devices',['Check insulation, settings, return electrode and activation awareness','Protect adjacent structures and avoid ignition risks'],AMBER)]):
x=0.72+i*4.1
rect(s,x,1.78,3.72,4.65,WHITE,GREY,True); rect(s,x,1.78,3.72,0.52,c,c,True)
tb(s,h,x+0.25,2.12,3.1,0.42,17,NAVY,True)
bullets(s,bul,x+0.25,2.92,3.05,2.6,14)
rect(s,x+0.25,5.76,3.1,0.35,PALE_RED if c==RED else PALE_AMBER,PALE_RED if c==RED else PALE_AMBER,True)
tb(s,'Pause if the safety barrier fails.',x+0.37,5.88,2.86,0.12,9.5,c,True,align=PP_ALIGN.CENTER)
speaker_badge(s,2); footer(s,11,'Bailey & Love, 28th ed., Ch. 15 Patient safety | WHO Surgical Safety Checklist, 2009')
#12 person 4
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'4. Postoperative safety: detect deterioration before it becomes rescue','The recovery area and ward handover are safety-critical clinical transitions.',speaker_names[3],3)
card(s,0.72,1.72,3.82,3.82,'Immediate recovery',['Structured handover: operation, anaesthesia, losses, lines, drains, antibiotics and concerns','Assess airway, breathing, circulation, consciousness, pain and temperature','Set monitoring frequency and escalation criteria'],GREEN,'A',14)
card(s,4.76,1.72,3.82,3.82,'Support recovery',['Multimodal analgesia and antiemesis as appropriate','Fluid balance, glucose and electrolytes reviewed','Wound, drain and urinary output observed'],GREEN,'B',14)
card(s,8.80,1.72,3.82,3.82,'Prevent complications',['Early mobilisation and VTE prophylaxis','Respiratory exercises and pulmonary care','Early nutrition when safe; plan bowel and bladder care'],GREEN,'C',14)
speaker_badge(s,3); footer(s,12,'Bailey & Love, 28th ed., Ch. 24 General postoperative complications')
#13 complications
s=prs.slides.add_slide(BLANK); set_bg(s,LIGHT); title(s,'Prevent, look for, and respond to common postoperative complications','Trends in observations and clinical examination matter more than a single normal value.',speaker_names[3],3)
risks=[('Bleeding','Tachycardia, hypotension, increasing drain loss, swelling, falling Hb','Resuscitate, cross-match, investigate if stable; return to theatre if unstable'),('SSI / sepsis','Fever, wound pain, erythema, discharge, systemic deterioration','Cultures where relevant, antibiotics/source control, escalate'),('DVT / PE','Leg swelling or pain, hypoxia, tachycardia, pleuritic symptoms','Risk assessment, prophylaxis, urgent diagnostic pathway'),('Respiratory','Hypoxia, atelectasis, pneumonia, reduced respiratory effort','Oxygen, analgesia, mobilisation, chest physiotherapy and investigation'),('GI / urinary','Ileus, vomiting, distension, retention or UTI','Review medications/fluids, examine, catheter strategy and investigate')]
for i,(h,signs,act) in enumerate(risks):
y=1.60+i*0.94
rect(s,0.72,y,11.85,0.76,WHITE,GREY,True)
rect(s,0.72,y,1.65,0.76,GREEN,GREEN,True)
tb(s,h,0.83,y+0.25,1.42,0.18,11.7,WHITE,True,align=PP_ALIGN.CENTER)
tb(s,signs,2.62,y+0.18,4.65,0.38,11.3,INK)
tb(s,act,7.52,y+0.18,4.75,0.38,11.3,MUTED)
tb(s,'What to look for',2.62,1.17,2,0.19,10,MUTED,True); tb(s,'First response',7.52,1.17,2,0.19,10,MUTED,True)
speaker_badge(s,3); footer(s,13,'Bailey & Love, 28th ed., Ch. 24 General postoperative complications')
#14 deterioration/discharge
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'Recognize deterioration. Escalate early. Discharge safely.','A safe endpoint includes a shared plan for recovery beyond the hospital.',speaker_names[3],3)
checkpoint(s,0.75,1.72,5.6,1.54,1,'WHEN THE PATIENT DETERIORATES','Use an ABCDE assessment, call for senior help, give oxygen/resuscitation as needed, identify likely cause and reassess response.',GREEN)
checkpoint(s,6.72,1.72,5.6,1.54,2,'Handover AND DOCUMENTATION','Communicate operation details, complications, fluids/blood, drains, medications, test results, ceilings of care and outstanding tasks.',GREEN)
checkpoint(s,0.75,3.68,5.6,1.54,3,'DISCHARGE CHECK','Physiologically stable, pain controlled, eating/drinking as appropriate, mobilising safely, medications reconciled and follow-up arranged.',GREEN)
checkpoint(s,6.72,3.68,5.6,1.54,4,'PATIENT SAFETY-NETTING','Give written wound, drain and medication advice. Explain danger signs and how, when and where to seek urgent help.',GREEN)
rect(s,0.75,5.78,11.58,0.48,PALE_TEAL,PALE_TEAL,True); tb(s,'Early mobilisation, adequate nutrition and clear follow-up convert complication prevention into recovery.',0.98,5.94,11.05,0.16,12.6,NAVY,True,align=PP_ALIGN.CENTER)
speaker_badge(s,3); footer(s,14,'Bailey & Love, 28th ed., Ch. 24 Perioperative care and postoperative complications')
#15 close
s=prs.slides.add_slide(BLANK); set_bg(s,NAVY); title(s,'Five habits that make surgery safer',None,None,0,True)
items=[('1','PREPARE','Identify and reduce risk before surgery.'),('2','VERIFY','Use patient, site, procedure and team checks.'),('3','MAINTAIN','Protect asepsis and physiology throughout.'),('4','COUNT & COMMUNICATE','Make safety-critical steps visible and spoken.'),('5','RECOGNIZE','Act on postoperative deterioration early.')]
for i,(n,h,b) in enumerate(items):
y=1.48+i*0.87
rect(s,0.78,y,11.86,0.67,RGBColor(23,55,78),RGBColor(23,55,78),True)
rect(s,0.95,y+0.12,0.42,0.42,[BLUE,TEAL,AMBER,GREEN,RED][i],[BLUE,TEAL,AMBER,GREEN,RED][i],True)
tb(s,n,0.95,y+0.20,0.42,0.13,11,WHITE,True,align=PP_ALIGN.CENTER)
tb(s,h,1.64,y+0.19,2.35,0.18,13.2,WHITE,True)
tb(s,b,4.0,y+0.19,7.85,0.18,13,RGBColor(211,229,238))
tb(s,'Safe surgery is reliable care by an informed patient and a prepared team.',0.78,6.50,11.7,0.27,15,WHITE,True,align=PP_ALIGN.CENTER)
footer(s,15,'Bailey & Love, 28th ed. | WHO Surgical Safety Checklist, 2009')
#16 references
s=prs.slides.add_slide(BLANK); set_bg(s,WHITE); title(s,'References and suggested reading','Primary reference used for slide content.')
refs=[
"O’Connell PR, McCaskie AW, Williams NS, eds. Bailey & Love’s Short Practice of Surgery. 28th ed. CRC Press; 2023. Chapters 7, 15 and 24.",
"World Health Organization. WHO Guidelines for Safe Surgery 2009: Safe Surgery Saves Lives. WHO; 2009.",
"World Health Organization. WHO Surgical Safety Checklist (First Edition). 2009. https://www.who.int/teams/integrated-health-services/patient-safety/research/safe-surgery/tool-and-resources",
"Local hospital policies should determine specific antibiotic prophylaxis, venous thromboembolism prophylaxis, transfusion and escalation protocols."
]
for i,r in enumerate(refs):
rect(s,0.72,1.6+i*1.06,11.85,0.77,LIGHT,LIGHT,True)
tb(s,str(i+1).zfill(2),0.98,1.87+i*1.06,0.42,0.18,12,BLUE,True)
tb(s,r,1.58,1.77+i*1.06,10.4,0.39,13.2,INK)
rect(s,0.72,6.14,11.85,0.52,PALE_AMBER,PALE_AMBER,True)
tb(s,'Educational presentation only. Adapt decisions to the individual patient, supervising team and current local protocol.',0.96,6.32,11.3,0.16,12.1,NAVY,True,align=PP_ALIGN.CENTER)
footer(s,16,'References')
# Speaker notes: add notes text through XML
notes = [
'Introduce the presentation and the four linked stages of safe surgery.',
'Stress that safety depends on systems, communication and clinical judgement at every phase.',
'Person 1: Explain how structured preoperative assessment makes the operation safer before the patient reaches theatre.',
'Person 1: Give examples of reversible factors and explain ASA as a concise description of physical status.',
'Person 1: Emphasize that identifiers, consent and site verification cannot be assumed. They must be actively confirmed.',
'Person 2: Explain that asepsis is maintained through several reliable practices performed by the entire team.',
'Person 2: Relate each stage of SSI prevention to the patient journey rather than treating infection prevention as only an intraoperative issue.',
'Person 2: Walk through the three pauses. The checklist should be audible, participatory and adapted to local workflow.',
'Person 3: Explain that safe anaesthesia and surgery require situational awareness and early response to changes.',
'Person 3: Highlight typical pressure/nerve injury risks and why fluid, temperature and blood management are active processes.',
'Person 3: Make the message explicit: counts and time out are independent barriers, and a mismatch requires a stop.',
'Person 4: Discuss a structured recovery handover and the use of observations plus bedside examination.',
'Person 4: Ask the audience which complication may be missed if a patient is observed only intermittently.',
'Person 4: End by linking early escalation and safety-netting to continuous care after surgery.',
'Summarize the five habits, one sentence each.',
'Invite questions. Remind the audience to consult local protocols for operational details.'
]
for slide, note in zip(prs.slides, notes):
notes_slide = slide.notes_slide
tf = notes_slide.notes_text_frame
tf.text = note
prs.save(OUT)
print(OUT)
python "/tmp/workspace/safe-general-surgery-ppt/src/create_presentation.py"
~/safe-general-surgery-ppt/output
python -c "from pptx import Presentation; p=Presentation('/tmp/workspace/safe-general-surgery-ppt/output/Principles_of_Safe_General_Surgery.pptx'); print('slides',len(p.slides)); print([(i+1, sum(1 for sh in s.shapes if getattr(sh,'has_text_frame',False))) for i,s in enumerate(p.slides)])"
python -c "from pptx import Presentation; path='/tmp/workspace/safe-general-surgery-ppt/output/Principles_of_Safe_General_Surgery.pptx'; p=Presentation(path); assert len(p.slides)==16; titles=[];\nfor s in p.slides:\n texts=[sh.text_frame.text.strip() for sh in s.shapes if getattr(sh,'has_text_frame',False) and sh.text_frame.text.strip()]; assert texts; titles.append(texts[0].replace('\\n',' / '));\nprint('VALIDATED: 16 slides'); print(' | '.join(titles[:4]))"
python -c "from pptx import Presentation; p=Presentation('/tmp/workspace/safe-general-surgery-ppt/output/Principles_of_Safe_General_Surgery.pptx'); print('VALIDATED:', len(p.slides), 'slides'); assert len(p.slides)==16; assert all(any(getattr(sh,'has_text_frame',False) and sh.text_frame.text.strip() for sh in s.shapes) for s in p.slides); print('All slides contain text and presentation opens successfully.')"
How can I download this