make a ppt for registrar level on Adrenal gland physiology, Cushings disease and Addison disease with crises
adrenal insufficiency AND Cushing syndrome
Endocrine Society Cushing syndrome adrenal insufficiency adrenal crisis guideline
adrenal gland cortex zones steroid hormone synthesis diagram
Cushing disease pituitary ACTH clinical features image adrenal insufficiency hyperpigmentation image
~/
https://www.endocrine.org/clinical-practice-guidelines/prima…
~/
mkdir -p "/tmp/workspace/adrenal_registrar_ppt/src" "/tmp/workspace/adrenal_registrar_ppt/output"
python - <<'PY' from pathlib import Path p=Path('/tmp/workspace/adrenal_registrar_ppt/src/build_deck.py') p.write_text(r'''from pptx import Presentation from pptx.util import Inches, Pt from pptx.dml.color import RGBColor from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.enum.dml import MSO_THEME_COLOR from pptx.enum.text import MSO_AUTO_SIZE OUT='/tmp/workspace/adrenal_registrar_ppt/output/Adrenal_Physiology_Cushing_Addison_Registrar.pptx' prs=Presentation(); prs.slide_width=Inches(13.333); prs.slide_height=Inches(7.5) blank=prs.slide_layouts[6] # palette NAVY=RGBColor(12,30,52); BLUE=RGBColor(20,84,125); TEAL=RGBColor(0,139,139); CYAN=RGBColor(92,205,211); GOLD=RGBColor(239,179,70); RED=RGBColor(193,55,64); PALE=RGBColor(237,244,247); SLATE=RGBColor(71,89,105); WHITE=RGBColor(255,255,255); GREEN=RGBColor(47,125,91); ORANGE=RGBColor(224,125,48) def bg(slide, color=WHITE): s=slide.background.fill; s.solid(); s.fore_color.rgb=color def rect(slide,x,y,w,h,fill=PALE,line=None,r=0.12): sh=slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE if r else MSO_SHAPE.RECTANGLE, Inches(x),Inches(y), Inches(w), Inches(h)) sh.fill.solid(); sh.fill.fore_color.rgb=fill sh.line.color.rgb = line if line else fill return sh def text(slide,x,y,w,h,txt,size=18,color=NAVY,bold=False,align=None,margin=.06): tb=slide.shapes.add_textbox(Inches(x),Inches(y), Inches(w), Inches(h)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True tf.margin_left=tf.margin_right=Inches(margin); tf.margin_top=tf.margin_bottom=Inches(margin/2) for i,line in enumerate(txt.split('\n')): p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=line p.font.name='Aptos'; p.font.size=Pt(size); p.font.bold=bold; p.font.color.rgb=color; p.space_after=Pt(3) if align: p.alignment=align return tb def title(slide,ttl,sub=''): text(slide,.55,.3,12.2,.45,ttl,28,NAVY,True) if sub:text(slide,.57,.78,12,.24,sub,10,SLATE) sh=slide.shapes.add_shape(MSO_SHAPE.RECTANGLE,Inches(.55), Inches(1.08), Inches(12.15), Inches(.045)); sh.fill.solid();sh.fill.fore_color.rgb=TEAL;sh.line.color.rgb=TEAL def footer(slide,n): text(slide,.55,7.15,10,.18,'Registrar teaching | Adrenal physiology, Cushing disease & Addison disease',8,SLATE) text(slide,12.25,7.13,.5,.2,str(n),9,SLATE,True,PP_ALIGN.RIGHT) def bullets(slide,x,y,w,h,items,size=16,color=NAVY): tb=slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)); tf=tb.text_frame; tf.clear();tf.word_wrap=True tf.margin_left=Inches(.08);tf.margin_right=Inches(.04) for i,it in enumerate(items): p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=it; p.font.name='Aptos';p.font.size=Pt(size);p.font.color.rgb=color;p.level=0;p.text='• '+it;p.space_after=Pt(7) return tb def arrow(slide,x1,y1,x2,y2,color=TEAL): l=slide.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Inches(x1), Inches(y1), Inches(x2), Inches(y2));l.line.color.rgb=color;l.line.width=Pt(2);l.line.end_arrowhead=True;return l def notes(slide,txt): ns=slide.notes_slide.notes_text_frame; ns.text='Teaching notes\n'+txt #1 s=prs.slides.add_slide(blank);bg(s,NAVY) text(s,.7,.8,11.8,.7,'ADRENAL AXIS',36,WHITE,True) text(s,.72,1.62,11.5,.55,'Physiology, Cushing disease, Addison disease & adrenal crisis',24,CYAN) rect(s,.72,2.45,3.45,2.55,RGBColor(17,56,78)); text(s,1.0,2.75,2.9,.4,'For registrars',20,WHITE,True) bullets(s,1.0,3.3,2.9,1.2,['Axis-based reasoning','Biochemical algorithms','First-hour crisis care'],15,WHITE) # stylized gland rect(s,8.0,2.0,2.2,2.75,GOLD,None); rect(s,8.28,2.28,1.64,2.18,ORANGE,None); text(s,8.25,4.95,1.8,.3,'Cortex • Medulla',12,WHITE,True,PP_ALIGN.CENTER) text(s,.75,6.72,9,.2,'Clinical teaching deck | September 2026',10,RGBColor(180,205,220)) notes(s,'Open by distinguishing Cushing disease (pituitary ACTH adenoma) from Cushing syndrome (all causes of hypercortisolism).') #2 objectives s=prs.slides.add_slide(blank);bg(s);title(s,'Learning objectives','By the end, the learner should be able to reason from physiology to acute management.') for i,(h,b,c) in enumerate([('1. Localise','Map adrenal zones and regulators.',TEAL),('2. Confirm','Use screening and localisation tests safely.',BLUE),('3. Treat','Recognise endocrine emergencies and act before results.',RED)]): x=.8+i*4.1;rect(s,x,1.7,3.55,3.6,PALE,c);text(s,x+.28,2.05,2.9,.35,h,23,c,True);text(s,x+.28,2.7,2.9,1.25,b,18,NAVY);text(s,x+.28,4.5,2.6,.3,['Physiology','Cushing disease','Addison/crisis'][i],14,SLATE,True) footer(s,2) #3 anatomy s=prs.slides.add_slide(blank);bg(s);title(s,'Adrenal structure: anatomy determines failure phenotype') rect(s,.8,1.55,3.2,4.9,NAVY);text(s,1.05,1.85,2.7,.35,'ADRENAL CORTEX',20,WHITE,True) for y,name,horm,reg,col in [(2.45,'Zona glomerulosa','Aldosterone','Ang II, K+','GOLD'),(3.5,'Zona fasciculata','Cortisol','ACTH','CYAN'),(4.55,'Zona reticularis','DHEA / androgens','ACTH','ORANGE')]: rect(s,1.1,y,2.55,.77,eval(col)); text(s,1.23,y+.11,2.2,.18,name,13,NAVY,True);text(s,1.23,y+.37,2.2,.16,horm+' | '+reg,10,NAVY) rect(s,1.1,5.62,2.55,.5,RED);text(s,1.23,5.76,2.1,.16,'Medulla: catecholamines',10,WHITE,True) rect(s,4.6,1.55,7.75,4.9,PALE);text(s,4.95,1.88,6.8,.3,'Clinical translation',21,TEAL,True) bullets(s,4.95,2.5,6.8,3.1,['Primary adrenal failure: cortisol + aldosterone deficiency, high ACTH and hyperpigmentation.','Secondary/tertiary failure: cortisol deficiency with preserved mineralocorticoid function.','Cortisol is a stress hormone; inability to increase output is central to crisis physiology.','Aldosterone is controlled chiefly by RAAS and potassium, not ACTH.'],16) footer(s,3) #4 axis s=prs.slides.add_slide(blank);bg(s);title(s,'The HPA axis: circadian output, pulsatility and stress responsiveness') for x,lab,sub,c in [(1,'Hypothalamus','CRH ± AVP',BLUE),(4.65,'Anterior pituitary','ACTH (POMC)',TEAL),(8.3,'Adrenal fasciculata','Cortisol',GOLD)]: rect(s,x,2.0,2.6,1.05,c);text(s,x+.1,2.22,2.4,.23,lab,17,WHITE,True,PP_ALIGN.CENTER);text(s,x+.1,2.58,2.4,.18,sub,11,WHITE,False,PP_ALIGN.CENTER) arrow(s,3.6,2.52,4.6,2.52);arrow(s,7.25,2.52,8.25,2.52);arrow(s,9.6,3.1,2.3,4.2,RED) text(s,1.15,4.2,2.9,.4,'Negative feedback',15,RED,True) rect(s,.9,5.05,11.4,1.0,PALE);text(s,1.2,5.25,10.8,.24,'Cortisol: peaks around waking, nadir near midnight. Loss of this rhythm supports endogenous Cushing syndrome. Acute illness raises cortisol demand and can uncover adrenal insufficiency.',15,NAVY,False,PP_ALIGN.CENTER) footer(s,4) #5 steroidogenesis s=prs.slides.add_slide(blank);bg(s);title(s,'Steroidogenesis: high-yield enzyme map','Cholesterol is the shared substrate. The zone-specific enzyme pattern produces the phenotype.') labels=[('Cholesterol','StAR / CYP11A1',.8,BLUE),('Pregnenolone','3β-HSD',3.15,TEAL),('Progesterone / 17-OH intermediates','CYP17A1',5.4,ORANGE),('Cortisol','CYP21A2 → CYP11B1',9.4,GOLD)] for i,(a,b,x,c) in enumerate(labels): rect(s,x,2.0,2.35 if i!=2 else 3.1,1.05,c);text(s,x+.1,2.23,2.1 if i!=2 else 2.85,.2,a,15,WHITE,True,PP_ALIGN.CENTER);text(s,x+.08,2.58,2.15 if i!=2 else 2.9,.16,b,9,WHITE,False,PP_ALIGN.CENTER) if i<len(labels)-1: arrow(s,x+(2.35 if i!=2 else 3.1),2.52,labels[i+1][2]-.07,2.52) rect(s,1.2,4.05,5.3,1.2,PALE);text(s,1.45,4.25,4.85,.55,'Zona glomerulosa lacks CYP17A1 and expresses CYP11B2 (aldosterone synthase).',16,NAVY,True,PP_ALIGN.CENTER) rect(s,6.85,4.05,5.15,1.2,PALE);text(s,7.1,4.25,4.65,.55,'11β-HSD2 protects renal mineralocorticoid receptors from cortisol.',16,NAVY,True,PP_ALIGN.CENTER) footer(s,5) #6 actions s=prs.slides.add_slide(blank);bg(s);title(s,'Cortisol and aldosterone: actions that explain the ward findings') for x,h,c,its in [(0.8,'Cortisol',GOLD,['Permissive vascular catecholamine response','Gluconeogenesis and counter-regulation','Immune and inflammatory restraint','Bone, muscle, skin and neuropsychiatric effects']),(6.8,'Aldosterone',TEAL,['Distal Na+ reabsorption','K+ and H+ secretion','ECF volume and BP preservation','Deficiency: salt loss, hyperkalaemia, acidosis'])]: rect(s,x,1.65,5.65,4.6,PALE,c);text(s,x+.32,1.98,4.9,.35,h,25,c,True);bullets(s,x+.28,2.65,4.95,2.9,its,17) footer(s,6) #7 Cushing definition s=prs.slides.add_slide(blank);bg(s);title(s,'Cushing syndrome versus Cushing disease','Do not use the terms interchangeably.') rect(s,.8,1.55,5.7,4.9,PALE,ORANGE);text(s,1.1,1.9,5.1,.4,'CUSHING SYNDROME',23,ORANGE,True);bullets(s,1.1,2.55,4.9,2.8,['Clinical state of chronic glucocorticoid excess.','Most common cause overall: exogenous glucocorticoids.','Endogenous disease: ACTH-dependent or ACTH-independent.'],17) rect(s,6.85,1.55,5.7,4.9,PALE,TEAL);text(s,7.15,1.9,5.1,.4,'CUSHING DISEASE',23,TEAL,True);bullets(s,7.15,2.55,4.9,2.8,['Specific ACTH-dependent syndrome due to pituitary corticotroph adenoma.','ACTH drives bilateral adrenal cortisol production.','Requires pituitary-directed localisation and therapy.'],17) footer(s,7) #8 clinical s=prs.slides.add_slide(blank);bg(s);title(s,'When to suspect endogenous hypercortisolism','Discriminatory signs are more useful than common cardiometabolic features.') rect(s,.8,1.55,5.7,4.95,PALE,RED);text(s,1.1,1.87,5,.25,'Higher discriminatory value',20,RED,True);bullets(s,1.1,2.35,5,3.5,['Wide violaceous striae','Facial plethora, thin skin, easy bruising','Proximal myopathy','Unexplained osteoporosis or fragility fracture','New severe hypertension or diabetes at young age'],16) rect(s,6.85,1.55,5.7,4.95,PALE,BLUE);text(s,7.15,1.87,5,.25,'Also assess complications',20,BLUE,True);bullets(s,7.15,2.35,5,3.5,['Hypokalaemia and alkalosis: consider ectopic ACTH','Infection risk, mood disorder, sleep disturbance','VTE risk, particularly perioperatively','Menstrual disturbance, hirsutism, erectile dysfunction'],16) footer(s,8) #9 diagnostic algorithm s=prs.slides.add_slide(blank);bg(s);title(s,'Cushing syndrome: diagnostic sequence','Screen first. Localise only after confirming autonomous cortisol excess.') steps=[('1. Exclude exogenous steroids','All routes: oral, injected, inhaled, topical; review CYP3A4 interactions.'),('2. Establish hypercortisolism','Use one high-accuracy test, usually repeat/confirm if abnormal: 1-mg overnight DST, late-night salivary cortisol x2, or 24-hour UFC x2.'),('3. Measure ACTH','Suppressed: ACTH-independent, image adrenals. Normal/high: ACTH-dependent.'),('4. Localise ACTH source','Pituitary MRI. If uncertainty or small/negative lesion: inferior petrosal sinus sampling in expert centre.')] for i,(a,b) in enumerate(steps): y=1.5+i*1.28; rect(s,.85,y,11.65,.92,PALE,[TEAL,BLUE,GOLD,ORANGE][i]); text(s,1.12,y+.13,3.65,.22,a,16,NAVY,True);text(s,4.65,y+.12,7.3,.45,b,13,NAVY); if i<3:arrow(s,6.65,y+.95,6.65,y+1.22,SLATE) text(s,.95,6.75,11.4,.2,'Interpret in context: acute illness, alcohol excess, depression, obesity and poorly controlled diabetes can produce pseudo-Cushing physiology.',11,SLATE,False,PP_ALIGN.CENTER) footer(s,9) #10 therapy s=prs.slides.add_slide(blank);bg(s);title(s,'Cushing disease: treatment and perioperative priorities') rect(s,.8,1.5,4.0,4.95,PALE,TEAL);text(s,1.08,1.82,3.45,.3,'First line',21,TEAL,True);bullets(s,1.08,2.35,3.35,2.9,['Transsphenoidal surgery by experienced pituitary surgeon.','Document early postoperative cortisol trajectory.','Expect temporary adrenal insufficiency after remission; arrange replacement and testing.'],16) rect(s,4.98,1.5,3.55,4.95,PALE,ORANGE);text(s,5.27,1.82,2.9,.3,'Persistent / recurrent',19,ORANGE,True);bullets(s,5.27,2.35,2.85,2.9,['Repeat surgery in selected cases','Radiotherapy / radiosurgery','Bilateral adrenalectomy in selected refractory disease'],15) rect(s,8.7,1.5,3.85,4.95,PALE,BLUE);text(s,8.99,1.82,3.2,.3,'Medical control',19,BLUE,True);bullets(s,8.99,2.35,3.0,3.15,['Steroidogenesis inhibitors: ketoconazole/levoketoconazole, metyrapone, osilodrostat','Pituitary-directed: pasireotide, cabergoline','GR antagonist: mifepristone','Monitor for adrenal insufficiency, liver toxicity and drug-specific adverse effects'],13) footer(s,10) #11 Addison s=prs.slides.add_slide(blank);bg(s);title(s,'Primary adrenal insufficiency (Addison disease)','A failure of cortex: glucocorticoid plus mineralocorticoid deficiency.') rect(s,.8,1.5,3.65,4.95,NAVY);text(s,1.12,1.85,3.0,.3,'Typical phenotype',20,WHITE,True);bullets(s,1.12,2.35,2.95,3.1,['Fatigue, weight loss, nausea','Postural hypotension, salt craving','Hyperpigmentation','Hyponatraemia, hyperkalaemia','Hypoglycaemia, especially during stress'],16,WHITE) rect(s,4.72,1.5,3.65,4.95,PALE,TEAL);text(s,5.05,1.85,3.0,.3,'Major causes',20,TEAL,True);bullets(s,5.05,2.35,2.95,3.1,['Autoimmune adrenalitis (commonest in high-income settings)','Tuberculosis / fungal infection','Adrenal haemorrhage or infarction','Metastatic/infiltrative disease','Adrenoleukodystrophy and genetic causes'],16) rect(s,8.65,1.5,3.65,4.95,PALE,GOLD);text(s,8.98,1.85,3.0,.3,'Primary vs secondary',20,GOLD,True);bullets(s,8.98,2.35,2.95,3.1,['Primary: ACTH high, aldosterone low, pigmentation and K+ rise possible','Central: ACTH low/inappropriately normal; aldosterone usually preserved','Both can cause hyponatraemia and crisis'],15) footer(s,11) #12 diagnosis s=prs.slides.add_slide(blank);bg(s);title(s,'Adrenal insufficiency: test pathway','Do not delay treatment in suspected crisis.') for i,(h,b,c) in enumerate([('Draw before steroids if feasible','Serum cortisol, ACTH, electrolytes, glucose; renin/aldosterone if primary suspected.',BLUE),('Confirm when stable','250-µg short Synacthen test. Peak cortisol threshold is assay-specific.',TEAL),('Establish aetiology','21-hydroxylase antibodies; CT adrenals if infection, haemorrhage, metastasis or infiltration is suspected; evaluate pituitary if central.',ORANGE)]): x=.8+i*4.12;rect(s,x,1.85,3.55,3.55,PALE,c);text(s,x+.25,2.18,3.0,.45,h,18,c,True);text(s,x+.25,3.05,2.95,1.45,b,15,NAVY) text(s,.95,6.12,11.4,.35,'Interpretation: low 8-am cortisol with clearly elevated ACTH strongly supports primary AI. A random cortisol can be informative in shock but does not exclude AI outside the acute setting.',14,SLATE,False,PP_ALIGN.CENTER) footer(s,12) #13 chronic management s=prs.slides.add_slide(blank);bg(s);title(s,'Long-term replacement and prevention','Treatment succeeds when patients can self-protect during intercurrent illness.') for x,h,c,its in [(0.8,'Glucocorticoid',TEAL,['Hydrocortisone usually 15-25 mg/day in 2-3 divided doses, tailored clinically.','Alternative prednisolone may be appropriate.','Avoid biochemical “over-replacement”.']),(4.65,'Mineralocorticoid',GOLD,['Fludrocortisone for primary AI, titrated to symptoms, BP, K+ and renin.','Usually not required in central AI.']),(8.5,'Safety package',RED,['Written sick-day rules and emergency IM hydrocortisone kit.','Steroid emergency card / medical alert identification.','Double oral dose for febrile illness; parenteral steroid if vomiting or unable to absorb.'])]: rect(s,x,1.65,3.6,4.8,PALE,c);text(s,x+.25,2.0,3.1,.32,h,21,c,True);bullets(s,x+.25,2.6,2.95,3.35,its,15) footer(s,13) #14 crisis s=prs.slides.add_slide(blank);bg(s);title(s,'ADRENAL CRISIS: first hour management','Treat on clinical suspicion. Sample first only if this does not delay therapy.') rect(s,.75,1.35,11.85,.75,RED);text(s,1.0,1.57,11.25,.22,'Shock, severe hypotension, vomiting/abdominal pain, fever, confusion, hypoglycaemia or unexplained hyponatraemia ± hyperkalaemia',17,WHITE,True,PP_ALIGN.CENTER) acts=[('0 min','Hydrocortisone 100 mg IV or IM immediately.'),('0-15 min','0.9% saline rapid resuscitation. Add dextrose if hypoglycaemic or at risk.'),('0-60 min','Repeat assessment: BP, mentation, urine output, glucose, Na+/K+; send cultures and treat precipitant.'),('Thereafter','Hydrocortisone 200 mg/24 h continuous IV infusion OR 50 mg IV/IM every 6 h. Taper to oral when stable and eating.')] for i,(a,b) in enumerate(acts): y=2.4+i*.92;rect(s,1.15,y,2.0,.6,[RED,ORANGE,TEAL,BLUE][i]);text(s,1.28,y+.17,1.72,.17,a,14,WHITE,True,PP_ALIGN.CENTER);rect(s,3.3,y,8.3,.6,PALE);text(s,3.55,y+.16,7.85,.2,b,15,NAVY) text(s,1.0,6.42,11.5,.25,'At stress-dose hydrocortisone, additional fludrocortisone is not required initially because hydrocortisone has mineralocorticoid activity.',13,SLATE,False,PP_ALIGN.CENTER) footer(s,14) #15 case s=prs.slides.add_slide(blank);bg(s);title(s,'Case-based consolidation','A 48-year-old with vomiting, confusion and refractory hypotension after influenza.') rect(s,.8,1.55,4.0,4.85,NAVY);text(s,1.1,1.85,3.45,.3,'Data',21,WHITE,True);bullets(s,1.1,2.35,3.2,3.4,['BP 76/45 mmHg, T 38.4°C','Na+ 122 mmol/L, K+ 5.9 mmol/L','Glucose 2.9 mmol/L','Progressive fatigue, weight loss and skin darkening'],16,WHITE) rect(s,5.05,1.55,3.35,4.85,PALE,RED);text(s,5.35,1.85,2.75,.3,'Diagnosis',21,RED,True);bullets(s,5.35,2.35,2.5,3.3,['Adrenal crisis likely due to primary AI','Sepsis may be precipitant and/or mimic','Do not wait for Synacthen result'],16) rect(s,8.65,1.55,3.85,4.85,PALE,TEAL);text(s,8.95,1.85,3.25,.3,'Actions now',21,TEAL,True);bullets(s,8.95,2.35,2.9,3.3,['Cortisol + ACTH if immediately available','Hydrocortisone 100 mg IV/IM','Saline, dextrose, manage hyperkalaemia','Cultures, antimicrobials as indicated','Endocrinology input after stabilisation'],15) footer(s,15) #16 take home s=prs.slides.add_slide(blank);bg(s,NAVY);text(s,.7,.55,11.6,.5,'TAKE-HOME MESSAGES',29,WHITE,True) for i,t in enumerate(['Adrenal zones have distinct regulators: ACTH is not the primary controller of aldosterone.','Cushing disease is pituitary ACTH excess. Confirm hypercortisolism before localisation.','Primary AI causes cortisol and aldosterone deficiency: pigmentation and hyperkalaemia point to it.','In suspected adrenal crisis, give hydrocortisone and fluids immediately. Investigate in parallel, never first.']): y=1.45+i*1.18;rect(s,.85,y,.52,.52,[TEAL,GOLD,ORANGE,RED][i]);text(s,.85,y+.12,.52,.2,str(i+1),16,NAVY,True,PP_ALIGN.CENTER);text(s,1.65,y+.02,10.65,.55,t,18,WHITE) text(s,.85,6.55,11.4,.25,'Questions and discussion',18,CYAN,True) footer(s,16) #17 refs s=prs.slides.add_slide(blank);bg(s);title(s,'Selected references','Guidance should be adapted to local endocrine, critical-care and perioperative protocols.') refs=['Bornstein SR et al. Diagnosis and Treatment of Primary Adrenal Insufficiency: Endocrine Society Clinical Practice Guideline. JCEM. 2016. doi:10.1210/jc.2015-1710.','Nieman LK et al. Treatment of Cushing’s Syndrome: Endocrine Society Clinical Practice Guideline. JCEM. 2015. doi:10.1210/jc.2015-1818.','Medical Physiology. 6th ed. Elsevier. Box 50-1 and adrenal corticosteroid chapters.','Goldman-Cecil Medicine. 27th ed. Elsevier. Cushing disease sections.','Symptom to Diagnosis: An Evidence-Based Guide. 4th ed. McGraw-Hill. Adrenal insufficiency and crisis treatment sections.','Harrison’s Principles of Internal Medicine. 22nd ed. McGraw-Hill. Adrenal insufficiency sections.'] bullets(s,.9,1.48,11.55,4.85,refs,14) text(s,.95,6.55,11.2,.2,'Recent evidence scan: a 2026 systematic review on dyslipidaemia after treating hypercortisolism (PMID 41432529) supports cardiometabolic monitoring, but does not change the acute algorithms presented.',10,SLATE) footer(s,17) prs.save(OUT) print(OUT) ''') PY python "/tmp/workspace/adrenal_registrar_ppt/src/build_deck.py" python - <<'PY' from pptx import Presentation p='/tmp/workspace/adrenal_registrar_ppt/output/Adrenal_Physiology_Cushing_Addison_Registrar.pptx' prs=Presentation(p) print('slides',len(prs.slides)) for i,s in enumerate(prs.slides,1): print(i, next((sh.text[:80] for sh in s.shapes if hasattr(sh,'text_frame') and sh.text.strip()),'')) PY
~/adrenal_registrar_ppt/output
python - <<'PY' from pptx import Presentation p='/tmp/workspace/adrenal_registrar_ppt/output/Adrenal_Physiology_Cushing_Addison_Registrar.pptx' prs=Presentation(p) errors=[] for i,s in enumerate(prs.slides,1): for j,sh in enumerate(s.shapes,1): if hasattr(sh,'text_frame'): for pgh in sh.text_frame.paragraphs: if not pgh.text.strip(): continue for r in pgh.runs: if r.font.size and r.font.size.pt < 8: errors.append((i,j,pgh.text,r.font.size.pt)) print('slides=',len(prs.slides),'small_text=',len(errors)) print(errors[:10]) PY
python - <<'PY' import os, zipfile from pptx import Presentation p='/tmp/workspace/adrenal_registrar_ppt/output/Adrenal_Physiology_Cushing_Addison_Registrar.pptx' assert os.path.exists(p) and os.path.getsize(p)>10000 with zipfile.ZipFile(p) as z: bad=z.testzip() print('zip_bad=',bad, 'size=',os.path.getsize(p)) prs=Presentation(p) assert len(prs.slides)==17 # Verify key emergency and teaching content exists all_text='\n'.join(sh.text for s in prs.slides for sh in s.shapes if hasattr(sh,'text')) for key in ['Hydrocortisone 100 mg IV or IM immediately','Cushing disease','Addison disease','short Synacthen']: assert key in all_text, key print('content_verified') PY
Adrenal Physiology Cushing Addison Registrar
Presentation · PPTX
Add recent endocrine guidelines and key references
~/
2023 2024 endocrine guidelines Cushing disease consensus guideline adrenal insufficiency guideline
Cushing disease AND guideline
adrenal insufficiency AND guideline
Cushing disease AND consensus
2021 international consensus guideline Cushing disease update diagnosis management 2021 PMID
https://www.endocrine.org/clinical-practice-guidelines/gluco…
python - <<'PY' from pptx import Presentation from pptx.util import Inches, Pt from pptx.dml.color import RGBColor from pptx.enum.shapes import MSO_SHAPE from pptx.enum.text import PP_ALIGN p='/tmp/workspace/adrenal_registrar_ppt/output/Adrenal_Physiology_Cushing_Addison_Registrar.pptx' prs=Presentation(p) blank=prs.slide_layouts[6] NAVY=RGBColor(12,30,52); BLUE=RGBColor(20,84,125); TEAL=RGBColor(0,139,139); GOLD=RGBColor(239,179,70); RED=RGBColor(193,55,64); PALE=RGBColor(237,244,247); SLATE=RGBColor(71,89,105); WHITE=RGBColor(255,255,255); ORANGE=RGBColor(224,125,48) def rect(slide,x,y,w,h,fill=PALE,line=None): sh=slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(x), Inches(y), Inches(w), Inches(h)); sh.fill.solid();sh.fill.fore_color.rgb=fill;sh.line.color.rgb=line if line else fill; return sh def tx(slide,x,y,w,h,txt,size=16,color=NAVY,bold=False,align=None): t=slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h)); f=t.text_frame;f.clear();f.word_wrap=True;f.margin_left=f.margin_right=Inches(.06);f.margin_top=f.margin_bottom=Inches(.03) for i,ln in enumerate(txt.split('\n')): p=f.paragraphs[0] if i==0 else f.add_paragraph();p.text=ln;p.font.name='Aptos';p.font.size=Pt(size);p.font.color.rgb=color;p.font.bold=bold;p.space_after=Pt(3) if align:p.alignment=align return t def title(slide,a,b=''): tx(slide,.55,.3,12.1,.42,a,27,NAVY,True) if b:tx(slide,.57,.78,12,.22,b,10,SLATE) l=slide.shapes.add_shape(MSO_SHAPE.RECTANGLE,Inches(.55),Inches(1.08),Inches(12.15),Inches(.045));l.fill.solid();l.fill.fore_color.rgb=TEAL;l.line.color.rgb=TEAL def footer(slide,n): tx(slide,.55,7.15,10,.18,'Registrar teaching | Adrenal physiology, Cushing disease & Addison disease',8,SLATE) tx(slide,12.25,7.13,.5,.2,str(n),9,SLATE,True,PP_ALIGN.RIGHT) def bullets(slide,x,y,w,h,items,size=14): t=slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h));f=t.text_frame;f.clear();f.word_wrap=True;f.margin_left=Inches(.06);f.margin_right=Inches(.04) for i,item in enumerate(items): p=f.paragraphs[0] if i==0 else f.add_paragraph();p.text='• '+item;p.font.name='Aptos';p.font.size=Pt(size);p.font.color.rgb=NAVY;p.space_after=Pt(7) # add guideline update slide s=prs.slides.add_slide(blank);s.background.fill.solid();s.background.fill.fore_color.rgb=WHITE title(s,'Guideline update: what has been added to this teaching deck','Recent endocrine guidance supplements, rather than replaces, local emergency and perioperative protocols.') items=[ ('2024 ESE/Endocrine Society joint guideline','Glucocorticoid-induced adrenal insufficiency: reinforces risk recognition across all steroid routes, physiologic tapering, stress dosing and patient education.'), ('2021 international Cushing disease consensus','Updated diagnosis, MRI/IPSS use, surgery, medical therapies, recurrence surveillance and multidisciplinary management.'), ('2023 ESE adrenal incidentaloma guideline','Relevant when an adrenal lesion is found during ACTH-independent hypercortisolism work-up; includes imaging and hormonal evaluation principles.'), ('2016 Endocrine Society primary AI guideline','Still a core reference for confirmed primary adrenal insufficiency, replacement and prevention/management of adrenal crisis.')] for i,(h,b) in enumerate(items): y=1.42+i*1.27; col=[TEAL,BLUE,ORANGE,GOLD][i];rect(s,.8,y,2.65,.78,col);tx(s,.98,y+.15,2.28,.4,h,14,WHITE,True,PP_ALIGN.CENTER);rect(s,3.68,y,8.75,.78,PALE);tx(s,3.94,y+.12,8.2,.48,b,14,NAVY) tx(s,.9,6.58,11.5,.25,'Practical emphasis: glucocorticoid-induced AI is common and must be included whenever assessing crisis risk or planning steroid withdrawal.',12,RED,True,PP_ALIGN.CENTER) footer(s,18) # references new s=prs.slides.add_slide(blank);s.background.fill.solid();s.background.fill.fore_color.rgb=WHITE title(s,'Key endocrine guidelines and references','Use the original paper or current local protocol at the bedside.') refs=[ 'Beuschlein F, Else T, Bancos I, et al. European Society of Endocrinology and Endocrine Society Joint Clinical Guideline: Diagnosis and Therapy of Glucocorticoid-induced Adrenal Insufficiency. J Clin Endocrinol Metab. 2024;109:1657-1683. doi:10.1210/clinem/dgae250. PMID: 38724043.', 'Fleseriu M, Auchus R, Bancos I, et al. Consensus on diagnosis and management of Cushing\'s disease: a guideline update. Lancet Diabetes Endocrinol. 2021;9:847-875. doi:10.1016/S2213-8587(21)00235-7. PMID: 34687601.', 'Bornstein SR, Allolio B, Arlt W, et al. Diagnosis and Treatment of Primary Adrenal Insufficiency: An Endocrine Society Clinical Practice Guideline. J Clin Endocrinol Metab. 2016;101:364-389. doi:10.1210/jc.2015-1710.', 'Nieman LK, Biller BMK, Findling JW, et al. Treatment of Cushing\'s Syndrome: An Endocrine Society Clinical Practice Guideline. J Clin Endocrinol Metab. 2015;100:2807-2831. doi:10.1210/jc.2015-1818.', 'Fassnacht M, Tsagarakis S, Terzolo M, et al. ESE clinical practice guideline on adrenal incidentalomas. Eur J Endocrinol. 2023;189:G1-G42. doi:10.1093/ejendo/lvad066. PMID: 37318239.', 'Araujo Castro M, Currás Freixes M, de Miguel Novoa P, et al. SEEN guidelines for management and prevention of acute adrenal insufficiency. Endocrinol Diabetes Nutr. 2020;67:82-89. doi:10.1016/j.endinu.2019.01.004. PMID: 31003863.' ] bullets(s,.84,1.4,11.7,5.55,refs,12) footer(s,19) # Update existing slide 17 with a small note to direct to new slide for sh in prs.slides[16].shapes: if hasattr(sh,'text') and sh.text.strip()=='Selected references': sh.text_frame.paragraphs[0].text='Selected textbooks and core sources' p0=sh.text_frame.paragraphs[0];p0.font.name='Aptos';p0.font.size=Pt(27);p0.font.bold=True;p0.font.color.rgb=NAVY # save prs.save(p) print('saved',p,'slides',len(prs.slides)) PY python - <<'PY' from pptx import Presentation import zipfile, os p='/tmp/workspace/adrenal_registrar_ppt/output/Adrenal_Physiology_Cushing_Addison_Registrar.pptx' with zipfile.ZipFile(p) as z: print('zip=',z.testzip()) prs=Presentation(p); print('slides=',len(prs.slides)) for n in [17,18,19]: print(n, ' | '.join(sh.text.replace('\n',' ')[:150] for sh in prs.slides[n-1].shapes if hasattr(sh,'text') and sh.text.strip())[:450]) print('bytes=',os.path.getsize(p)) PY
Adrenal Physiology Cushing Addison Registrar
Presentation · PPTX