She is suffering with fever busy ache chills sweating since 3 days further treatment what I need to suggest based on this reports
"urinary tract infection" AND "pyelonephritis" AND treatment
Important notice: This analysis is intended to assist a clinician. It does not replace direct physical examination or physician judgment. Prescription decisions must be made by the treating doctor.
| Parameter | Result | Reference | Interpretation |
|---|---|---|---|
| Haemoglobin | 12.9 g/dL | 11.5-16.5 | Normal |
| Total Leucocyte Count | 15.8 × 10⁹/L | 4-11 | HIGH - Leukocytosis |
| MID (monocytes/eosinophils) | 2.3 × 10⁹/L | 0.1-1.5 | HIGH |
| Granulocytes | 10.4 × 10⁹/L | 1.2-8.0 | HIGH - Neutrophilia |
| MID% | 15.1% | 2.0-15.0 | Borderline high |
| Granulocytes% | 65% | 35-80 | Normal |
| Platelets | 332 × 10⁹/L | 100-400 | Normal |
| Parameter | Result | Reference | Interpretation |
|---|---|---|---|
| CRP | 128.9 µg/mL | <10 | MARKEDLY ELEVATED - ~13× normal |
| SGOT | 62 U/L | <40 | Mildly elevated |
| SGPT | 51 U/L | <40 | Mildly elevated |
| ALP | 112 U/L | 42-142 | Normal |
| Bilirubin (Total) | 0.7 mg/dL | 0-1.0 | Normal |
| Serum Creatinine | 0.9 mg/dL | 0.6-1.1 (F) | Normal (upper limit) |
| Blood Urea | 34 mg/dL | 10-50 | Normal |
| Finding | Result | Significance |
|---|---|---|
| Nitrite | POSITIVE | Bacterial UTI (gram-negative organisms) |
| Protein | + | Renal inflammation |
| Blood | ++ | Haematuria - renal/bladder inflammation |
| Pus Cells | 15-20 cells/HPF | Significant pyuria - active UTI |
| Epithelial cells | 4-6/HPF | Mild |
| RBCs | 2-4/HPF | Haematuria |
| Specific Gravity | 1.030 | Concentrated urine |
| Test | Result |
|---|---|
| Dengue NS1 Ag | NEGATIVE |
| Dengue IgM/IgG | NEGATIVE |
| Malaria (P. vivax/P. falciparum) | NEGATIVE |
Create a summary PDF of this treatment plan to share with the patient
mkdir -p /tmp/workspace/patient-report && ls /tmp/workspace/patient-report/
~/patient-report/generate_pdf.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.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from datetime import date
OUTPUT = "/tmp/workspace/patient-report/Treatment_Summary_KDhathri.pdf"
# ── Colour palette ──────────────────────────────────────────────────────────
TEAL = colors.HexColor("#0D7377")
TEAL_LIGHT = colors.HexColor("#E6F4F4")
ORANGE = colors.HexColor("#E87722")
ORANGE_BG = colors.HexColor("#FEF3E8")
RED = colors.HexColor("#C0392B")
RED_BG = colors.HexColor("#FDEDEC")
GREEN = colors.HexColor("#1E8449")
GREEN_BG = colors.HexColor("#EAFAF1")
GREY_DARK = colors.HexColor("#2C3E50")
GREY_MED = colors.HexColor("#566573")
GREY_LIGHT = colors.HexColor("#F2F3F4")
WHITE = colors.white
# ── Document ────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=18*mm, rightMargin=18*mm,
topMargin=14*mm, bottomMargin=18*mm,
title="Treatment Summary – K. Dhathri",
author="Rayalaseema Diagnostics / Dr. Dadireddy Sai Sree",
)
W = A4[0] - 36*mm # usable width
# ── Styles ──────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()
def S(name, parent="Normal", **kw):
return ParagraphStyle(name, parent=base[parent], **kw)
sTitle = S("sTitle", fontSize=20, textColor=WHITE, alignment=TA_CENTER,
fontName="Helvetica-Bold", leading=26)
sSubtitle = S("sSubtitle", fontSize=10, textColor=WHITE, alignment=TA_CENTER,
fontName="Helvetica", leading=14)
sSectionHdr = S("sSectionHdr", fontSize=11, textColor=WHITE,
fontName="Helvetica-Bold", leading=15)
sBody = S("sBody", fontSize=9.5, textColor=GREY_DARK,
fontName="Helvetica", leading=14, spaceAfter=3)
sBullet = S("sBullet", fontSize=9.5, textColor=GREY_DARK,
fontName="Helvetica", leading=14, leftIndent=12, spaceAfter=2,
bulletFontName="Helvetica", bulletFontSize=9.5)
sWarning = S("sWarning", fontSize=9, textColor=RED,
fontName="Helvetica-Bold", leading=13)
sNote = S("sNote", fontSize=8.5, textColor=GREY_MED,
fontName="Helvetica-Oblique", leading=12, alignment=TA_CENTER)
sLabel = S("sLabel", fontSize=8.5, textColor=GREY_MED,
fontName="Helvetica-Bold", leading=11)
sValue = S("sValue", fontSize=9.5, textColor=GREY_DARK,
fontName="Helvetica", leading=13)
sDiag = S("sDiag", fontSize=13, textColor=TEAL,
fontName="Helvetica-Bold", leading=18, alignment=TA_CENTER)
sFooter = S("sFooter", fontSize=7.5, textColor=GREY_MED,
fontName="Helvetica-Oblique", alignment=TA_CENTER, leading=11)
# ── Helper: coloured section header bar ─────────────────────────────────────
def section_header(text, bg=TEAL, icon=""):
full = f"{icon} {text}" if icon else text
data = [[Paragraph(full, sSectionHdr)]]
t = Table(data, colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
return t
# ── Helper: two-column key/value row ────────────────────────────────────────
def kv_row(label, value, label_w=55*mm):
return Table(
[[Paragraph(label, sLabel), Paragraph(value, sValue)]],
colWidths=[label_w, W - label_w],
style=[
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING", (0,0), (-1,-1), 2),
]
)
# ── Helper: highlighted info box ────────────────────────────────────────────
def info_box(text, bg=TEAL_LIGHT, border_color=TEAL, style=None):
st = style or sBody
data = [[Paragraph(text, st)]]
t = Table(data, colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LINEAFTER", (0,0), (0,-1), 3, border_color), # left accent
("LINEBEFORE", (0,0), (0,-1), 3, border_color),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
return t
# ── Build story ─────────────────────────────────────────────────────────────
story = []
# ── HEADER BLOCK ────────────────────────────────────────────────────────────
header_data = [[
Paragraph("PATIENT TREATMENT SUMMARY", sTitle),
],[
Paragraph("Acute Pyelonephritis (Upper Urinary Tract Infection)", sSubtitle),
],[
Paragraph(f"Prepared by: Dr. Dadireddy Sai Sree | Date: {date.today().strftime('%d %B %Y')} | Lab ID: B26080741", sSubtitle),
]]
header_tbl = Table(header_data, colWidths=[W])
header_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("ROUNDEDCORNERS", [6,6,6,6]),
]))
story.append(header_tbl)
story.append(Spacer(1, 5*mm))
# ── PATIENT DETAILS ─────────────────────────────────────────────────────────
story.append(section_header("PATIENT DETAILS", bg=GREY_DARK))
story.append(Spacer(1, 2*mm))
pd_data = [
[Paragraph("Name", sLabel), Paragraph("K. Dhathri", sValue),
Paragraph("Age / Sex", sLabel), Paragraph("20 Years / Female", sValue)],
[Paragraph("Lab ID", sLabel), Paragraph("B26080741", sValue),
Paragraph("Report Date", sLabel), Paragraph("07 August 2026", sValue)],
[Paragraph("Referred by", sLabel), Paragraph("Dr. Dadireddy Sai Sree", sValue),
Paragraph("Facility", sLabel), Paragraph("Rayalaseema Diagnostics, Kurnool", sValue)],
]
pd_tbl = Table(pd_data, colWidths=[40*mm, 65*mm, 40*mm, W-145*mm])
pd_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREY_LIGHT),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
story.append(pd_tbl)
story.append(Spacer(1, 4*mm))
# ── DIAGNOSIS ───────────────────────────────────────────────────────────────
story.append(section_header("DIAGNOSIS", bg=TEAL))
story.append(Spacer(1, 2*mm))
diag_box_data = [[Paragraph(
"Acute Pyelonephritis (Upper Urinary Tract Infection) with Systemic Inflammatory Response",
sDiag
)]]
diag_tbl = Table(diag_box_data, colWidths=[W])
diag_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_LIGHT),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 1.5, TEAL),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
story.append(diag_tbl)
story.append(Spacer(1, 2*mm))
story.append(Paragraph(
"Dengue (NS1 Ag, IgM, IgG) and Malaria (P. vivax, P. falciparum) have been <b>ruled out</b> by serology.",
sBody
))
story.append(Spacer(1, 4*mm))
# ── KEY LAB FINDINGS ────────────────────────────────────────────────────────
story.append(section_header("KEY LAB FINDINGS", bg=TEAL))
story.append(Spacer(1, 2*mm))
lab_header = ["Test", "Your Result", "Normal Range", "Status"]
lab_data = [
lab_header,
["WBC (Total Leucocytes)", "15.8 × 10⁹/L", "4 – 11 × 10⁹/L", "HIGH"],
["Granulocytes (Neutrophils)", "10.4 × 10⁹/L", "1.2 – 8.0 × 10⁹/L", "HIGH"],
["C-Reactive Protein (CRP)", "128.9 µg/mL", "Up to 10 µg/mL", "VERY HIGH"],
["SGOT (Liver enzyme)", "62 U/L", "< 40 U/L", "Mildly elevated"],
["SGPT (Liver enzyme)", "51 U/L", "< 40 U/L", "Mildly elevated"],
["Serum Creatinine", "0.9 mg/dL", "0.6 – 1.1 mg/dL (F)", "Normal"],
["Haemoglobin", "12.9 g/dL", "11.5 – 16.5 g/dL", "Normal"],
["Platelets", "332 × 10⁹/L", "100 – 400 × 10⁹/L", "Normal"],
["Urine Pus Cells", "15 – 20 / HPF", "< 5 / HPF", "HIGH"],
["Urine Nitrite", "POSITIVE", "Negative", "Infection marker"],
["Urine Blood", "++", "Negative", "Present"],
]
def status_color(s):
s = s.upper()
if "VERY HIGH" in s: return RED
if "HIGH" in s: return ORANGE
if "ELEVATED" in s: return ORANGE
if "NORMAL" in s: return GREEN
if "INFECTION" in s: return ORANGE
if "PRESENT" in s: return ORANGE
return GREY_DARK
lab_para = []
for i, row in enumerate(lab_data):
if i == 0:
lab_para.append([Paragraph(f"<b>{c}</b>", ParagraphStyle(
"lh", parent=base["Normal"], fontSize=9, fontName="Helvetica-Bold",
textColor=WHITE, leading=12)) for c in row])
else:
sc = status_color(row[3])
lab_para.append([
Paragraph(row[0], ParagraphStyle("lc", parent=base["Normal"], fontSize=9,
textColor=GREY_DARK, leading=12)),
Paragraph(f"<b>{row[1]}</b>", ParagraphStyle("lv", parent=base["Normal"],
fontSize=9, fontName="Helvetica-Bold",
textColor=GREY_DARK, leading=12)),
Paragraph(row[2], ParagraphStyle("lr", parent=base["Normal"], fontSize=9,
textColor=GREY_MED, leading=12)),
Paragraph(f"<b>{row[3]}</b>", ParagraphStyle("ls", parent=base["Normal"],
fontSize=9, fontName="Helvetica-Bold",
textColor=sc, leading=12)),
])
col_w = [W*0.32, W*0.24, W*0.26, W*0.18]
lab_tbl = Table(lab_para, colWidths=col_w)
ts = TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BDC3C7")),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GREY_LIGHT]),
])
lab_tbl.setStyle(ts)
story.append(lab_tbl)
story.append(Spacer(1, 4*mm))
# ── WHAT THIS MEANS ─────────────────────────────────────────────────────────
story.append(section_header("WHAT THESE RESULTS MEAN", bg=GREY_DARK))
story.append(Spacer(1, 2*mm))
meanings = [
("<b>High WBC + Neutrophils:</b> Your body is actively fighting a bacterial infection. "
"This is expected and confirms an infection is present."),
("<b>Very High CRP (128.9):</b> C-Reactive Protein is a key marker of inflammation. "
"A level ~13x above normal means your body is under significant stress from infection. "
"This number should come down quickly with the right antibiotics."),
("<b>Urine findings (pus cells, nitrite, blood):</b> Confirm that the infection has "
"reached the kidneys (upper urinary tract). This is called pyelonephritis."),
("<b>Mildly elevated liver enzymes (SGOT/SGPT):</b> A mild, temporary rise during "
"systemic infection. Not a liver disease — expected to return to normal after treatment."),
("<b>Kidney function (creatinine 0.9):</b> Currently within normal limits. "
"Must be monitored closely as kidney infections can sometimes affect function."),
]
for m in meanings:
story.append(Paragraph(f"• {m}", sBullet))
story.append(Spacer(1, 4*mm))
# ── TREATMENT PLAN ──────────────────────────────────────────────────────────
story.append(KeepTogether([
section_header("YOUR TREATMENT PLAN", bg=TEAL),
Spacer(1, 2*mm),
]))
# --- Antibiotics
story.append(info_box(
"<b>Step 1 — Antibiotic Treatment (Most Important)</b><br/>"
"You will be prescribed one of the following antibiotics. Take the <b>complete course</b> even if you feel better earlier.",
bg=TEAL_LIGHT, border_color=TEAL
))
story.append(Spacer(1, 1.5*mm))
abx_data = [
[Paragraph("<b>Antibiotic Option</b>", sLabel),
Paragraph("<b>Dose</b>", sLabel),
Paragraph("<b>Duration</b>", sLabel)],
[Paragraph("Ciprofloxacin (oral)", sBody),
Paragraph("500 mg twice daily", sBody),
Paragraph("10 – 14 days", sBody)],
[Paragraph("Cefixime (oral)", sBody),
Paragraph("200 mg twice daily", sBody),
Paragraph("10 – 14 days", sBody)],
[Paragraph("Amoxicillin-Clavulanate (oral)", sBody),
Paragraph("625 mg three times daily", sBody),
Paragraph("10 – 14 days", sBody)],
[Paragraph("Ceftriaxone (injection — if admitted)", sBody),
Paragraph("1 – 2 g once daily (IV)", sBody),
Paragraph("Until oral possible", sBody)],
]
abx_tbl = Table(abx_data, colWidths=[W*0.38, W*0.34, W*0.28])
abx_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), GREY_LIGHT),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BDC3C7")),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GREY_LIGHT]),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(abx_tbl)
story.append(Spacer(1, 1*mm))
story.append(Paragraph(
"* Final antibiotic choice will be confirmed by your urine culture & sensitivity results (available in 48–72 hours).",
sNote
))
story.append(Spacer(1, 3*mm))
# --- Fever / Pain
story.append(info_box(
"<b>Step 2 — Fever & Pain Relief</b><br/>"
"Take <b>Paracetamol (Paracetamol 500 – 1000 mg)</b> every 6 – 8 hours as needed for fever or body ache.<br/>"
"<font color='#C0392B'><b>Avoid ibuprofen / aspirin / diclofenac (NSAIDs)</b></font> — these can stress the kidneys.",
bg=ORANGE_BG, border_color=ORANGE
))
story.append(Spacer(1, 3*mm))
# --- Hydration
story.append(info_box(
"<b>Step 3 — Stay Well Hydrated</b><br/>"
"Drink <b>at least 2.5 – 3 litres of water</b> per day. Good hydration flushes the bacteria from "
"the urinary tract and helps protect your kidneys. Aim for pale yellow urine throughout the day.",
bg=GREEN_BG, border_color=GREEN
))
story.append(Spacer(1, 4*mm))
# ── PENDING TESTS ────────────────────────────────────────────────────────────
story.append(KeepTogether([
section_header("IMPORTANT TESTS STILL NEEDED", bg=ORANGE),
Spacer(1, 2*mm),
]))
tests = [
("Urine Culture & Sensitivity (C&S)",
"Identifies the exact bacteria causing your infection and which antibiotics will work best. "
"<b>Send sample BEFORE starting antibiotics.</b> Results in 48–72 hours."),
("Blood Culture (x2 sets)",
"Rules out bacteria in the bloodstream (bacteraemia/sepsis). Your very high CRP makes this necessary."),
("Ultrasound KUB (Kidney-Ureter-Bladder)",
"To check for kidney abscess, blockage (hydronephrosis), or kidney stones that may need treatment."),
("Repeat CBC + CRP at 72 hours",
"To confirm your WBC and CRP are coming down with antibiotics. If not improving, treatment may need to change."),
("Repeat LFT (Liver tests) in 1–2 weeks",
"To confirm SGOT/SGPT have returned to normal after infection resolves."),
("Repeat Urine Routine + Culture (1 week post-treatment)",
"Test of cure — confirms the infection is completely cleared."),
]
for name, desc in tests:
row_data = [[
Paragraph(f"<b>{name}</b>", ParagraphStyle("tn", parent=base["Normal"],
fontSize=9, fontName="Helvetica-Bold",
textColor=ORANGE, leading=13)),
Paragraph(desc, ParagraphStyle("td", parent=base["Normal"], fontSize=9,
textColor=GREY_DARK, leading=13)),
]]
row_tbl = Table(row_data, colWidths=[55*mm, W-55*mm])
row_tbl.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 0),
("LINEBELOW", (0,0), (-1,-1), 0.3, colors.HexColor("#BDC3C7")),
]))
story.append(row_tbl)
story.append(Spacer(1, 4*mm))
# ── RED FLAGS ────────────────────────────────────────────────────────────────
story.append(KeepTogether([
section_header("GO TO HOSPITAL IMMEDIATELY IF YOU NOTICE:", bg=RED),
Spacer(1, 2*mm),
info_box(
"• Temperature above 39°C (102.2°F) that does not come down with Paracetamol<br/>"
"• Feeling faint, confused, or extremely weak<br/>"
"• Unable to keep down fluids or tablets due to vomiting<br/>"
"• Severe pain in your back or sides (kidney area)<br/>"
"• No improvement after 48 – 72 hours of antibiotics<br/>"
"• Decreased urine output or very dark / no urine",
bg=RED_BG, border_color=RED,
style=ParagraphStyle("rf", parent=base["Normal"], fontSize=9.5,
textColor=GREY_DARK, leading=15, fontName="Helvetica")
),
Spacer(1, 4*mm),
]))
# ── FOLLOW UP ────────────────────────────────────────────────────────────────
story.append(section_header("FOLLOW-UP SCHEDULE", bg=TEAL))
story.append(Spacer(1, 2*mm))
fu_data = [
[Paragraph("<b>When</b>", sLabel), Paragraph("<b>Action</b>", sLabel)],
[Paragraph("Today / Tomorrow", sBody), Paragraph("Send urine C&S + blood cultures", sBody)],
[Paragraph("Day 3 (72 hours)", sBody), Paragraph("Review: CBC + CRP to confirm improvement; adjust antibiotic if needed", sBody)],
[Paragraph("Day 7 – 10", sBody), Paragraph("Ultrasound KUB; review culture results; ensure feeling better", sBody)],
[Paragraph("1 week after finishing antibiotics", sBody), Paragraph("Repeat urine routine + culture (test of cure)", sBody)],
[Paragraph("2 weeks", sBody), Paragraph("Repeat LFT to confirm liver enzymes normalised", sBody)],
]
fu_tbl = Table(fu_data, colWidths=[50*mm, W-50*mm])
fu_tbl.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),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BDC3C7")),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GREY_LIGHT]),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(fu_tbl)
story.append(Spacer(1, 4*mm))
# ── LIFESTYLE TIPS ────────────────────────────────────────────────────────────
story.append(section_header("TIPS FOR FASTER RECOVERY", bg=GREEN))
story.append(Spacer(1, 2*mm))
tips = [
"Rest adequately — let your body fight the infection.",
"Complete the <b>full course of antibiotics</b>. Stopping early can cause the infection to return, harder to treat.",
"Drink 2.5–3 litres of water daily. Cranberry juice (unsweetened) may help symptom relief.",
"Avoid holding urine — urinate whenever you feel the urge.",
"Maintain good personal hygiene (front to back wiping).",
"Avoid caffeine and alcohol until fully recovered.",
"Light, nutritious meals — avoid heavy spicy food while unwell.",
]
for t in tips:
story.append(Paragraph(f"✓ {t}", sBullet))
story.append(Spacer(1, 5*mm))
# ── FOOTER ───────────────────────────────────────────────────────────────────
story.append(HRFlowable(width=W, thickness=0.5, color=GREY_MED))
story.append(Spacer(1, 2*mm))
story.append(Paragraph(
"This document is a clinical summary prepared to assist the patient in understanding their diagnosis and treatment plan.<br/>"
"It does not replace direct medical advice. Please follow up with your treating doctor for all prescription decisions.<br/>"
"Rayalaseema Diagnostics, Opp. Govt. General Hospital, Budhawarapeta, Kurnool | Ph: 9989722996, 9949585088",
sFooter
))
# ── Build ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /tmp/workspace/patient-report && python generate_pdf.py 2>&1
ls -lh /tmp/workspace/patient-report/Treatment_Summary_KDhathri.pdf
Treatment Summary KDhathri
PDF Document · PDF