This loveleen pt got admitted now i have to make clinical case presentation ppt And my topic is to make for history and examination so make me points and read the summary properly as pt is admited 2 times under our team
ls -la /tmp/workspace/attachments/63c6b1c4-2320-4fa4-99d4-c863b9968e52/
cd /tmp/workspace && python3 -c " from docx import Document doc = Document('/tmp/workspace/attachments/63c6b1c4-2320-4fa4-99d4-c863b9968e52/LOVELEEN D-S checked.docx') for p in doc.paragraphs: style = p.style.name if p.style else 'None' if p.text.strip(): print(f'[{style}] {p.text}') print('---TABLES---') for t in doc.tables: for row in t.rows: print(' | '.join(c.text for c in row.cells)) " > loveleen_DS.txt wc -l loveleen_DS.txt
cd /tmp/workspace && python3 -c " from docx import Document doc = Document('/tmp/workspace/attachments/63c6b1c4-2320-4fa4-99d4-c863b9968e52/loveleen.docx') for p in doc.paragraphs: style = p.style.name if p.style else 'None' if p.text.strip(): print(f'[{style}] {p.text}') print('---TABLES---') for t in doc.tables: for row in t.rows: print(' | '.join(c.text for c in row.cells)) " > loveleen_full.txt wc -l loveleen_full.txt
cd /tmp/workspace && python3 -c " import zipfile z = zipfile.ZipFile('/tmp/workspace/attachments/63c6b1c4-2320-4fa4-99d4-c863b9968e52/LOVELEEN D-S checked.docx') data = z.read('word/document.xml') open('ds_document.xml','wb').write(data) print(len(data)) "
cd /tmp/workspace && python3 -c " import re data = open('ds_document.xml', encoding='utf-8').read() # split into paragraphs paras = re.findall(r'<w:p[ >].*?</w:p>', data, re.S) out = [] for p in paras: texts = re.findall(r'<w:t[^>]*>(.*?)</w:t>', p, re.S) line = ''.join(texts) if line.strip(): out.append(line) print(len(out)) open('ds_text.txt','w').write('\n'.join(out)) " wc -l ds_text.txt
"COURSE IN HOSPITAL" in ~/ds_text.txt
mkdir -p /tmp/workspace/loveleen_ppt && ls /tmp/workspace/loveleen_ppt
~/loveleen_ppt/build_ppt.py
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN
NAVY = RGBColor(0x1F, 0x3B, 0x57)
ACCENT = RGBColor(0xB0, 0x2A, 0x2A)
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
DARK = RGBColor(0x22, 0x22, 0x22)
LIGHT_BG = RGBColor(0xF4, 0xF6, 0xF8)
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
BLANK = prs.slide_layouts[6]
def add_bg(slide, color=WHITE):
bg = slide.shapes.add_shape(1, 0, 0, prs.slide_width, prs.slide_height)
bg.fill.solid(); bg.fill.fore_color.rgb = color
bg.line.fill.background()
bg.shadow.inherit = False
slide.shapes._spTree.remove(bg._element)
slide.shapes._spTree.insert(2, bg._element)
return bg
def title_bar(slide, text, sub=None):
bar = slide.shapes.add_shape(1, 0, 0, prs.slide_width, Inches(1.05))
bar.fill.solid(); bar.fill.fore_color.rgb = NAVY
bar.line.fill.background(); bar.shadow.inherit = False
tb = slide.shapes.add_textbox(Inches(0.5), Inches(0.12), Inches(12.3), Inches(0.6))
tf = tb.text_frame; tf.word_wrap = True
p = tf.paragraphs[0]; p.text = text
p.font.size = Pt(28); p.font.bold = True; p.font.color.rgb = WHITE; p.font.name = "Calibri"
if sub:
tb2 = slide.shapes.add_textbox(Inches(0.5), Inches(0.62), Inches(12.3), Inches(0.4))
tf2 = tb2.text_frame
p2 = tf2.paragraphs[0]; p2.text = sub
p2.font.size = Pt(14); p2.font.italic = True; p2.font.color.rgb = RGBColor(0xD5,0xDC,0xE4)
def bullet_box(slide, x, y, w, h, items, heading=None, font_size=15, head_color=ACCENT):
tb = slide.shapes.add_textbox(x, y, w, h)
tf = tb.text_frame; tf.word_wrap = True
first = True
if heading:
p = tf.paragraphs[0]; p.text = heading
p.font.bold = True; p.font.size = Pt(font_size+2); p.font.color.rgb = head_color
first = False
for it in items:
if isinstance(it, tuple):
text, level = it
else:
text, level = it, 0
p = tf.paragraphs[0] if first else tf.add_paragraph()
first = False
p.text = text
p.level = level
p.font.size = Pt(font_size if level==0 else font_size-1)
p.font.color.rgb = DARK
p.space_after = Pt(4)
return tb
def card(slide, x, y, w, h, title, items, title_color=NAVY, font_size=14):
box = slide.shapes.add_shape(1, x, y, w, h)
box.fill.solid(); box.fill.fore_color.rgb = LIGHT_BG
box.line.color.rgb = RGBColor(0xC9,0xD3,0xDC); box.line.width = Pt(0.75)
box.shadow.inherit = False
tf = box.text_frame; tf.word_wrap = True
tf.margin_left = Inches(0.15); tf.margin_right = Inches(0.15)
tf.margin_top = Inches(0.1); tf.margin_bottom = Inches(0.1)
p = tf.paragraphs[0]; p.text = title
p.font.bold = True; p.font.size = Pt(font_size+3); p.font.color.rgb = title_color
for it in items:
if isinstance(it, tuple):
text, level = it
else:
text, level = it, 0
p = tf.add_paragraph()
p.text = ("• " if level==0 else " – ") + text
p.font.size = Pt(font_size if level==0 else font_size-1)
p.font.color.rgb = DARK
p.space_after = Pt(3)
return box
def footer(slide, text):
tb = slide.shapes.add_textbox(Inches(0.5), Inches(7.15), Inches(12.3), Inches(0.3))
p = tb.text_frame.paragraphs[0]; p.text = text
p.font.size = Pt(10); p.font.color.rgb = RGBColor(0x88,0x88,0x88)
# ---------------- Slide 1: Title ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s, NAVY)
tb = s.shapes.add_textbox(Inches(0.8), Inches(2.4), Inches(11.7), Inches(1.2))
p = tb.text_frame.paragraphs[0]; p.text = "Clinical Case Presentation"
p.font.size = Pt(44); p.font.bold = True; p.font.color.rgb = WHITE; p.alignment = PP_ALIGN.CENTER
tb2 = s.shapes.add_textbox(Inches(0.8), Inches(3.5), Inches(11.7), Inches(0.8))
p2 = tb2.text_frame.paragraphs[0]; p2.text = "History and Examination"
p2.font.size = Pt(26); p2.font.color.rgb = RGBColor(0xE3,0xC5,0x6B); p2.alignment = PP_ALIGN.CENTER
tb3 = s.shapes.add_textbox(Inches(0.8), Inches(4.5), Inches(11.7), Inches(0.6))
p3 = tb3.text_frame.paragraphs[0]; p3.text = "Patient: Ms. Loveleen | 19 yrs / Female | Unit No. 8253688"
p3.font.size = Pt(18); p3.font.color.rgb = WHITE; p3.alignment = PP_ALIGN.CENTER
tb4 = s.shapes.add_textbox(Inches(0.8), Inches(5.1), Inches(11.7), Inches(0.5))
p4 = tb4.text_frame.paragraphs[0]; p4.text = "Department of Medicine - Unit 4 | Two Admissions Under Our Team"
p4.font.size = Pt(14); p4.font.italic = True; p4.font.color.rgb = RGBColor(0xC9,0xD3,0xDC); p4.alignment = PP_ALIGN.CENTER
# ---------------- Slide 2: Patient Profile ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Patient Profile", "Identification data")
card(s, Inches(0.6), Inches(1.4), Inches(5.9), Inches(2.4), "Demographics", [
"Name: Ms. Loveleen", "Age / Sex: 19 years / Female",
"Unit No.: 8253688", "Ward: 5, Medicine Unit-4",
])
card(s, Inches(6.7), Inches(1.4), Inches(6.0), Inches(2.4), "Two Admissions (Same Unit)", [
"Admission 1: 14/03/2026 - 20/03/2026",
"Admission 2: 15/04/2026 - 04/05/2026",
"Admission 2 occurred ~3 weeks after discharge from Admission 1",
])
card(s, Inches(0.6), Inches(4.0), Inches(12.1), Inches(2.6), "Overview of Illness Trajectory", [
"Admission 1: Right eye proptosis and swelling - diagnosed as right orbital cellulitis 2° to chronic fungal sinusitis (Aspergillosis) with superadded bacterial infection; treated with right FESS + orbital decompression, IV antibiotics, and voriconazole",
"Admission 2: Presented with new LEFT eye swelling/pain, facial puffiness and oral thrush 3 days after discharge; course complicated by GTCS, invasive fungal infection (mucormycosis + aspergillosis) and CNS involvement (focal encephalitis)",
], font_size=14)
footer(s, "CMC Ludhiana | Medicine Unit-4")
# ---------------- Slide 3: Admission 1 - History ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 1 (14/03/2026 - 20/03/2026)", "Chief Complaints & History of Presenting Illness")
bullet_box(s, Inches(0.6), Inches(1.3), Inches(12.2), Inches(1.0),
["19-year-old female, no known comorbidities, presented to casualty with:"], font_size=16)
card(s, Inches(0.6), Inches(2.0), Inches(12.1), Inches(1.6), "Chief Complaints", [
"Pain and swelling of the right eye - duration 3 days",
"Numbness of the forehead (right side) - associated symptom",
])
card(s, Inches(0.6), Inches(3.8), Inches(12.1), Inches(2.9), "History Points to Note", [
"Acute onset, short duration (3 days) periorbital complaint - suggests acute orbital/sinus pathology",
"No prior comorbidities documented at this admission",
"No fever documented; patient was afebrile at presentation",
"No history of trauma, diabetes, or immunosuppression elicited at this stage",
"This later proved to be the first presentation of invasive fungal rhinosinusitis (Aspergillosis) with orbital extension",
])
footer(s, "Admission 1 - History")
# ---------------- Slide 4: Admission 1 - GPE ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 1 - General Physical Examination")
card(s, Inches(0.6), Inches(1.4), Inches(5.9), Inches(2.6), "General Survey", [
"Conscious, oriented to time, place and person",
"Vitals: HR 76/min, BP 110/70 mmHg",
"RR 18/min, SpO2 99% on room air",
"Afebrile",
])
card(s, Inches(6.7), Inches(1.4), Inches(6.0), Inches(2.6), "Absent Findings", [
"Pallor - absent", "Icterus - absent", "Cyanosis - absent",
"Clubbing - absent", "Lymphadenopathy - absent", "Pedal edema - absent",
])
card(s, Inches(0.6), Inches(4.2), Inches(12.1), Inches(2.4), "Local Examination (Right Eye)", [
"Right eye proptosis present",
"Conjunctival congestion present",
"Frontal sinus tenderness present",
"Maxillary sinus tenderness present",
])
footer(s, "Admission 1 - Examination")
# ---------------- Slide 5: Admission 1 - Systemic exam ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 1 - Systemic Examination")
card(s, Inches(0.5), Inches(1.3), Inches(6.0), Inches(1.7), "Respiratory System", [
"Bilateral equal chest rise", "Bilateral normal vesicular breath sounds, no added sounds",
])
card(s, Inches(6.75), Inches(1.3), Inches(6.05), Inches(1.7), "Cardiovascular System", [
"Pulse 76/min, regular, good volume", "No radio-radial / radio-femoral delay",
"JVP not elevated", "S1, S2 heard; no murmurs",
])
card(s, Inches(0.5), Inches(3.15), Inches(6.0), Inches(1.6), "Per Abdomen", [
"Soft, not distended, umbilicus central", "Liver and spleen not palpable",
"Bowel sounds normal",
])
card(s, Inches(6.75), Inches(3.15), Inches(6.05), Inches(3.0), "Central Nervous System", [
"Higher mental functions normal",
"Extraocular movements normal, no nystagmus",
"Power 5/5 in all four limbs",
"Deep tendon reflexes present bilaterally",
"Plantar reflexes bilaterally downgoing (flexor)",
"Sensory system normal",
])
footer(s, "Admission 1 - Examination (Key: no focal CNS deficit despite orbital disease)")
# ---------------- Slide 6: Admission 1 summary / bridge ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 1 - Clinical Impression at That Time")
card(s, Inches(0.6), Inches(1.4), Inches(12.1), Inches(2.2), "Working Diagnosis", [
"Right orbital cellulitis with abscess, secondary to chronic fungal sinusitis (Aspergillosis) with superadded bacterial infection (Enterobacter cloacae)",
"Partial encasement of right optic nerve on imaging (CECT PNS / MRI brain with orbital cuts)",
])
card(s, Inches(0.6), Inches(3.8), Inches(12.1), Inches(2.6), "Management Given (context for Admission 2 history)", [
"Urgent right-sided FESS with orbital decompression (combined external + endoscopic)",
"IV antibiotics + antifungal therapy (Voriconazole)",
"Discharged hemodynamically stable; advised oral Voriconazole for 2 weeks and OPD follow-up",
])
footer(s, "This forms the background history relevant to Admission 2")
# ---------------- Slide 7: Admission 2 - History ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 2 (15/04/2026 - 04/05/2026)", "Chief Complaints & History of Presenting Illness")
card(s, Inches(0.6), Inches(1.3), Inches(12.1), Inches(1.5), "Known Background (relevant past history)", [
"Known case of right-sided orbital cellulitis 2° to chronic fungal sinusitis (Aspergillosis), status-post right FESS with orbital decompression (Admission 1)",
])
card(s, Inches(0.6), Inches(3.0), Inches(12.1), Inches(1.6), "Chief Complaints (New, on this admission)", [
"Swelling and pain in the LEFT eye - duration 3 days",
"Facial puffiness - duration 3 days",
])
card(s, Inches(0.6), Inches(4.8), Inches(12.1), Inches(2.0), "Additional History Points", [
"Pain radiating to the maxillary region; discomfort during mastication and speech",
"Gradual appearance of non-scrapable whitish patches in the oral cavity over the same 72 hours (oral thrush)",
"Presented ~3 weeks after discharge from Admission 1 - suggests contralateral/progressive disease",
])
footer(s, "Admission 2 - History")
# ---------------- Slide 8: Admission 2 - GPE ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 2 - General Physical Examination")
card(s, Inches(0.6), Inches(1.4), Inches(5.9), Inches(2.7), "General Survey", [
"Conscious, oriented to time, place and person",
"Moderately built, well-nourished",
"Vitals: HR 80/min, BP 110/70 mmHg",
"RR 20/min, SpO2 99% on room air",
"Afebrile at admission",
])
card(s, Inches(6.7), Inches(1.4), Inches(6.0), Inches(2.7), "Absent Findings", [
"Pallor - absent", "Icterus - absent", "Cyanosis - absent",
"Clubbing - absent", "Lymphadenopathy - absent", "Edema - absent (generalized)",
])
card(s, Inches(0.6), Inches(4.3), Inches(12.1), Inches(2.3), "Local Examination (Eyes)", [
"Bilateral periorbital edema present",
"Bilateral chemosis present",
"Left side worse than right (Left > Right) - correlating with new-onset left eye complaints",
])
footer(s, "Admission 2 - Examination")
# ---------------- Slide 9: Admission 2 - CNS exam (highlight) ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 2 - Central Nervous System Examination", "Key positive finding of this admission")
card(s, Inches(0.6), Inches(1.4), Inches(12.1), Inches(2.6), "Pupillary Examination - Anisocoria", [
"Left pupil: dilated (4 mm), sluggishly reactive to light",
"Right pupil: constricted (2 mm), reactive to light",
"This asymmetry correlated clinically with new left orbital apex involvement",
])
card(s, Inches(0.6), Inches(4.2), Inches(12.1), Inches(2.4), "Rest of CNS Examination", [
"Higher mental functions intact; conscious and oriented",
"Power 5/5 in both upper and lower limbs",
"Deep tendon reflexes 2+ (present) bilaterally - biceps, triceps, supinator, knee, ankle",
"Plantar reflexes bilaterally flexor (downgoing)",
"Sensory system examination normal",
])
footer(s, "Anisocoria was the earliest clinical clue to orbital apex / CNS involvement on this admission")
# ---------------- Slide 10: Admission 2 - other systemic exam ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Admission 2 - Other Systemic Examination")
card(s, Inches(0.5), Inches(1.4), Inches(6.0), Inches(2.2), "Respiratory System", [
"Thoracoabdominal breathing pattern noted", "Trachea central",
"Bilateral equal chest rise", "Bilateral normal vesicular breath sounds, no added sounds",
])
card(s, Inches(6.75), Inches(1.4), Inches(6.05), Inches(2.2), "Cardiovascular System", [
"Pulse normal rate, good volume", "JVP not elevated", "S1, S2 heard; no murmurs or added sounds",
])
card(s, Inches(0.5), Inches(3.8), Inches(12.3), Inches(1.8), "Per Abdomen Examination", [
"Soft, non-tender; umbilicus central",
"No hepatosplenomegaly", "Bowel sounds present, normal frequency",
])
card(s, Inches(0.5), Inches(5.75), Inches(12.3), Inches(1.35), "Clinical Course Note (for context)", [
"Course later complicated by cluster of 4 GTCS episodes, invasive fungal infection (mucormycosis + aspergillosis with angioinvasion) and focal encephalitis - beyond initial history/exam, relevant to full case discussion",
], font_size=12)
footer(s, "Admission 2 - Examination")
# ---------------- Slide 11: Comparison table ----------------
s = prs.slides.add_slide(BLANK)
add_bg(s)
title_bar(s, "Comparative Summary: Admission 1 vs Admission 2")
rows = [
("Parameter", "Admission 1 (14-20/03/2026)", "Admission 2 (15/04-04/05/2026)"),
("Chief complaint", "Right eye pain/swelling x3d, forehead numbness", "Left eye pain/swelling x3d, facial puffiness, oral thrush"),
("Side affected", "Right orbit", "Left orbit (new) + residual right"),
("Vitals", "HR 76, BP 110/70, RR 18, afebrile", "HR 80, BP 110/70, RR 20, afebrile"),
("Local exam", "Right proptosis, conjunctival congestion, sinus tenderness", "Bilateral periorbital edema & chemosis, L>R"),
("CNS exam", "Normal - no focal deficit", "Anisocoria (L pupil dilated, sluggish) - new focal finding"),
("Working diagnosis", "Right orbital cellulitis, fungal sinusitis (Aspergillosis) + bacterial infection", "Left orbital cellulitis, contralateral spread; later invasive mucormycosis + encephalitis"),
]
top = Inches(1.3)
tbl_shape = s.shapes.add_table(len(rows), 3, Inches(0.5), top, Inches(12.3), Inches(5.6))
table = tbl_shape.table
table.columns[0].width = Inches(2.4)
table.columns[1].width = Inches(4.95)
table.columns[2].width = Inches(4.95)
for r, row in enumerate(rows):
for c, val in enumerate(row):
cell = table.cell(r, c)
cell.text = val
tf = cell.text_frame
tf.word_wrap = True
for p in tf.paragraphs:
p.font.size = Pt(12.5 if r>0 else 14)
p.font.bold = (r==0)
p.font.color.rgb = WHITE if r==0 else DARK
cell.fill.solid()
cell.fill.fore_color.rgb = NAVY if r==0 else (LIGHT_BG if r%2==0 else WHITE)
cell.margin_left = Inches(0.08); cell.margin_right = Inches(0.08)
footer(s, "Two admissions under the same unit within a 5-week window")
prs.save("/tmp/workspace/loveleen_ppt/Loveleen_History_Examination.pptx")
print("saved")
cd /tmp/workspace/loveleen_ppt && python3 build_ppt.py
Loveleen History Examination
Presentation · PPTX