Make a high risk consent for surgery for hemicolectomy+stoma

Reading File
Asking for Preferences
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Running Command

mkdir -p /home/daytona/workspace/consent-form && ls /home/daytona/workspace/cons…

Writing File

~/consent-form/generate_consent.py

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

OUTPUT = "/home/daytona/workspace/consent-form/Consent_LeftHemicolectomy_Colostomy.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=1.8*cm, leftMargin=1.8*cm,
    topMargin=1.8*cm, bottomMargin=1.8*cm,
    title="High Risk Surgical Consent – Left Hemicolectomy + Colostomy"
)

styles = getSampleStyleSheet()
W = A4[0] - 3.6*cm  # usable width

# ── Custom styles ──────────────────────────────────────────────────────────
H1 = ParagraphStyle("H1", parent=styles["Heading1"],
                    fontSize=13, textColor=colors.HexColor("#1a237e"),
                    spaceAfter=4, spaceBefore=10, leading=16)
H2 = ParagraphStyle("H2", parent=styles["Heading2"],
                    fontSize=10.5, textColor=colors.HexColor("#283593"),
                    spaceAfter=3, spaceBefore=8, leading=13)
BODY = ParagraphStyle("BODY", parent=styles["Normal"],
                      fontSize=9.5, leading=13.5, spaceAfter=3,
                      alignment=TA_JUSTIFY)
BOLD = ParagraphStyle("BOLD", parent=BODY, fontName="Helvetica-Bold")
SMALL = ParagraphStyle("SMALL", parent=styles["Normal"],
                       fontSize=8.5, leading=12, spaceAfter=2)
CENTER = ParagraphStyle("CENTER", parent=styles["Normal"],
                        fontSize=10, alignment=TA_CENTER, spaceAfter=4)
RED_WARN = ParagraphStyle("RED_WARN", parent=BODY,
                          textColor=colors.HexColor("#b71c1c"),
                          fontName="Helvetica-Bold", fontSize=9.5)
SIGN_LABEL = ParagraphStyle("SIGN_LABEL", parent=styles["Normal"],
                             fontSize=9, leading=12)

def hr(): return HRFlowable(width="100%", thickness=0.5,
                            color=colors.HexColor("#9e9e9e"), spaceAfter=4)

def section(title): return [Spacer(1, 4), Paragraph(title, H1), hr()]

def subsection(title): return Paragraph(title, H2)

def body(text): return Paragraph(text, BODY)

def bullet(items, label="•"):
    rows = []
    for it in items:
        rows.append(
            Table([[Paragraph(label, BODY), Paragraph(it, BODY)]],
                  colWidths=[0.6*cm, W-0.6*cm],
                  style=TableStyle([
                      ("VALIGN", (0,0), (-1,-1), "TOP"),
                      ("LEFTPADDING", (0,0), (-1,-1), 0),
                      ("RIGHTPADDING", (0,0), (-1,-1), 0),
                      ("BOTTOMPADDING", (0,0), (-1,-1), 1),
                      ("TOPPADDING", (0,0), (-1,-1), 1),
                  ]))
        )
    return rows

def field_table(rows_data, col_ratios=(0.38, 0.62)):
    cw = [W*r for r in col_ratios]
    tbl_data = []
    for label, value in rows_data:
        tbl_data.append([
            Paragraph(f"<b>{label}</b>", SMALL),
            Paragraph(value, SMALL)
        ])
    t = Table(tbl_data, colWidths=cw)
    t.setStyle(TableStyle([
        ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdbdbd")),
        ("BACKGROUND", (0,0), (0,-1), colors.HexColor("#e8eaf6")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("LEFTPADDING", (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ]))
    return t

def sign_block(signer, extra_lines=None):
    label_w = 4.5*cm
    line_w  = 7*cm
    gap_w   = 1.5*cm
    rows = [[
        Paragraph(f"<b>Signature of {signer}:</b>", SIGN_LABEL),
        Paragraph("_" * 45, SIGN_LABEL),
        Paragraph("", SIGN_LABEL)
    ],[
        Paragraph("<b>Name (print):</b>", SIGN_LABEL),
        Paragraph("_" * 45, SIGN_LABEL),
        Paragraph("", SIGN_LABEL)
    ],[
        Paragraph("<b>Date & Time:</b>", SIGN_LABEL),
        Paragraph("_" * 30, SIGN_LABEL),
        Paragraph("", SIGN_LABEL)
    ]]
    if extra_lines:
        for lbl, _ in extra_lines:
            rows.append([
                Paragraph(f"<b>{lbl}:</b>", SIGN_LABEL),
                Paragraph("_" * 45, SIGN_LABEL),
                Paragraph("", SIGN_LABEL)
            ])
    t = Table(rows, colWidths=[label_w, line_w, gap_w])
    t.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "BOTTOM"),
        ("LEFTPADDING", (0,0), (-1,-1), 0),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("TOPPADDING", (0,0), (-1,-1), 3),
    ]))
    return t

# ═══════════════════════════════════════════════════════════════════════════
# Build content
# ═══════════════════════════════════════════════════════════════════════════
story = []

# ── HEADER ────────────────────────────────────────────────────────────────
header_data = [[
    Paragraph("<b>HOSPITAL / INSTITUTION NAME</b><br/>Address Line 1, City – PIN Code<br/>Tel: XXXXXXXXXX", SMALL),
    Paragraph("<b>HIGH RISK SURGICAL CONSENT FORM</b><br/>"
              "<font color='#b71c1c'><b>LEFT HEMICOLECTOMY / SIGMOID RESECTION<br/>"
              "WITH COLOSTOMY FORMATION</b></font>", CENTER),
    Paragraph("Form No: _________<br/>MRD No: _________<br/>Date: ___/___/______", SMALL)
]]
ht = Table(header_data, colWidths=[5*cm, W-10*cm, 5*cm])
ht.setStyle(TableStyle([
    ("BOX", (0,0), (-1,-1), 1, colors.HexColor("#1a237e")),
    ("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#9fa8da")),
    ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
    ("TOPPADDING", (0,0), (-1,-1), 6),
    ("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
story.append(ht)
story.append(Spacer(1, 6))

# ── PATIENT DETAILS ────────────────────────────────────────────────────────
story += section("SECTION 1 – PATIENT IDENTIFICATION")
story.append(field_table([
    ("Patient Full Name", ""),
    ("Age / Sex / DOB", ""),
    ("Ward / Bed No.", ""),
    ("Diagnosis / Indication", ""),
    ("Surgeon's Name", ""),
    ("Assistant Surgeon", ""),
    ("Anaesthetist's Name", ""),
    ("Planned Date of Surgery", ""),
]))
story.append(Spacer(1, 6))

# ── STATEMENT OF DIAGNOSIS ─────────────────────────────────────────────────
story += section("SECTION 2 – STATEMENT OF DIAGNOSIS & PROPOSED PROCEDURE")
story.append(body(
    "Your doctor has advised that you require a <b>Left Hemicolectomy / Sigmoid Colectomy</b> "
    "with formation of a <b>Colostomy</b>. This involves surgical removal of the diseased portion "
    "of the left side of the large bowel (colon), which may include the sigmoid colon and/or "
    "descending colon, along with its associated blood supply and lymph nodes. "
    "The bowel end is then brought out through the abdominal wall as a <b>colostomy</b> – "
    "an opening (stoma) through which stool will pass into a bag worn on the outside of the abdomen."
))
story.append(body(
    "The colostomy may be <b>temporary</b> (with possibility of reversal at a future operation) "
    "or <b>permanent</b>, depending on the findings at surgery. Your surgeon will advise you on "
    "the likelihood of stoma reversal based on your specific condition."
))

story.append(subsection("Common Indications for This Surgery"))
story += bullet([
    "Colorectal cancer (sigmoid colon / left colon)",
    "Complicated diverticular disease (perforation, obstruction, fistula)",
    "Intestinal obstruction due to tumour or adhesions",
    "Ischaemic colitis with gangrenous bowel",
    "Sigmoid volvulus not amenable to endoscopic management",
    "Trauma to the left colon",
    "Inflammatory bowel disease (Crohn's disease / Ulcerative colitis) refractory to medical therapy",
])
story.append(Spacer(1, 6))

# ── ALTERNATIVE TREATMENT ──────────────────────────────────────────────────
story += section("SECTION 3 – ALTERNATIVES TO SURGERY")
story.append(body(
    "The following non-surgical or alternative options have been considered and discussed. "
    "Your surgeon has advised that surgery is the most appropriate treatment in your case:"
))
story += bullet([
    "Conservative / medical management (antibiotics, bowel rest): insufficient for your current condition",
    "Endoscopic procedures (stenting, dilatation): not feasible or appropriate in your case",
    "Radiotherapy / chemotherapy alone: cannot address acute/mechanical complications",
    "Delayed surgery after optimisation: risk of clinical deterioration outweighs benefit of delay",
    "<b>Refusal of surgery:</b> carries significant risk of death or life-threatening complications from the underlying disease",
])
story.append(Spacer(1, 6))

# ── BENEFITS ──────────────────────────────────────────────────────────────
story += section("SECTION 4 – EXPECTED BENEFITS")
story += bullet([
    "Removal of diseased / cancerous bowel segment",
    "Relief of bowel obstruction and restoration of gastrointestinal function",
    "Prevention of peritonitis, perforation, or sepsis",
    "Potential cure (in cancer cases with non-metastatic disease)",
    "Relief of pain, bleeding, or other symptoms",
    "Improved quality of life following recovery",
])
story.append(Spacer(1, 6))

# ── RISKS & COMPLICATIONS ─────────────────────────────────────────────────
story += section("SECTION 5 – RISKS AND COMPLICATIONS  ⚠ HIGH RISK PROCEDURE")
story.append(Paragraph(
    "⚠  This is a HIGH RISK surgical procedure. The following risks have been specifically "
    "explained to me. I understand they are not exhaustive, and uncommon or rare complications "
    "may also occur.", RED_WARN))
story.append(Spacer(1, 4))

story.append(subsection("A. Anaesthetic Risks"))
story += bullet([
    "Adverse reaction to anaesthetic drugs, including anaphylaxis",
    "Respiratory complications: pneumonia, atelectasis, respiratory failure requiring ventilator support",
    "Cardiovascular events: myocardial infarction, arrhythmias, cardiac arrest",
    "Deep vein thrombosis (DVT) and pulmonary embolism (PE) – potentially fatal",
    "Postoperative cognitive dysfunction (POCD), especially in elderly patients",
    "Awareness under anaesthesia (rare)",
])
story.append(Spacer(1, 4))

story.append(subsection("B. Intraoperative Risks"))
story += bullet([
    "Injury to adjacent structures: ureter, bladder, small bowel, spleen, major blood vessels",
    "Injury to left ureter (especially in sigmoid resection) – may require ureteric repair or nephrostomy",
    "Injury to autonomic nerves (hypogastric plexus) – may cause bladder dysfunction or sexual dysfunction",
    "Major haemorrhage requiring blood transfusion; risk of transfusion-related reactions",
    "Failure to complete laparoscopic / minimally invasive surgery – conversion to open operation",
    "Intraoperative cardiac arrest or death",
])
story.append(Spacer(1, 4))

story.append(subsection("C. Early Postoperative Complications (within 30 days)"))
risk_data = [
    ["Complication", "Approximate Risk", "Clinical Significance"],
    ["Anastomotic leak (if primary anastomosis)", "5–15%", "May require emergency re-operation, ICU admission"],
    ["Surgical site / wound infection", "5–10%", "Wound dehiscence, prolonged healing"],
    ["Intra-abdominal abscess / collections", "3–8%", "Percutaneous drainage or re-operation"],
    ["Prolonged ileus / small bowel obstruction", "5–10%", "Delayed return to oral feeding"],
    ["Stoma necrosis / ischaemia", "2–5%", "Emergency re-operation to revise stoma"],
    ["Stoma retraction / separation", "5–10%", "Stoma revision may be needed"],
    ["Haemorrhage (primary or reactionary)", "2–5%", "Blood transfusion, re-operation"],
    ["Urinary retention / bladder dysfunction", "5–20%", "Temporary or permanent catheterisation"],
    ["Pneumonia / chest infection", "5–10%", "Prolonged hospital stay, ventilator support"],
    ["Deep vein thrombosis / pulmonary embolism", "1–3%", "Anticoagulation, potentially fatal"],
    ["Sepsis / multiorgan failure", "1–5%", "ICU admission, high mortality"],
    ["Death (30-day mortality)", "1–5%", "Higher in emergency setting (up to 20%)"],
]
rt = Table(risk_data, colWidths=[6*cm, 3.5*cm, W-9.5*cm])
rt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a237e")),
    ("TEXTCOLOR", (0,0), (-1,0), colors.white),
    ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE", (0,0), (-1,-1), 8.5),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#9fa8da")),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f5f5f5"), colors.white]),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
    ("RIGHTPADDING", (0,0), (-1,-1), 5),
    ("TOPPADDING", (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
    ("BACKGROUND", (0,12), (-1,12), colors.HexColor("#ffebee")),
    ("FONTNAME", (0,12), (-1,12), "Helvetica-Bold"),
]))
story.append(rt)
story.append(Spacer(1, 6))

story.append(subsection("D. Late / Long-term Complications"))
story += bullet([
    "Parastomal hernia (most common late stoma complication; may require surgical repair)",
    "Stoma prolapse – protrusion of bowel through the stoma opening",
    "Stoma stenosis (narrowing) – may require dilatation or revision",
    "Adhesion-related small bowel obstruction – may require future surgery",
    "Incisional hernia at laparotomy site",
    "Phantom rectal sensation (awareness of absent rectum/sigmoid)",
    "Sexual dysfunction in males: retrograde ejaculation, erectile dysfunction due to nerve injury",
    "Sexual dysfunction in females: dyspareunia, vaginal dryness due to nerve/vessel injury",
    "Chronic pelvic pain or perineal discomfort",
    "Psychological impact: body image concerns, depression, anxiety related to stoma",
    "Quality of life impairment: reported in >25% of patients with permanent colostomy",
    "Recurrence of disease (in cancer cases)",
    "Need for further surgery: stoma reversal, hernia repair, adhesiolysis",
])
story.append(Spacer(1, 6))

story.append(subsection("E. Stoma-Specific Risks – Colostomy"))
story += bullet([
    "Skin excoriation and peristomal dermatitis due to effluent contact",
    "Difficulty achieving a good appliance seal due to skin folds, obesity, or proximity to bony prominences",
    "Odour and flatus management requiring dietary modification",
    "Psychological adjustment difficulty; counselling and stoma nurse support will be provided",
    "Risk of mucocutaneous separation or wound breakdown around stoma site",
    "Colostomy irrigation may be required to establish bowel regularity (takes 4–6 weeks)",
])
story.append(Spacer(1, 6))

story.append(subsection("F. Risk Factors That May Increase Operative Risk in This Patient"))
risk_factors_data = [
    ["Condition", "Impact"],
    ["Advanced age (>70 years)", "Increased cardiopulmonary and cognitive risk"],
    ["Diabetes mellitus", "Impaired wound healing, infection risk"],
    ["Obesity (BMI >30)", "Technical difficulty, thromboembolism, wound complication"],
    ["Prior abdominal surgery", "Dense adhesions, increased operative time and injury risk"],
    ["Malnutrition / hypoalbuminaemia", "Poor wound healing, anastomotic failure, sepsis"],
    ["Cardiovascular disease", "Cardiac events, haemodynamic instability"],
    ["Chronic kidney disease", "Fluid management issues, medication toxicity"],
    ["Immunosuppression / steroid use", "Infection, delayed healing"],
    ["Anaemia / coagulopathy", "Haemorrhage, transfusion requirement"],
    ["Emergency / urgent surgery", "All risks significantly higher (mortality up to 20%)"],
    ["Advanced malignancy", "Incomplete resection, early recurrence"],
]
rft = Table(risk_factors_data, colWidths=[6.5*cm, W-6.5*cm])
rft.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#37474f")),
    ("TEXTCOLOR", (0,0), (-1,0), colors.white),
    ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE", (0,0), (-1,-1), 8.5),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#b0bec5")),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f5f5f5"), colors.white]),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
    ("RIGHTPADDING", (0,0), (-1,-1), 5),
    ("TOPPADDING", (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
]))
story.append(rft)
story.append(Spacer(1, 6))

# ── BLOOD TRANSFUSION ─────────────────────────────────────────────────────
story += section("SECTION 6 – BLOOD TRANSFUSION CONSENT")
story.append(body(
    "During or after surgery, blood transfusion may be necessary. I consent to receive "
    "blood and blood products if clinically required. I understand the associated risks including "
    "transfusion reactions (febrile, haemolytic), transmission of infections (extremely rare with "
    "current screening), fluid overload, and transfusion-related acute lung injury (TRALI)."
))
story.append(body(
    "<b>Refusal of blood transfusion:</b>  "
    "□ I refuse blood transfusion (state reason if any): ____________________________________"
))
story.append(Spacer(1, 4))

# ── ANAESTHESIA CONSENT ───────────────────────────────────────────────────
story += section("SECTION 7 – ANAESTHESIA CONSENT")
story.append(body(
    "I understand that the surgery will be performed under <b>General Anaesthesia</b> "
    "(with or without epidural / regional block). The anaesthetist will discuss the anaesthetic "
    "plan separately. I consent to the administration of anaesthesia as judged appropriate by "
    "the anaesthetic team."
))
story.append(Spacer(1, 4))

# ── INTRAOPERATIVE DECISION ───────────────────────────────────────────────
story += section("SECTION 8 – INTRAOPERATIVE EXTENSION OF PROCEDURE")
story.append(body(
    "I understand and consent that if intraoperative findings necessitate extension of the "
    "planned procedure, the operating surgeon is authorised to perform additional procedures "
    "without delay. These may include:"
))
story += bullet([
    "Formation of a permanent colostomy instead of a planned temporary stoma",
    "Extended resection (e.g. sigmoid, rectal, or splenic flexure involvement)",
    "Splenectomy if splenic injury or involvement occurs",
    "Ureteric stenting or repair if ureteric injury is encountered",
    "Oophorectomy or hysterectomy if ovarian / uterine involvement (female patients)",
    "Abdominal wash-out and drain placement for intra-abdominal contamination",
    "Conversion from laparoscopic to open surgery",
])
story.append(Spacer(1, 6))

# ── PATIENT STATEMENT ─────────────────────────────────────────────────────
story += section("SECTION 9 – PATIENT / GUARDIAN DECLARATION")
story.append(body(
    "I, the undersigned, hereby declare that:"
))
decl = [
    "I have been explained, in a language I understand, the nature of my condition, the proposed surgical procedure, its purpose, expected benefits, alternatives, and the risks and complications described above.",
    "I have had the opportunity to ask questions and all my queries have been answered to my satisfaction.",
    "I understand this is a HIGH RISK procedure and the risks including death have been specifically brought to my attention.",
    "I have not been coerced or pressured into giving this consent.",
    "I freely and voluntarily give my consent to the performance of the surgical procedure: <b>Left Hemicolectomy / Sigmoid Resection with Colostomy Formation</b>, and any additional procedures deemed necessary during surgery.",
    "I consent to photography / video recording of the procedure for medical education purposes only.  □ Yes  □ No",
    "I consent to tissue samples / specimens being sent for histopathological examination.",
    "I understand that no guarantee of outcome has been made to me.",
]
for i, d in enumerate(decl, 1):
    story.append(Paragraph(f"&nbsp;&nbsp;{i}.&nbsp;&nbsp;{d}", BODY))
story.append(Spacer(1, 6))

# ── SIGNATURES ─────────────────────────────────────────────────────────────
story += section("SECTION 10 – SIGNATURES")

# Patient signature row
story.append(subsection("Patient Signature"))
story.append(sign_block("Patient", [("Relationship to patient", "(Self)")]))
story.append(Spacer(1, 4))

# Guardian/LAR
story.append(subsection("Guardian / Legally Authorised Representative (if patient unable to consent)"))
story.append(body("Reason patient unable to consent: _______________________________________________"))
story.append(sign_block("Guardian / LAR", [
    ("Relationship to Patient", ""),
    ("Contact No.", ""),
]))
story.append(Spacer(1, 4))

# Witness
story.append(subsection("Witness"))
story.append(sign_block("Witness", [("Designation", "")]))
story.append(Spacer(1, 4))

# Surgeon
story.append(subsection("Surgeon's Declaration"))
story.append(body(
    "I certify that I have explained the procedure, its risks and alternatives to the patient "
    "(and/or guardian) in a language they comprehend, answered all questions, and obtained "
    "voluntary informed consent."
))
story.append(sign_block("Operating Surgeon", [
    ("Designation / Qualification", ""),
    ("Registration No. (MCI/NMC)", ""),
]))
story.append(Spacer(1, 4))

# Interpreter (if applicable)
story.append(subsection("Interpreter (if used)"))
story.append(sign_block("Interpreter", [("Language used", "")]))
story.append(Spacer(1, 6))

# ── REVOCATION ────────────────────────────────────────────────────────────
story += section("SECTION 11 – WITHDRAWAL OF CONSENT (if applicable)")
story.append(body(
    "I wish to withdraw my consent given earlier on ___ / ___ / ______ at _______ hrs."
))
story.append(Spacer(1, 2))
story.append(body("Reason (optional): __________________________________________________________________"))
story.append(Spacer(1, 4))
story.append(sign_block("Patient / Guardian"))
story.append(Spacer(1, 4))

# ── FOOTER ────────────────────────────────────────────────────────────────
story.append(hr())
footer_data = [[
    Paragraph("<b>Page 1 of 1</b>  |  This form must be filed in the patient's medical record.", SMALL),
    Paragraph("Prepared in accordance with Indian Medical Council (Professional Conduct, Etiquette and Ethics) Regulations 2002 & MCI Guidelines on Informed Consent.", SMALL),
]]
ft = Table(footer_data, colWidths=[W*0.35, W*0.65])
ft.setStyle(TableStyle([
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING", (0,0), (-1,-1), 0),
    ("TOPPADDING", (0,0), (-1,-1), 2),
]))
story.append(ft)

# ── BUILD ──────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF generated: {OUTPUT}")
Running Command

cd /home/daytona/workspace/consent-form && python generate_consent.py 2>&1

Running Command

ls -lh /home/daytona/workspace/consent-form/Consent_LeftHemicolectomy_Colostomy.…

The PDF has been generated successfully. Here is your download link:

Consent LeftHemicolectomy Colostomy

PDF Document · PDF


What the form contains (11 sections):
SectionContent
1Patient identification fields (name, age/sex, MRD no., surgeon, anaesthetist, date)
2Statement of diagnosis, description of left hemicolectomy + colostomy, and common indications
3Alternatives to surgery and consequences of refusal
4Expected benefits
5High-risk complications - structured into 6 sub-tables: anaesthetic, intraoperative, early postoperative (with % risk table), late/long-term, stoma-specific, and patient risk factor amplifiers
6Blood transfusion consent with option to refuse
7Anaesthesia consent
8Intraoperative extension-of-procedure consent (e.g., permanent stoma, splenectomy, ureteric repair, conversion to open)
9Patient declaration (9-point voluntary consent statement)
10Signature blocks for patient, guardian/LAR, witness, operating surgeon, interpreter
11Withdrawal of consent section
Clinical risk data sourced from: Fischer's Mastery of Surgery (8th ed.), Maingot's Abdominal Operations, Bailey & Love's Surgery (28th ed.) - covering anastomotic leak rates, stoma complications (ischaemia, retraction, parastomal hernia, prolapse, stenosis), wound infection, DVT/PE, sexual/bladder nerve injury, and 30-day mortality figures.
Compliance note: The footer references Indian Medical Council (Professional Conduct, Etiquette and Ethics) Regulations 2002 and MCI guidelines on informed consent, as applicable to Indian hospital practice.
This is a shared conversation. Sign in to Orris to start your own chat.