Give symptomatology pdf for all systems with all Differential diagnosis and how to differentiate them in details Refer all standard text book of medicine such as harrison, davidson etc
mkdir -p /tmp/workspace/symptomatology-pdf && echo "Directory ready"
Give symptomatology pdf for all systems with all Differential diagnosis and how to differentiate them in details Refer all standard text book of medicine such as harrison, davidson etc
mkdir -p /tmp/workspace/symptomatology-pdf && cat > /tmp/workspace/symptomatology-pdf/generate_pdf_part1.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm, mm from reportlab.lib import colors from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, HRFlowable, KeepTogether) from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate from reportlab.lib.colors import HexColor import re # ── Color palette ────────────────────────────────────────────────────────────── C_NAVY = HexColor('#1A3A5C') C_TEAL = HexColor('#0D6E7A') C_BLUE_LT = HexColor('#E8F4F8') C_GOLD = HexColor('#C8860A') C_RED = HexColor('#B22222') C_GREEN = HexColor('#1D6B44') C_GREY_LT = HexColor('#F5F5F5') C_GREY_MED = HexColor('#CCCCCC') C_WHITE = colors.white C_BLACK = colors.black W, H = A4 # ── Style sheet ──────────────────────────────────────────────────────────────── styles = getSampleStyleSheet() def S(name, **kw): return ParagraphStyle(name, **kw) sTitle = S('sTitle', fontName='Helvetica-Bold', fontSize=28, textColor=C_WHITE, alignment=TA_CENTER, spaceAfter=6) sSubtitle = S('sSubtitle', fontName='Helvetica', fontSize=13, textColor=C_WHITE, alignment=TA_CENTER, spaceAfter=4) sRef = S('sRef', fontName='Helvetica-Oblique', fontSize=10, textColor=HexColor('#CCDDEE'), alignment=TA_CENTER, spaceAfter=2) sH1 = S('sH1', fontName='Helvetica-Bold', fontSize=18, textColor=C_WHITE, spaceBefore=14, spaceAfter=6, leftIndent=0) sH2 = S('sH2', fontName='Helvetica-Bold', fontSize=14, textColor=C_NAVY, spaceBefore=10, spaceAfter=4, leftIndent=0) sH3 = S('sH3', fontName='Helvetica-Bold', fontSize=12, textColor=C_TEAL, spaceBefore=8, spaceAfter=3, leftIndent=4) sH4 = S('sH4', fontName='Helvetica-Bold', fontSize=11, textColor=C_GOLD, spaceBefore=6, spaceAfter=2, leftIndent=8) sBody = S('sBody', fontName='Helvetica', fontSize=9.5, leading=14, textColor=C_BLACK, spaceBefore=2, spaceAfter=2, leftIndent=8, alignment=TA_JUSTIFY) sBullet = S('sBullet', fontName='Helvetica', fontSize=9.5, leading=13, textColor=C_BLACK, spaceBefore=1, spaceAfter=1, leftIndent=16, firstLineIndent=-8, alignment=TA_LEFT) sNote = S('sNote', fontName='Helvetica-Oblique', fontSize=8.5, leading=12, textColor=HexColor('#555555'), leftIndent=8, spaceBefore=2, spaceAfter=4) sTH = S('sTH', fontName='Helvetica-Bold', fontSize=8.5, textColor=C_WHITE, alignment=TA_CENTER, leading=11) sTD = S('sTD', fontName='Helvetica', fontSize=8, textColor=C_BLACK, alignment=TA_LEFT, leading=11) sTDc = S('sTDc', fontName='Helvetica', fontSize=8, textColor=C_BLACK, alignment=TA_CENTER, leading=11) # ── Helpers ─────────────────────────────────────────────────────────────────── def section_banner(title, color=C_NAVY): """Returns a colored banner paragraph for section headings.""" data = [[Paragraph(title, sH1)]] t = Table(data, colWidths=[W - 3.6*cm]) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), color), ('TOPPADDING', (0,0), (-1,-1), 8), ('BOTTOMPADDING', (0,0), (-1,-1), 8), ('LEFTPADDING', (0,0), (-1,-1), 12), ('RIGHTPADDING', (0,0), (-1,-1), 12), ('ROWBACKGROUNDS',(0,0),(-1,-1),[color]), ])) return t def diff_table(headers, rows, col_widths=None): """Build a styled differential diagnosis table.""" if col_widths is None: n = len(headers) avail = W - 3.6*cm col_widths = [avail/n]*n header_row = [Paragraph(h, sTH) for h in headers] data = [header_row] for row in rows: data.append([Paragraph(str(c), sTD) for c in row]) t = Table(data, colWidths=col_widths, repeatRows=1) style = TableStyle([ ('BACKGROUND', (0,0), (-1,0), C_NAVY), ('BACKGROUND', (0,1), (-1,-1), C_GREY_LT), ('ROWBACKGROUNDS',(0,1),(-1,-1), [C_WHITE, C_GREY_LT]), ('GRID', (0,0), (-1,-1), 0.4, C_GREY_MED), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,0), (-1,-1), 4), ('RIGHTPADDING', (0,0), (-1,-1), 4), ]) t.setStyle(style) return t def bullet(text): return Paragraph(f'• {text}', sBullet) def body(text): return Paragraph(text, sBody) def h2(text): return Paragraph(text, sH2) def h3(text): return Paragraph(text, sH3) def h4(text): return Paragraph(text, sH4) def note(text): return Paragraph(f'<i>Note: {text}</i>', sNote) def sp(h=6): return Spacer(1, h) def hr(): return HRFlowable(width='100%', thickness=0.5, color=C_GREY_MED, spaceAfter=4) print("Part 1 helpers loaded OK") PYEOF echo "Written part1"