I need a history check list for my osce exam about erctail dysfunction
"erectile dysfunction"[MeSH Terms] AND "diagnosis"
Make a one-page PDF revision card of this checklist
ls -la /tmp/workspace/
mkdir -p /tmp/workspace/ed-osce-card && cat > /tmp/workspace/ed-osce-card/make.py <<'EOF' from reportlab.lib.pagesizes import A4 from reportlab.pdfgen import canvas from reportlab.lib.colors import HexColor, white from reportlab.platypus import Paragraph from reportlab.lib.styles import ParagraphStyle W, H = A4 M = 24 NAVY = HexColor("#1F3A5F"); TEAL = HexColor("#2A7F8E"); LIGHT = HexColor("#EEF4F7"); RED = HexColor("#B3261E") c = canvas.Canvas("/tmp/workspace/ed-osce-card/ED_History_OSCE_Revision_Card.pdf", pagesize=A4) c.setTitle("ED History OSCE Revision Card") # header c.setFillColor(NAVY); c.rect(0, H-52, W, 52, fill=1, stroke=0) c.setFillColor(white); c.setFont("Helvetica-Bold", 18) c.drawString(M, H-28, "Erectile Dysfunction: OSCE History Revision Card") c.setFont("Helvetica", 9) c.drawString(M, H-43, "ED = inability to attain/maintain an erection sufficient for satisfactory sexual performance") body = ParagraphStyle("b", fontName="Helvetica", fontSize=7.6, leading=9.4) sections = [ ("1. Opening", [ "Hand hygiene, introduce, confirm name/DOB", "Explain purpose, consent, privacy", "Open question; offer chaperone"]), ("2. Presenting complaint", [ "<b>Onset</b> sudden vs gradual; duration; course", "<b>Situational vs global</b> (partner vs masturbation)", "<b>Morning/nocturnal erections</b>: present = psychogenic; absent = organic", "Getting vs keeping erection; rigidity; penetration", "Triggers (new drug, surgery, trauma, stress)", "Prior treatments incl. online/herbal; response"]), ("3. Other sexual domains", [ "<b>Libido</b> (low: hypogonadism, depression, drugs)", "Ejaculation: premature/delayed/absent", "Orgasm; penile curvature/pain (Peyronie's); priapism", "Offer SHIM / IIEF-5 score"]), ("4. Psychosocial", [ "Mood, anxiety, performance anxiety, stressors", "Relationship quality, partner's health/attitude", "Past sexual trauma, orientation/practices (sensitively)", "Pornography use; STI risk / safe sex"]), ("5. Organic causes by system", [ "<b>Vascular/cardiac</b>: HTN, lipids, CHD, PVD, stroke; exertional chest pain, exercise tolerance", "<b>Endocrine</b>: diabetes (control, complications), hypogonadism (energy, hair, gynaecomastia), thyroid, prolactin (galactorrhoea, visual fields), obesity", "<b>Neuro</b>: MS, Parkinson's, spinal injury, neuropathy; saddle numbness, bladder/bowel", "<b>Urological/pelvic</b>: LUTS/BPH, prostate Ca or prostatectomy, pelvic surgery/radiotherapy/trauma, cycling", "<b>Systemic</b>: CKD, liver disease, COPD, HIV, sleep apnoea", "<b>Mental health</b>: depression, anxiety, psychosis"]), ("6. Drug history (up to 25% of cases)", [ "Antihypertensives (thiazides, beta-blockers, spironolactone)", "Antidepressants (SSRIs, TCAs); antipsychotics", "5-ARIs, anti-androgens, GnRH analogues", "Opioids, benzodiazepines, antiepileptics, H2 blockers", "<font color='#B3261E'><b>Nitrates / nicorandil: contraindicate PDE-5i</b></font>", "Current PDE-5i; OTC/herbal; anabolic steroids; allergies"]), ("7. Lifestyle", [ "Smoking (pack-years); alcohol (units/wk)", "Recreational drugs: cannabis, cocaine, opioids", "Diet, exercise, weight change, sleep, occupation"]), ("8. PMH / FH / SH", [ "Pelvic, prostate, vascular, spinal surgery", "Family history: early CVD, diabetes", "Living situation, occupation, support"]), ("9. Red flags", [ "<b>ED is a sentinel for CVD</b> (about 45% higher cardiac event risk at 5 yrs, PCPT)", "Cauda equina features: saddle numbness, bladder/bowel loss", "Hypogonadism; suicidal ideation if depressed"]), ("10. ICE", [ "<b>I</b>deas: what does he think is the cause?", "<b>C</b>oncerns: cancer, heart, relationship?", "<b>E</b>xpectations: what does he hope for?"]), ("11. Closing and next steps", [ "Summarise; ask 'anything else?'", "<b>Exam</b>: genitalia, sex characteristics, BP, BMI, pulses, neuro", "<b>Ix</b>: HbA1c/glucose, lipids, AM testosterone, U&E, LFT; prolactin/LH/free T only if hypogonadal", "<b>Mx</b>: lifestyle, drug review, PDE-5i, psychosexual counselling", "Thank patient; written information"]), ] colw = (W - 2*M - 10)/2 gap = 10 def build(sec): title, items = sec paras = [Paragraph("\u2610 " + t, body) for t in items] hs = [] for p in paras: w, h = p.wrap(colw-16, 1000); hs.append(h+2.2) return title, paras, hs, 17 + sum(hs) + 5 blocks = [build(s) for s in sections] # balance columns greedily in order total = sum(b[3] for b in blocks) cols = [[], []]; acc = 0 for b in blocks: if acc < total/2 and len(cols[0]) < len(blocks): if acc + b[3]/2 > total/2 and cols[0]: cols[1].append(b); acc += b[3]; continue cols[0].append(b); acc += b[3] else: cols[1].append(b) top = H - 52 - 10 for ci, col in enumerate(cols): x = M + ci*(colw+gap); y = top for title, paras, hs, bh in col: c.setFillColor(LIGHT); c.roundRect(x, y-bh+3, colw, bh-3, 4, fill=1, stroke=0) c.setFillColor(TEAL); c.roundRect(x, y-14, colw, 14, 4, fill=1, stroke=0) c.setFillColor(white); c.setFont("Helvetica-Bold", 8.6); c.drawString(x+6, y-10.5, title) yy = y - 17 for p, h in zip(paras, hs): p.drawOn(c, x+6, yy - h + 1.2); yy -= h y -= bh + 3 print("col", ci, "bottom", y) # mnemonic strip mh = 44; my = 62 c.setFillColor(NAVY); c.roundRect(M, my, W-2*M, mh, 5, fill=1, stroke=0) c.setFillColor(white); c.setFont("Helvetica-Bold", 9); c.drawString(M+8, my+mh-13, "Mnemonic: ERECTILE") ms = ParagraphStyle("m", fontName="Helvetica", fontSize=8, leading=10, textColor=white) Paragraph("<b>E</b>rection quality | <b>R</b>elationship/psych | <b>E</b>jaculation and libido | <b>C</b>ardiovascular/systemic | <b>T</b>reatments and meds (nitrates!) | <b>I</b>njury, surgery, neuro | <b>L</b>ifestyle | <b>E</b>ndocrine", ms).wrapOn(c, W-2*M-16, 30) p = Paragraph("<b>E</b>rection quality | <b>R</b>elationship/psych | <b>E</b>jaculation and libido | <b>C</b>ardiovascular/systemic | <b>T</b>reatments and meds (nitrates!) | <b>I</b>njury, surgery, neuro | <b>L</b>ifestyle | <b>E</b>ndocrine", ms) p.wrap(W-2*M-16, 30); p.drawOn(c, M+8, my+4) c.setFillColor(HexColor("#555555")); c.setFont("Helvetica", 6.8) c.drawString(M, 48, "Sources: Goldman-Cecil Medicine; Campbell-Walsh Urology; Textbook of Family Medicine 9e; Smith and Tanagho's General Urology.") c.drawString(M, 39, "Study aid only. Check against your local OSCE mark scheme and current AUA/EAU guidance.") c.save() EOF cd /tmp/workspace/ed-osce-card && python make.py && python -c " from pypdf import PdfReader r=PdfReader('ED_History_OSCE_Revision_Card.pdf');print(len(r.pages))"
cd /tmp/workspace/ed-osce-card && sed -i 's/fontSize=7.6, leading=9.4/fontSize=9.3, leading=11.4/; s/h+2.2/h+3/; s/"Helvetica-Bold", 8.6/"Helvetica-Bold", 10/; s/c.roundRect(x, y-14, colw, 14, 4/c.roundRect(x, y-16, colw, 16, 4/; s/y-10.5/y-12/; s/yy = y - 17/yy = y - 20/; s/return title, paras, hs, 17 + sum(hs) + 5/return title, paras, hs, 20 + sum(hs) + 6/' make.py && python make.py && python - <<'EOF' import pdfplumber with pdfplumber.open('/tmp/workspace/ed-osce-card/ED_History_OSCE_Revision_Card.pdf') as pdf: print(len(pdf.pages)) pdf.pages[0].to_image(resolution=80).save('/tmp/workspace/ed-osce-card/preview.png') EOF
cd /tmp/workspace/ed-osce-card && sed -i 's/fontSize=9.3, leading=11.4/fontSize=10, leading=12.3/; s|Paragraph("\\u2610 " + t, body)|Paragraph("<font name=\\"ZapfDingbats\\" size=\\"8\\">o</font> " + t, body)|' make.py && grep -n ZapfDingbats make.py && python make.py && python - <<'EOF' import pdfplumber with pdfplumber.open('/tmp/workspace/ed-osce-card/ED_History_OSCE_Revision_Card.pdf') as pdf: print(len(pdf.pages)) pdf.pages[0].to_image(resolution=80).save('/tmp/workspace/ed-osce-card/preview.png') EOF
cd /tmp/workspace/ed-osce-card && python - <<'EOF' import pdfplumber with pdfplumber.open('ED_History_OSCE_Revision_Card.pdf') as pdf: im = pdf.pages[0].to_image(resolution=200) im.original.crop((40,150,800,520)).save('crop.png') EOF
cd /tmp/workspace/ed-osce-card && ls -la && python - <<'EOF' import pdfplumber with pdfplumber.open('ED_History_OSCE_Revision_Card.pdf') as pdf: im = pdf.pages[0].to_image(resolution=200) im.save('crop_full.png') from PIL import Image img = Image.open('crop_full.png'); print(img.size) img.crop((40,150,800,520)).save('crop.png') EOF ls
cd /tmp/workspace/ed-osce-card && python - <<'EOF' s = open('make.py').read() s = s.replace('fontSize=10, leading=12.3)', 'fontSize=10, leading=12.3, leftIndent=12)') s = s.replace('Paragraph("<font name=\\"ZapfDingbats\\" size=\\"8\\">o</font> " + t, body)', 'Paragraph(t, body)') s = s.replace("p.drawOn(c, x+6, yy - h + 1.2); yy -= h", "p.drawOn(c, x+6, yy - h + 1.2)\n c.setStrokeColor(NAVY); c.setLineWidth(0.8); c.setFillColor(white); c.rect(x+7, yy-11.4, 6.5, 6.5, fill=1, stroke=1)\n yy -= h") open('make.py','w').write(s) EOF grep -n "Paragraph(t, body)\|c.rect(x+7" make.py; python make.py && python - <<'EOF' import pdfplumber from PIL import Image with pdfplumber.open('ED_History_OSCE_Revision_Card.pdf') as pdf: print(len(pdf.pages)) im = pdf.pages[0].to_image(resolution=110); im.save('p.png') pdf.pages[0].to_image(resolution=200).save('f.png') Image.open('f.png').crop((40,150,800,620)).save('crop2.png') EOF
cd /tmp/workspace/ed-osce-card && ls && python -c " from PIL import Image Image.open('f.png').crop((40,150,800,620)).save('crop2.png')"; ls
ED History OSCE Revision Card
PDF Document · PDF