A female
| Area | Finding |
|---|---|
| Esophagus | LA Grade B esophagitis in the lower esophagus |
| GE junction | At 39 cm; diaphragmatic pinch at 40 cm |
| Stomach (Fundus, Body, Antrum, Pylorus) | Normal |
| Duodenum (D1, D2) | Normal |
| Biopsy | Not taken |
| Organ | Finding |
|---|---|
| Liver | Enlarged (~16.4 cm); diffusely increased echogenicity (fatty liver, Grade II) |
| Gallbladder | Multiple stones, largest ~7 mm; no inflammation |
| Biliary tree / CBD | Normal, not dilated |
| Pancreas | Head and proximal body normal; distal obscured by bowel gas |
| Spleen | Normal |
| Kidneys | Both normal in size and morphology |
| Uterus | 5.5 x 3.1 x 9.8 cm; endometrial stripe 5.5 mm - normal for age |
| Ovaries | Right: 3.8 x 1.4 cm; Left: 2.0 x 1.0 cm - normal |
| Free fluid | None |
Patient has frequent right upper pain, and near umbilicus pain, right lower quadrant spasmodic pain . Overall pain relived on taking pain medications
| Location | Likely Source |
|---|---|
| Right upper quadrant (RUQ) | Gallstones (biliary colic) / Fatty liver (hepatomegaly) |
| Periumbilical (near-umbilicus) | Referred visceral pain from biliary/intestinal origin |
| Right lower quadrant (RLQ) - spasmodic | Possible intestinal spasm / could be referred from above |
| Relieved by pain medications | Suggests smooth muscle spasm, NOT acute surgical emergency |
"Symptomatic cholelithiasis is characterized by biliary colic, a dull discomfort in the RUQ or epigastrium that occurs postprandially. Discomfort is typically associated with fatty foods due to gallbladder contraction against an obstructing gallstone... This pain is typically self-limited but may radiate to the back or right shoulder and may present with nausea, vomiting, and diaphoresis." - Fischer's Mastery of Surgery
| Feature | This Patient | Concern Level |
|---|---|---|
| Fever | Not mentioned | Low |
| Jaundice | Not reported | Low |
| Persistent pain >6 hours | Relieved by meds | Low |
| Vomiting | Not reported | Low |
| Rebound tenderness | Not examined | Needs assessment |
Create a pre-operative checklist PDF for symptomatic cholelithiasis surgery
ls -la /home/daytona/workspace/ 2>/dev/null | head -20
mkdir -p /home/daytona/workspace/cholecystectomy-preop
~/cholecystectomy-preop/generate_checklist.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.pdfgen import canvas
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
import datetime
OUTPUT = "/home/daytona/workspace/cholecystectomy-preop/PreOp_Checklist_Cholecystectomy.pdf"
# ── Colours ──────────────────────────────────────────────────────────────────
TEAL = colors.HexColor("#1A6B6B")
TEAL_LIGHT = colors.HexColor("#E6F4F4")
TEAL_MID = colors.HexColor("#2E9E9E")
ORANGE = colors.HexColor("#D6650A")
GREY_BG = colors.HexColor("#F5F5F5")
GREY_LINE = colors.HexColor("#CCCCCC")
WHITE = colors.white
BLACK = colors.black
W, H = A4
# ── Doc ───────────────────────────────────────────────────────────────────────
def header_footer(c, doc):
c.saveState()
# Top bar
c.setFillColor(TEAL)
c.rect(0, H - 22*mm, W, 22*mm, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 13)
c.drawString(15*mm, H - 13*mm, "PRE-OPERATIVE CHECKLIST")
c.setFont("Helvetica", 10)
c.drawRightString(W - 15*mm, H - 10*mm, "Laparoscopic Cholecystectomy")
c.drawRightString(W - 15*mm, H - 16*mm, "Symptomatic Cholelithiasis")
# Bottom bar
c.setFillColor(TEAL)
c.rect(0, 0, W, 10*mm, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont("Helvetica", 7.5)
c.drawString(15*mm, 3.5*mm, "Gastroenterology / General Surgery Department")
c.drawRightString(W - 15*mm, 3.5*mm,
f"Generated: {datetime.date.today().strftime('%d %b %Y')} | Page {doc.page}")
c.restoreState()
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
topMargin=28*mm, bottomMargin=16*mm,
leftMargin=14*mm, rightMargin=14*mm
)
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
st_section = S("section",
fontSize=10, fontName="Helvetica-Bold",
textColor=WHITE, leading=14, spaceAfter=0, spaceBefore=0)
st_body = S("body",
fontSize=8.5, fontName="Helvetica",
textColor=BLACK, leading=12, spaceAfter=1)
st_bold = S("bold",
fontSize=8.5, fontName="Helvetica-Bold",
textColor=BLACK, leading=12)
st_note = S("note",
fontSize=7.5, fontName="Helvetica-Oblique",
textColor=colors.HexColor("#555555"), leading=11)
st_patient = S("patient",
fontSize=8.5, fontName="Helvetica",
textColor=BLACK, leading=13)
st_orange = S("orange",
fontSize=8, fontName="Helvetica-Bold",
textColor=ORANGE, leading=11)
# ── Helper: section header row ────────────────────────────────────────────────
def section_header(title, icon=""):
cell = Paragraph(f"{icon} {title}" if icon else title, st_section)
t = Table([[cell]], colWidths=[W - 28*mm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING",(0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [3]),
]))
return t
# ── Helper: checkbox row ───────────────────────────────────────────────────────
BOX = "☐" # unicode checkbox
def chk(label, note=None, indent=0):
pad = "\u00a0" * (indent * 4)
main = Paragraph(f"{pad}{BOX} {label}", st_body)
if note:
n = Paragraph(f"{pad}\u00a0\u00a0\u00a0\u00a0\u00a0{note}", st_note)
return [main, n]
return [main]
def chk_rows(items):
"""items = list of (label, note_or_None, indent)"""
rows = []
for label, note, indent in items:
for p in chk(label, note, indent):
rows.append([p])
return rows
def checktable(items, bg=WHITE):
rows = chk_rows(items)
t = Table(rows, colWidths=[W - 28*mm])
style = [
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING",(0,0), (-1,-1), 2),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("LINEBELOW", (0,0), (-1,-2), 0.3, GREY_LINE),
]
# Alternate zebra
for i in range(0, len(rows), 2):
style.append(("BACKGROUND", (0,i), (-1,i), GREY_BG))
t.setStyle(TableStyle(style))
return t
# ── Patient info box ──────────────────────────────────────────────────────────
def patient_box():
fields = [
["Patient Name:", "_"*38, "MRD / UHID:", "_"*20],
["Age / Sex:", "_"*38, "Date of Surgery:", "_"*20],
["Surgeon:", "_"*38, "Anaesthetist:", "_"*20],
["Ward / Bed:", "_"*38, "Planned Procedure:", "Laparoscopic Cholecystectomy"],
]
col_w = [(W-28*mm)*f for f in [0.18, 0.32, 0.18, 0.32]]
rows = []
for r in fields:
rows.append([Paragraph(r[i], st_bold if i % 2 == 0 else st_patient)
for i in range(4)])
t = Table(rows, colWidths=col_w)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_LIGHT),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING",(0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("BOX", (0,0), (-1,-1), 0.8, TEAL),
("LINEAFTER", (1,0), (1,-1), 0.5, TEAL_MID),
("LINEAFTER", (3,0), (3,-1), 0.5, TEAL_MID),
("LINEBELOW", (0,0), (-1,-2), 0.4, TEAL_MID),
]))
return t
# ── Two-column checktable ─────────────────────────────────────────────────────
def two_col_checks(left_items, right_items, title_l="", title_r=""):
cw = (W - 28*mm) / 2 - 2*mm
def make_col(items, title):
elems = []
if title:
elems.append(Paragraph(title, S("ct", fontSize=8, fontName="Helvetica-Bold",
textColor=TEAL, leading=11)))
for label, note, indent in items:
pad = "\u00a0" * (indent * 4)
elems.append(Paragraph(f"{pad}{BOX} {label}", st_body))
if note:
elems.append(Paragraph(f" {note}", st_note))
return elems
left = make_col(left_items, title_l)
right = make_col(right_items, title_r)
max_rows = max(len(left), len(right))
# pad shorter
while len(left) < max_rows: left.append(Paragraph("", st_body))
while len(right) < max_rows: right.append(Paragraph("", st_body))
rows = [[l, r] for l, r in zip(left, right)]
t = Table(rows, colWidths=[cw, cw], hAlign="LEFT")
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREY_BG),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING",(0,0), (-1,-1), 2),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("LINEAFTER", (0,0), (0,-1), 0.5, GREY_LINE),
("LINEBELOW", (0,0), (-1,-2), 0.3, GREY_LINE),
]))
return t
# ── Build story ───────────────────────────────────────────────────────────────
story = []
sp = lambda n=4: Spacer(1, n*mm)
# Patient info
story.append(sp(1))
story.append(patient_box())
story.append(sp(3))
# ─── 1. CLINICAL HISTORY & INDICATIONS ───────────────────────────────────────
story.append(KeepTogether([
section_header("1. CLINICAL HISTORY & INDICATIONS"),
sp(1),
checktable([
("Confirmed symptomatic cholelithiasis (biliary colic, RUQ pain)", None, 0),
("Ultrasound abdomen documented gallstones", "Largest stone size noted: _______ mm", 0),
("Duration and frequency of symptoms recorded", None, 0),
("Exclude acute cholecystitis (no fever, no Murphy's sign, no leukocytosis)", None, 0),
("Exclude choledocholithiasis (normal CBD on USG / LFTs normal)", None, 0),
("Exclude gallstone pancreatitis (normal serum amylase / lipase)", None, 0),
("Co-morbidities documented (NAFLD, DM, HTN, CAD, respiratory disease)", None, 0),
("Current medications listed (anticoagulants, antiplatelets, antidiabetics)", None, 0),
("Allergies documented (latex, iodine, drugs)", None, 0),
("Previous abdominal surgeries noted (risk of adhesions)", None, 0),
]),
sp(1),
]))
# ─── 2. LABORATORY INVESTIGATIONS ────────────────────────────────────────────
story.append(KeepTogether([
section_header("2. LABORATORY INVESTIGATIONS"),
sp(1),
two_col_checks(
left_items=[
("Complete Blood Count (CBC)", None, 0),
("Serum Electrolytes (Na, K, Cl, HCO3)", None, 0),
("Blood Urea Nitrogen (BUN) / Creatinine", None, 0),
("Fasting Blood Sugar / HbA1c", "Relevant given NAFLD/metabolic risk", 0),
("Lipid Profile", None, 0),
("Liver Function Tests (AST, ALT, ALP, GGT, Bilirubin)", "Rule out choledocholithiasis", 0),
("Serum Amylase / Lipase", "Rule out concurrent pancreatitis", 0),
("Coagulation Profile (PT, APTT, INR)", None, 0),
],
right_items=[
("Blood Group & Type-and-Screen / Cross-match", None, 0),
("HIV, HBsAg, HCV (serology)", None, 0),
("Urine Routine & Microscopy", None, 0),
("Urine Pregnancy Test (if pre-menopausal)", None, 0),
("Thyroid Function Tests (if clinically indicated)", None, 0),
("Serum Calcium (if hypercalcemia suspected)", None, 0),
("Tumour Marker CA 19-9 (if suspicious of GB malignancy)", None, 0),
("Sickle cell screen (if ethnically indicated)", None, 0),
],
title_l="Biochemistry & Haematology",
title_r="Additional Tests",
),
sp(1),
]))
# ─── 3. IMAGING & SPECIAL INVESTIGATIONS ─────────────────────────────────────
story.append(KeepTogether([
section_header("3. IMAGING & SPECIAL INVESTIGATIONS"),
sp(1),
checktable([
("Ultrasound abdomen & pelvis reviewed (stones, GB wall, CBD, liver)", None, 0),
("Gallbladder wall thickness assessed (normal < 3 mm)", None, 0),
("Common bile duct diameter assessed (normal < 6 mm)", None, 0),
("Hepatomegaly / fatty liver changes noted for anaesthetic planning", "This patient: Grade II NAFLD confirmed", 0),
("Chest X-ray (PA view) - cardiac silhouette, lung fields, diaphragm", None, 0),
("ECG (12-lead) - baseline cardiac assessment", None, 0),
("MRCP if CBD stones suspected or LFTs abnormal", None, 0),
("CT abdomen (only if GB malignancy, porcelain GB, or complex anatomy suspected)", None, 0),
("HIDA scan if acalculous cholecystitis or biliary dyskinesia suspected", None, 0),
("Echocardiography if significant cardiac history / poor functional capacity", None, 0),
("Pulmonary function tests if significant respiratory disease", None, 0),
]),
sp(1),
]))
# ─── 4. ANAESTHETIC ASSESSMENT ────────────────────────────────────────────────
story.append(KeepTogether([
section_header("4. ANAESTHETIC ASSESSMENT"),
sp(1),
two_col_checks(
left_items=[
("ASA Physical Status Classification assigned", "ASA I-II: routine; ASA III+: senior anaesthetist", 0),
("Airway assessment (Mallampati score, neck mobility)", None, 0),
("Dentition checked (loose teeth, dental prosthetics)", None, 0),
("BMI recorded (obesity = higher pneumoperitoneum risk)", None, 0),
("NPO status confirmed: solids 6h, clear liquids 2h before surgery", None, 0),
("Antibiotic prophylaxis planned (Cefazolin 1-2 g IV at induction)", None, 0),
("DVT prophylaxis planned (LMWH, TED stockings)", None, 0),
],
right_items=[
("Antidiabetic medications managed (hold metformin, adjust insulin)", None, 0),
("Anticoagulants bridged / held as per protocol", None, 0),
("Antiplatelets (aspirin / clopidogrel) held if indicated", None, 0),
("Antihypertensives continued (except ACE-I/ARB on day of surgery)", None, 0),
("GERD / esophagitis management reviewed (PPI continued)", "This patient: LA Grade B esophagitis - continue PPI", 0),
("Anaesthetic risk discussed with patient; consent obtained", None, 0),
("High-risk anaesthetic plan documented if applicable", None, 0),
],
title_l="Assessment",
title_r="Medication Management",
),
sp(1),
]))
# ─── 5. SURGICAL CONSENT & COUNSELLING ────────────────────────────────────────
story.append(KeepTogether([
section_header("5. SURGICAL CONSENT & PATIENT COUNSELLING"),
sp(1),
checktable([
("Informed consent obtained for laparoscopic cholecystectomy", None, 0),
("Consent for conversion to open cholecystectomy if required", "Conversion rate ~3-5% in elective cases", 0),
("Risks explained: bleeding, infection, bile duct injury, bile leak, hernia, port-site complications", None, 0),
("Possibility of choledocholithiasis and need for ERCP / IOC explained", None, 0),
("Patient educated about NPO instructions, bowel prep (if applicable)", None, 0),
("Post-operative expectations explained (pain, diet, return to activity)", None, 0),
("Consent for intra-operative cholangiogram (IOC) if planned", None, 0),
("Next-of-kin / guardian informed (if patient requests)", None, 0),
]),
sp(1),
]))
# ─── 6. DAY-OF-SURGERY CHECKLIST ──────────────────────────────────────────────
story.append(KeepTogether([
section_header("6. DAY OF SURGERY CHECKLIST"),
sp(1),
two_col_checks(
left_items=[
("Patient identity confirmed (wristband, verbal check)", None, 0),
("Surgical site marked (if applicable)", None, 0),
("NPO compliance confirmed", None, 0),
("IV access established (at least 18G cannula)", None, 0),
("IV fluids commenced as per protocol", None, 0),
("Pre-operative antibiotic given within 60 min of incision", None, 0),
("DVT prophylaxis applied (stockings / LMWH given)", None, 0),
("Urinary catheter inserted (if procedure > 2 hrs or surgeon preference)", None, 0),
],
right_items=[
("Consent form in notes, signed and witnessed", None, 0),
("Blood results reviewed and actioned", None, 0),
("Imaging reviewed by operating surgeon", None, 0),
("WHO Surgical Safety Checklist completed (Sign-In)", None, 0),
("Patient jewellery / nail polish / prosthetics removed", None, 0),
("Allergies re-confirmed and allergy band applied", None, 0),
("Patient weight documented (for drug dosing)", None, 0),
("Anaesthetic machine and equipment checked by anaesthetist", None, 0),
],
title_l="Preparation",
title_r="Documentation & Safety",
),
sp(1),
]))
# ─── 7. SPECIAL CONSIDERATIONS FOR THIS PATIENT ───────────────────────────────
story.append(KeepTogether([
section_header("7. SPECIAL CONSIDERATIONS — MENAKA MANAVALAN (53F)"),
sp(1),
checktable([
("NAFLD Grade II / Hepatomegaly: anaesthetist aware; hepatotoxic agents avoided", "Enlarged liver may obstruct laparoscopic view - experienced surgeon preferred", 0),
("LA Grade B Esophagitis / GERD: rapid sequence induction considered; continue PPI perioperatively", None, 0),
("Metabolic workup complete: HbA1c, fasting glucose, lipid profile done", None, 0),
("Gallstones: multiple, largest 7 mm - low risk of CBD stone; LFTs normal confirmed", None, 0),
("Age 53, post-menopausal considerations: DVT risk higher - LMWH + TED stockings mandatory", None, 0),
("Cholelithiasis symptom burden documented (frequency of attacks, severity of pain, analgesic use)", None, 0),
("Surgeon briefed on concurrent endoscopy findings (no gastric/duodenal pathology)", None, 0),
]),
sp(1),
]))
# ─── 8. POST-OPERATIVE PLAN ────────────────────────────────────────────────────
story.append(KeepTogether([
section_header("8. POST-OPERATIVE PLAN (Pre-document Before Surgery)"),
sp(1),
two_col_checks(
left_items=[
("Analgesia plan: paracetamol + NSAIDs + PRN opioid", None, 0),
("Anti-emetics prescribed (ondansetron / metoclopramide)", None, 0),
("Resume PPI post-operatively (for esophagitis)", None, 0),
("Diet: clear fluids day 0, soft diet day 1, normal by discharge", None, 0),
("Mobilisation: encouraged within 4-6 hours post-op", None, 0),
("Wound care instructions documented", None, 0),
],
right_items=[
("Discharge criteria defined (pain controlled, tolerating diet, afebrile)", None, 0),
("Follow-up appointment booked: 1-2 weeks post-op", None, 0),
("Histopathology of GB specimen: to be sent routinely", None, 0),
("NAFLD follow-up: hepatology referral organised", None, 0),
("GP / referring doctor discharge summary to be completed", None, 0),
("Patient education leaflet given (diet, activity, red flags)", None, 0),
],
title_l="Immediate Post-Op",
title_r="Discharge & Follow-Up",
),
sp(1),
]))
# ─── Signatures ───────────────────────────────────────────────────────────────
story.append(KeepTogether([
section_header("9. SIGN-OFF"),
sp(2),
]))
sig_data = [
[Paragraph("Surgeon", st_bold),
Paragraph("Anaesthetist", st_bold),
Paragraph("Nursing / Coordinator", st_bold)],
[Paragraph("Name: ___________________", st_patient),
Paragraph("Name: ___________________", st_patient),
Paragraph("Name: ___________________", st_patient)],
[Paragraph("Signature: ______________", st_patient),
Paragraph("Signature: ______________", st_patient),
Paragraph("Signature: ______________", st_patient)],
[Paragraph("Date/Time: ______________", st_patient),
Paragraph("Date/Time: ______________", st_patient),
Paragraph("Date/Time: ______________", st_patient)],
]
sig_t = Table(sig_data, colWidths=[(W-28*mm)/3]*3)
sig_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL_LIGHT),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING",(0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 0.8, TEAL),
("LINEBEFORE", (1,0), (2,-1), 0.5, TEAL_MID),
("LINEBELOW", (0,0), (-1,-2), 0.4, GREY_LINE),
]))
story.append(sig_t)
story.append(sp(2))
# Disclaimer note
story.append(Paragraph(
"Note: This checklist is a clinical aide-memoire and should be used alongside current institutional protocols, "
"NICE/WHO surgical safety guidelines, and the clinical judgment of the responsible surgical team. "
"It is not a substitute for full clinical assessment.",
st_note
))
# ── Build ──────────────────────────────────────────────────────────────────────
doc.build(story, onFirstPage=header_footer, onLaterPages=header_footer)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/cholecystectomy-preop && python generate_checklist.py 2>&1
ls -lh /home/daytona/workspace/cholecystectomy-preop/PreOp_Checklist_Cholecystectomy.pdf
PreOp Checklist Cholecystectomy
PDF Document · PDF
| # | Section | Key Contents |
|---|---|---|
| 1 | Clinical History & Indications | Symptom confirmation, excluding cholecystitis / choledocholithiasis / pancreatitis, co-morbidities, medications, allergies |
| 2 | Laboratory Investigations | CBC, LFTs, coagulation, BUG/creatinine, HbA1c, lipids, serology, pregnancy test, CA 19-9 |
| 3 | Imaging & Special Investigations | USG review (GB wall, CBD size), CXR, ECG, MRCP if CBD stones suspected, HIDA if dyskinesia |
| 4 | Anaesthetic Assessment | ASA status, airway, BMI, NPO status, antibiotic prophylaxis, DVT prophylaxis, medication management |
| 5 | Surgical Consent & Counselling | Informed consent, conversion-to-open consent, risks, patient education |
| 6 | Day-of-Surgery Checklist | Patient ID, IV access, antibiotics within 60 min, WHO Safety Checklist sign-in |
| 7 | Special Considerations (Menaka) | NAFLD-specific hepatic precautions, GERD/esophagitis RSI note, metabolic workup, post-menopausal DVT risk |
| 8 | Post-Operative Plan | Analgesia, diet progression, mobilisation, NAFLD follow-up, histopathology of GB specimen |
| 9 | Sign-Off | Surgeon, anaesthetist, and nursing sign-off with date/time fields |