Deaths Postgraduate PowerPoint presentation on calcium and phosphate metabolism along with hyper- hypo- and pseudo parathyroidism for postgraduate internal medicine students
2025 guideline hypoparathyroidism hyperparathyroidism calcium phosphate metabolism international guideline
hyperparathyroidism AND hypoparathyroidism
parathyroid hormone regulation of calcium and phosphate metabolism diagram
subperiosteal bone resorption primary hyperparathyroidism hand radiograph

This hand radiograph demonstrates classic skeletal manifestations of secondary hyperparathyroidism. Key diagnostic findings include significant subperiosteal bone resorption localized to the radial aspects of the middle phalanges, characterized by a 'lace-like' appearance and loss of cortical definition. In the fifth metacarpal, there is a prominent brown tumor appearing as a cystic, expansible, well-defined osteolytic lesion. This lesion thins and expands the surrounding cortex without frank penetration or a periosteal reaction. Additional features visible include acroosteolysis (resorption of the distal tufts) and generalized osteopenia. These findings are pathognomonic for high bone turnover states associated with chronic renal failure or primary hyperparathyroidism. The image serves as a high-level educational example of renal osteodystrophy and the progression of metabolic bone disease in clinical practice.

This diagnostic image is a close-up radiograph (X-ray) of the second and third fingers, demonstrating classic skeletal manifestations of hyperparathyroidism. Key pathological features are identified with anatomical precision. Subperiosteal resorption is prominently visible along the radial aspects of the middle phalanges (indicated by white arrows), characterized by a thinned, feathery, and irregular lace-like cortical margin. Additionally, the distal phalangeal tufts show signs of acroosteolysis (indicated by red arrows), where the normally smooth bone appears blunted, frayed, and resorbed. These osseous changes are pathognomonic findings often associated with primary hyperparathyroidism or renal osteodystrophy. The image serves as an educational tool for identifying metabolic bone disease, highlighting the importance of hand radiographs in detecting early osteoclastic activity and cortical bone destruction.
Albright hereditary osteodystrophy pseudohypoparathyroidism clinical features image

This composite clinical photograph presents a frontal full-body view and a lateral head profile of an adult male exhibiting classic features of Albright Hereditary Osteodystrophy (AHO). The frontal image demonstrates short stature and a stocky habitus with relatively proportional limbs. Key facial and cervical features include a noticeably rounded 'moon-shaped' face and a shortened neck. The lateral profile reveals mandibular protrusion (prognathism) and a slightly receding hairline. These visual findings are pathognomonic clinical markers often associated with pseudohypoparathyroidism or pseudopseudohypoparathyroidism. The images serve as an educational resource for identifying the phenotypic manifestations of GNAS gene mutations, emphasizing the importance of physical examination in endocrine and genetic diagnostic pathways.

Clinical photograph showing a dorsal view of bilateral human feet demonstrating brachymetatarasia. The most prominent finding is the symmetric shortening of the fourth metatarsals, resulting in the fourth toes appearing proximally displaced relative to the standard metatarsal arch. Additional skeletal and integumentary features include dystrophic and thickened toenails (onychodytrophy) and areas of hyperpigmentation and skin thickening consistent with healed psoriatic plaques. These findings are clinically significant as phenotypic markers often associated with Albright hereditary osteodystrophy (AHO), pseudohypoparathyroidism, or pseudopseudohypoparathyroidism. The image serves as a diagnostic educational resource for identifying specific digital malformations and their associated cutaneous manifestations in the context of metabolic or genetic bone disorders.

Clinical photograph (black and white) showing the frontal view of a young male patient's face, neck, and upper torso. The image demonstrates characteristic dysmorphic features including a round facies, broad forehead, and a short neck. The torso shows mild central adiposity and several small, scattered hyperpigmented skin lesions across the upper chest and shoulders. The skin appears otherwise smooth with no evidence of the previously reported erythematous scaly plaques, indicating clinical remission following treatment with calcium and vitamin D supplements. This visual presentation is consistent with the phenotype of Albright hereditary osteodystrophy (AHO), often associated with pseudohypoparathyroidism, where skin manifestations such as psoriasis-like lesions can occur due to hypocalcemia and resolve upon metabolic correction.
~/
mkdir -p "/tmp/workspace/calcium-phosphate-ppt/src" "/tmp/workspace/calcium-phosphate-ppt/assets" "/tmp/workspace/calcium-phosphate-ppt/output" && python "/tmp/skills/shared/scripts/fetch_images.py" "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_24dd525f4f641e34f1bc2aeb180ff27489b5efa62485dc43b5a55806e2c4f4c0.jpg" "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_2cf4deb68ecf110eacb305465055e712dd9e30e19f5d1fccb577abf61289bf4f.jpg" > "/tmp/workspace/calcium-phosphate-ppt/assets/image_data.json"
python - <<'PY' import json,base64,os p='/tmp/workspace/calcium-phosphate-ppt/assets/image_data.json' d=json.load(open(p)) for i,x in enumerate(d): if x.get('base64'): mime,b64=x['base64'].split(',',1) ext='.jpg' if 'jpeg' in mime else '.png' open(f'/tmp/workspace/calcium-phosphate-ppt/assets/img{i}{ext}','wb').write(base64.b64decode(b64)) print(i,ext,len(base64.b64decode(b64))) PY
cat > "/tmp/workspace/calcium-phosphate-ppt/src/create_deck.py" <<'PY' from pptx import Presentation from pptx.util import Inches, Pt from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR from pptx.dml.color import RGBColor from pptx.enum.dml import MSO_THEME_COLOR from pptx.enum.text import MSO_AUTO_SIZE from pptx.enum.shapes import MSO_AUTO_SHAPE_TYPE from pptx.enum.dml import MSO_LINE_DASH_STYLE from pptx import Presentation from pptx.util import Inches, Pt from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.enum.shapes import MSO_SHAPE from pathlib import Path OUT=Path('/tmp/workspace/calcium-phosphate-ppt/output/Calcium_Phosphate_Parathyroid_Disorders_PGIM.pptx') AS=Path('/tmp/workspace/calcium-phosphate-ppt/assets') prs=Presentation(); prs.slide_width=Inches(13.333); prs.slide_height=Inches(7.5) blank=prs.slide_layouts[6] # palette NAVY=RGBColor(16,40,65); TEAL=RGBColor(16,126,133); CYAN=RGBColor(84,204,214); GOLD=RGBColor(234,181,64); RED=RGBColor(198,70,69); GREEN=RGBColor(65,142,106); INK=RGBColor(30,42,53); MID=RGBColor(88,105,119); PALE=RGBColor(241,246,248); WHITE=RGBColor(255,255,255); LGRAY=RGBColor(220,229,234); PURPLE=RGBColor(107,78,142) def rect(sl,x,y,w,h,fill, line=None, radius=False): sh=sl.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE if radius 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(sl,txt,x,y,w,h,size=18,color=INK,bold=False,align=PP_ALIGN.LEFT, valign=MSO_ANCHOR.TOP, font='Aptos', margin=0.05): tb=sl.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); tf.vertical_anchor=valign for i,line in enumerate(txt.split('\n')): p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=line; p.alignment=align p.space_after=Pt(4) for r in p.runs: r.font.name=font; r.font.size=Pt(size); r.font.bold=bold; r.font.color.rgb=color return tb def rich(sl, lines, x,y,w,h, size=17): tb=sl.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(.10); tf.margin_top=Inches(.08); tf.margin_bottom=Inches(.04) for i,(s,col,b) in enumerate(lines): p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=s; p.space_after=Pt(8) for r in p.runs: r.font.name='Aptos'; r.font.size=Pt(size); r.font.color.rgb=col; r.font.bold=b return tb def base(title, section='', n=None): sl=prs.slides.add_slide(blank); rect(sl,0,0,13.333,7.5,WHITE) rect(sl,0,0,13.333,.18,TEAL) text(sl,title,.55,.38,11.9,.48,26,NAVY,True) if section: text(sl,section,.57,.92,8,.24,10,TEAL,True) if n is not None: text(sl,f'{n:02d}',12.35,.43,.42,.28,11,TEAL,True,PP_ALIGN.RIGHT) rect(sl,.55,7.1,12.22,.02,LGRAY) text(sl,'Postgraduate Internal Medicine | Calcium, phosphate and parathyroid disorders',.55,7.16,7,.18,8,MID) return sl def bullet_panel(sl, title, bullets, x,y,w,h, accent=TEAL, fs=16): rect(sl,x,y,w,h,PALE,accent,True); rect(sl,x,y,w,.10,accent) text(sl,title,x+.2,y+.18,w-.4,.30,15,accent,True) lines=[] for b in bullets: lines.append(('• '+b,INK,False)) rich(sl,lines,x+.15,y+.58,w-.3,h-.65,fs) def arrow(sl,x1,y1,x2,y2,color=TEAL): ln=sl.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Inches(x1), Inches(y1), Inches(x2), Inches(y2)); ln.line.color.rgb=color; ln.line.width=Pt(2); ln.line.end_arrowhead=True def table(sl, cols, rows, x,y,w,h, widths=None, fs=13): n=len(cols); widths=widths or [1/n]*n rowh=h/(len(rows)+1); xx=x for j,c in enumerate(cols): cw=w*widths[j]; rect(sl,xx,y,cw,rowh,NAVY,WHITE); text(sl,c,xx+.06,y+.05,cw-.12,rowh-.1,fs,WHITE,True,PP_ALIGN.CENTER,MSO_ANCHOR.MIDDLE); xx+=cw for i,row in enumerate(rows): xx=x; bg=PALE if i%2==0 else WHITE for j,val in enumerate(row): cw=w*widths[j]; rect(sl,xx,y+(i+1)*rowh,cw,rowh,bg,LGRAY); text(sl,str(val),xx+.07,y+(i+1)*rowh+.05,cw-.14,rowh-.1,fs,INK,False,PP_ALIGN.CENTER,MSO_ANCHOR.MIDDLE); xx+=cw def tag(sl,label,x,y,w,color): rect(sl,x,y,w,.32,color,color,True); text(sl,label,x,y+.035,w,.2,10,WHITE,True,PP_ALIGN.CENTER) # 1 sl=prs.slides.add_slide(blank); rect(sl,0,0,13.333,7.5,NAVY); rect(sl,0,0,13.333,.18,CYAN); rect(sl,8.8,0,4.533,7.5,TEAL) text(sl,'Calcium & Phosphate\nMetabolism',.7,1.05,7.7,1.25,33,WHITE,True) text(sl,'Hyperparathyroidism, hypoparathyroidism\nand pseudohypoparathyroidism',.72,2.55,7.5,.78,21,RGBColor(218,234,238)) text(sl,'Postgraduate Internal Medicine\nCase-based diagnostic and management approach',.72,4.95,5.3,.6,15,CYAN,True) # visual molecule circles for x,y,r,c,t in [(9.55,1.4,.85,GOLD,'Ca'),(11.1,2.55,.66,CYAN,'PO₄'),(9.55,3.85,.63,WHITE,'PTH'),(11.35,4.45,.45,GOLD,'D')]: sh=sl.shapes.add_shape(MSO_SHAPE.OVAL,Inches(x),Inches(y),Inches(r),Inches(r)); sh.fill.solid(); sh.fill.fore_color.rgb=c; sh.line.color.rgb=c; text(sl,t,x,y+r*.32,r,r*.25,15,NAVY,True,PP_ALIGN.CENTER) arrow(sl,10.25,2.2,11.15,2.6,CYAN); arrow(sl,10.12,3.55,9.88,3.9,CYAN); arrow(sl,10.35,4.1,11.4,4.55,CYAN) text(sl,'Teaching deck | September 2026',.72,6.95,4,.2,9,RGBColor(180,205,211)) #2 sl=base('Learning objectives','FOUNDATIONS',2) bullet_panel(sl,'By the end, learners should be able to',[ 'Interpret calcium, phosphate, magnesium, PTH, 25-hydroxyvitamin D and renal function as a physiologic set.', 'Distinguish PTH-dependent from PTH-independent hypercalcemia and identify primary, secondary and tertiary hyperparathyroidism.', 'Recognize acute and chronic hypoparathyroidism, including emergency hypocalcemia.', 'Diagnose PTH resistance and separate pseudohypoparathyroidism from pseudopseudohypoparathyroidism.', 'Plan initial treatment, monitoring and indications for referral or surgery.' ],.7,1.35,11.9,4.85,TEAL,18) tag(sl,'Physiology',.9,6.45,1.2,TEAL); tag(sl,'Pattern recognition',2.25,6.45,1.8,PURPLE); tag(sl,'Acute care',4.2,6.45,1.4,RED); tag(sl,'Long-term care',5.75,6.45,1.7,GREEN) #3 sl=base('The regulated system: what is being sensed?','FOUNDATIONS',3) # central rect(sl,5.0,2.5,3.25,1.15,NAVY,NAVY,True); text(sl,'Ionized Ca²⁺\nbiologically active fraction',5.2,2.72,2.85,.62,19,WHITE,True,PP_ALIGN.CENTER) for x,y,w,h,title,body,c in [(.7,1.25,3.15,1.15,'PARATHYROID','CaSR senses ↓Ca²⁺ → ↑PTH',TEAL),(.7,4.45,3.15,1.15,'BONE','Rapid Ca efflux\n+ remodeling',GOLD),(9.25,1.25,3.25,1.15,'KIDNEY','Ca reabsorption ↑\nphosphate excretion ↑',PURPLE),(9.25,4.45,3.25,1.15,'GUT','Calcitriol increases\nCa and phosphate uptake',GREEN)]: rect(sl,x,y,w,h,PALE,c,True); text(sl,title,x+.15,y+.15,w-.3,.25,13,c,True); text(sl,body,x+.15,y+.48,w-.3,.48,15,INK) arrow(sl,x+w/2 if x<5 else 8.25,y+h/2,5 if x<5 else 8.25,3.05,c) text(sl,'Key principle: serum calcium is defended tightly; phosphate balance is largely renal and FGF23-mediated.',.78,6.25,11.7,.4,17,NAVY,True,PP_ALIGN.CENTER) #4 sl=base('Calcium and phosphate: measurement before meaning','FOUNDATIONS',4) table(sl,['Analyte','Clinical interpretation','Common trap'],[ ['Total calcium','Albumin-bound + complexed + ionized','Hypoalbuminemia creates pseudohypocalcemia'], ['Ionized calcium','Preferred in critical illness, acid-base shifts, transfusion','Preanalytical pH/handling error'], ['Phosphate','Diurnal, diet and renal clearance dependent','A single value is rarely diagnostic'], ['Magnesium','Required for PTH secretion and target-organ action','“Refractory” hypocalcemia until Mg corrected'], ['PTH (intact)','Interpret relative to calcium, not lab range alone','Normal PTH can be inappropriate in hypercalcemia'] ],.55,1.35,12.2,4.6,[.18,.42,.40],14) rect(sl,.8,6.22,11.7,.48,RGBColor(255,248,224),GOLD,True); text(sl,'Albumin correction is an estimate: Ca corrected (mg/dL) ≈ measured Ca + 0.8 × (4.0 − albumin g/dL). Use ionized calcium when accuracy matters.',1.0,6.34,11.3,.18,13,INK,False,PP_ALIGN.CENTER) #5 sl=base('Hormonal map: direction matters','FOUNDATIONS',5) table(sl,['Hormone','Serum Ca²⁺','Serum phosphate','Renal action','Net purpose'],[ ['PTH','↑','↓','↑ distal Ca reabsorption; ↓ proximal phosphate reabsorption; ↑ 1α-hydroxylase','Restore extracellular Ca²⁺'], ['Calcitriol','↑','↑','↑ intestinal absorption of Ca and phosphate','Provide mineral substrate'], ['FGF23','↔ / slight ↓','↓','Phosphaturia; ↓ 1α-hydroxylase; ↑ calcitriol catabolism','Limit phosphate load'], ['Calcitonin','minor ↓','minor ↓','Modest antiresorptive effects','Limited adult role'] ],.55,1.35,12.2,4.3,[.18,.14,.16,.33,.19],14) rect(sl,.8,5.95,11.7,.62,PALE,TEAL,True); text(sl,'PTH raises calcium but lowers phosphate. The “high PTH + high phosphate” pattern signals renal failure or PTH resistance, not normal PTH action.',1.05,6.15,11.2,.2,15,NAVY,True,PP_ALIGN.CENTER) #6 sl=base('Approach to hypercalcemia: first split by PTH','DIAGNOSTIC FRAMEWORK',6) rect(sl,4.65,1.25,4.0,.7,NAVY,NAVY,True); text(sl,'Confirmed hypercalcemia\n(repeat ± ionized Ca²⁺)',4.8,1.42,3.7,.35,18,WHITE,True,PP_ALIGN.CENTER) arrow(sl,6.65,1.95,6.65,2.45) rect(sl,.8,2.55,5.25,.75,PALE,TEAL,True); text(sl,'PTH elevated or inappropriately normal',1.0,2.79,4.85,.22,17,TEAL,True,PP_ALIGN.CENTER) rect(sl,7.25,2.55,5.25,.75,PALE,RED,True); text(sl,'PTH suppressed',7.45,2.79,4.85,.22,17,RED,True,PP_ALIGN.CENTER) arrow(sl,3.45,3.3,3.45,3.7,TEAL);arrow(sl,9.85,3.3,9.85,3.7,RED) bullet_panel(sl,'PTH-dependent', ['Primary hyperparathyroidism','Tertiary hyperparathyroidism','Familial hypocalciuric hypercalcemia (FHH)','Lithium-associated altered CaSR set point'],.7,3.75,5.5,2.35,TEAL,16) bullet_panel(sl,'PTH-independent', ['Malignancy: PTHrP, osteolysis, calcitriol','Vitamin D excess or granulomatous calcitriol excess','Drugs: thiazides, vitamin A; endocrine causes','Immobilization, milk-alkali syndrome'],7.15,3.75,5.5,2.35,RED,16) text(sl,'Do not localize the parathyroid before establishing a biochemical diagnosis.',1.2,6.45,10.9,.25,15,NAVY,True,PP_ALIGN.CENTER) #7 sl=base('Primary hyperparathyroidism (PHPT)','HYPERPARATHYROIDISM',7) bullet_panel(sl,'Biochemical diagnosis', ['Hypercalcemia with elevated or inappropriately normal PTH.','Check phosphate (often low), creatinine/eGFR, 25(OH)D, urine calcium, DXA and renal imaging as indicated.','Normocalcemic PHPT is a diagnosis of exclusion: repeatedly normal Ca after excluding secondary causes.'],.65,1.25,5.85,2.55,TEAL,15) bullet_panel(sl,'Etiology & phenotype', ['Single adenoma is most common; multigland disease and hereditary syndromes are less common.','May be symptomatic: stones, skeletal disease, neurocognitive or GI features; many are found incidentally.','Severe hypercalcemia or neck mass raises concern for carcinoma, rare.'],6.83,1.25,5.85,2.55,PURPLE,15) bullet_panel(sl,'Assess end organs', ['Kidney: eGFR, nephrolithiasis/nephrocalcinosis, 24-hour urine calcium.','Skeleton: DXA includes distal 1/3 radius; vertebral fracture assessment if indicated.','Correct vitamin D insufficiency cautiously and assess hereditary risk in young/multigland disease.'],.65,4.15,12.03,1.85,GOLD,16) text(sl,'Imaging (ultrasound, sestamibi, 4D-CT) is for operative planning, not diagnosis.',.9,6.35,11.5,.3,15,RED,True,PP_ALIGN.CENTER) #8 sl=base('PHPT vs FHH: prevent an unnecessary operation','HYPERPARATHYROIDISM',8) table(sl,['Feature','Primary HPT','Familial hypocalciuric hypercalcemia'],[ ['Calcium','Often clearly elevated; variable','Mild, lifelong, usually stable'], ['PTH','High or inappropriately normal','Normal or mildly high'], ['Urine calcium','Usually normal/high','Low'], ['CCCR*','Typically >0.02','Often <0.01'], ['Mechanism','Autonomous parathyroid secretion','Loss-of-function CaSR pathway, altered set point'], ['Action','Consider parathyroidectomy if criteria met','Avoid surgery; consider genetic testing'] ],.5,1.35,12.35,4.5,[.20,.39,.41],14) rect(sl,.8,6.05,11.7,.62,RGBColor(255,248,224),GOLD,True); text(sl,'*CCCR = urinary calcium clearance / creatinine clearance. Interpret cautiously: vitamin D deficiency, CKD, low calcium intake, thiazides and lithium can lower urine calcium.',1.05,6.18,11.2,.28,13,INK,False,PP_ALIGN.CENTER) #9 sl=base('PHPT management: who needs parathyroidectomy?','HYPERPARATHYROIDISM',9) rect(sl,.62,1.25,12.1,.55,NAVY,NAVY,True); text(sl,'Parathyroidectomy is definitive. Offer for symptomatic disease, and recommend for asymptomatic PHPT when any guideline criterion is met.',.85,1.42,11.6,.2,16,WHITE,True,PP_ALIGN.CENTER) table(sl,['Domain','Typical operative trigger in asymptomatic PHPT'],[ ['Serum calcium','>1.0 mg/dL (0.25 mmol/L) above upper limit of normal'], ['Skeletal','T-score ≤ −2.5 at any site or vertebral fracture'], ['Renal','eGFR/creatinine clearance <60 mL/min, nephrolithiasis/nephrocalcinosis, or hypercalciuria with stone risk'], ['Age','<50 years'], ['Patient choice','Appropriate even without a criterion if no contraindication and patient prefers definitive therapy'] ],.65,2.05,12.0,3.75,[.22,.78],15) text(sl,'If observed: annual Ca and renal function; periodic DXA. Maintain hydration, normal dietary calcium, vitamin D repletion; avoid unnecessary thiazide/lithium exposure.',.85,6.2,11.5,.45,15,NAVY,True,PP_ALIGN.CENTER) #10 sl=base('Secondary and tertiary hyperparathyroidism','HYPERPARATHYROIDISM',10) table(sl,['','Secondary HPT','Tertiary HPT'],[ ['Driver','Chronic low effective Ca or calcitriol: CKD, vitamin D deficiency, malabsorption','Long-standing secondary HPT becomes partially autonomous, usually advanced CKD/transplant setting'], ['Calcium','Low or normal (may be normal in CKD)','High'], ['Phosphate','Low in vitamin D deficiency; high in CKD','Often high with severe CKD, may fall post-transplant'], ['PTH','Elevated, appropriate response','Markedly elevated, autonomous'], ['Core strategy','Treat driver: vitamin D, calcium balance, CKD-MBD management','Specialist management; calcimimetic or parathyroidectomy in selected patients'] ],.55,1.3,12.2,4.55,[.16,.42,.42],14) rect(sl,.85,6.12,11.55,.48,PALE,PURPLE,True); text(sl,'CKD sequence: ↓GFR → phosphate retention + ↑FGF23 → ↓calcitriol → ↓Ca²⁺ / loss of PTH restraint → parathyroid hyperplasia.',1.05,6.25,11.15,.18,14,NAVY,True,PP_ALIGN.CENTER) #11 sl=base('Hypercalcemic crisis: stabilization comes first','ACUTE CARE',11) for x,title,body,c in [(.6,'1. Assess severity','Mental status, ECG, volume status, renal failure; confirm ionized Ca²⁺.',RED),(3.8,'2. Restore volume','Isotonic saline if volume depleted. Tailor to heart failure/CKD.',TEAL),(7.0,'3. Lower Ca²⁺','Calcitonin for rapid bridge; IV bisphosphonate for durable effect. Denosumab when bisphosphonate unsuitable.',PURPLE),(10.2,'4. Treat mechanism','Glucocorticoid for calcitriol-mediated disease; cinacalcet in selected PTH-mediated disease; dialysis if refractory/severe renal failure.',GOLD)]: rect(sl,x,1.65,2.55,3.8,PALE,c,True); text(sl,title,x+.17,1.93,2.2,.55,17,c,True,PP_ALIGN.CENTER); text(sl,body,x+.2,2.85,2.15,1.85,15,INK,False,PP_ALIGN.CENTER) text(sl,'Loop diuretics are not routine calcium therapy. Use only for volume overload after adequate repletion.',1.0,6.02,11.3,.28,16,RED,True,PP_ALIGN.CENTER) text(sl,'Severe symptoms, arrhythmia, encephalopathy or Ca ≥14 mg/dL (≥3.5 mmol/L) merit urgent monitored care and etiologic work-up.',.85,6.45,11.65,.22,13,MID,False,PP_ALIGN.CENTER) #12 sl=base('Hypocalcemia: confirm, characterize, correct','HYPOPARATHYROIDISM',12) rect(sl,.7,1.25,3.55,4.95,PALE,TEAL,True); text(sl,'Step 1\nConfirm',.95,1.55,3.05,.5,19,TEAL,True,PP_ALIGN.CENTER); rich(sl,[('• Ionized Ca²⁺ if critical illness, acid-base disturbance or low albumin.',INK,False),('• ECG: QT prolongation?',INK,False),('• Assess symptoms: paresthesia, tetany, seizure, laryngospasm.',INK,False)],.95,2.35,3.05,2.7,16) rect(sl,4.9,1.25,3.55,4.95,PALE,PURPLE,True); text(sl,'Step 2\nClassify by PTH',5.15,1.55,3.05,.5,19,PURPLE,True,PP_ALIGN.CENTER); rich(sl,[('• Low/inappropriately normal PTH: hypoparathyroidism, severe hypomagnesemia, CaSR activation.',INK,False),('• High PTH: vitamin D deficiency, CKD, malabsorption, resistance, phosphate load.',INK,False)],5.15,2.35,3.05,2.7,16) rect(sl,9.1,1.25,3.55,4.95,PALE,RED,True); text(sl,'Step 3\nFind modifiers',9.35,1.55,3.05,.5,19,RED,True,PP_ALIGN.CENTER); rich(sl,[('• Magnesium, phosphate, creatinine/eGFR, 25(OH)D.',INK,False),('• Recent neck surgery or transfusion?',INK,False),('• Drugs: bisphosphonate, denosumab, calcimimetic, anticonvulsant?',INK,False)],9.35,2.35,3.05,2.7,16) text(sl,'A “normal” PTH is abnormal in true hypocalcemia: it should be high.',1.05,6.45,11.2,.25,17,NAVY,True,PP_ALIGN.CENTER) #13 sl=base('Hypoparathyroidism: causes and biochemical signature','HYPOPARATHYROIDISM',13) bullet_panel(sl,'Major causes', ['Postoperative: most common adult cause.','Autoimmune: isolated or autoimmune polyglandular syndrome.','Genetic/developmental: DiGeorge spectrum, PTH/GCM2 defects, syndromic disease.','Infiltrative/radiation: iron overload, Wilson disease, metastatic or granulomatous disease.','Functional: severe hypo- or hypermagnesemia; activating CaSR/GNA11 variants.'],.65,1.3,5.8,4.85,TEAL,16) rect(sl,6.95,1.3,5.7,4.85,PALE,PURPLE,True); text(sl,'Typical profile',7.15,1.58,5.3,.3,18,PURPLE,True,PP_ALIGN.CENTER) table(sl,['Test','Expected'],[['Ca²⁺','Low'],['PTH','Low or inappropriately normal'],['Phosphate','High'],['1,25(OH)₂D','Low / inappropriately low'],['Urinary Ca','May be high on treatment: absent PTH reduces renal Ca reabsorption']],7.3,2.15,5.0,2.8,[.42,.58],14) text(sl,'Hypomagnesemia both impairs PTH secretion and causes peripheral PTH resistance.',7.25,5.25,5.1,.35,15,RED,True,PP_ALIGN.CENTER) #14 sl=base('Acute symptomatic hypocalcemia','ACUTE CARE',14) rect(sl,.65,1.18,12.05,.65,RGBColor(254,236,236),RED,True); text(sl,'Emergency features: seizure, laryngospasm, bronchospasm, arrhythmia, severe tetany, altered consciousness or marked QT prolongation',.85,1.4,11.65,.2,15,RED,True,PP_ALIGN.CENTER) for x,title,body,c in [(.7,'Immediate','Cardiac monitoring. IV calcium gluconate administered slowly; repeat or infuse based on symptoms and ionized calcium.',RED),(4.9,'Correct the blocker','Measure and replete magnesium. Address alkalosis, hyperphosphatemia, pancreatitis, tumor lysis or drug trigger.',GOLD),(9.1,'Bridge to maintenance','Start oral calcium plus active vitamin D when chronic hypoparathyroidism is likely; reassess frequently.',TEAL)]: rect(sl,x,2.25,3.55,2.9,PALE,c,True); text(sl,title,x+.2,2.55,3.15,.35,19,c,True,PP_ALIGN.CENTER); text(sl,body,x+.26,3.18,3.03,1.35,15,INK,False,PP_ALIGN.CENTER) text(sl,'Avoid mixing calcium with bicarbonate or phosphate in the same IV line. Dose protocols and infusion rate require local policy and monitored care.',1.0,5.75,11.4,.48,14,NAVY,True,PP_ALIGN.CENTER) #15 sl=base('Chronic hypoparathyroidism: treatment targets','HYPOPARATHYROIDISM',15) table(sl,['Goal','Practical approach'],[ ['Relieve symptoms without overshoot','Oral calcium plus active vitamin D (calcitriol or alfacalcidol); individualize.'], ['Serum calcium','Aim lower part of reference range or slightly below, if asymptomatic.'], ['Phosphate and Ca×P','Avoid hyperphosphatemia; calcium with meals may reduce phosphate absorption; dietary measures if needed.'], ['Urinary calcium','Aim normal 24-hour urinary calcium; low-sodium diet and thiazide may help hypercalciuria.'], ['Magnesium, renal health','Maintain normal Mg; monitor creatinine/eGFR, urine calcium and renal imaging when indicated.'], ['Refractory disease','Consider PTH replacement therapy where approved/available through an endocrinologist.'] ],.55,1.25,12.2,4.95,[.28,.72],15) text(sl,'Do not chase a high-normal calcium: conventional therapy can cause hypercalciuria, nephrolithiasis and nephrocalcinosis.',.9,6.4,11.6,.25,15,RED,True,PP_ALIGN.CENTER) #16 sl=base('Pseudohypoparathyroidism: PTH resistance','PTH RESISTANCE',16) rect(sl,.75,1.25,4.0,4.8,PALE,PURPLE,True); text(sl,'Definition',.95,1.55,3.6,.3,19,PURPLE,True,PP_ALIGN.CENTER); rich(sl,[('Target-organ resistance to PTH, primarily renal proximal tubule.',INK,False),('Biochemistry: hypocalcemia + hyperphosphatemia + elevated PTH.',INK,False),('PTH cannot generate normal phosphaturia and calcitriol response.',INK,False)],.95,2.25,3.6,2.5,16) rect(sl,4.98,1.25,3.35,4.8,PALE,TEAL,True); text(sl,'Molecular logic',5.18,1.55,2.95,.3,19,TEAL,True,PP_ALIGN.CENTER); rich(sl,[('GNAS / Gsα signaling defects or methylation defects.',INK,False),('Renal paternal Gsα silencing explains maternal inheritance of PTH resistance in PHP1A/1B.',INK,False)],5.18,2.25,2.95,2.5,16) rect(sl,8.57,1.25,4.0,4.8,PALE,GOLD,True); text(sl,'Clinical implications',8.77,1.55,3.6,.3,19,GOLD,True,PP_ALIGN.CENTER); rich(sl,[('May have resistance to TSH, gonadotropins or GHRH, depending on subtype.',INK,False),('Albright hereditary osteodystrophy (AHO) phenotype may coexist.',INK,False),('Treat biochemical consequences and screen associated hormone resistance.',INK,False)],8.77,2.25,3.6,2.5,16) text(sl,'Modern nomenclature often uses “inactivating PTH/PTHrP signaling disorders” (iPPSD), but PHP remains clinically useful.',.85,6.35,11.6,.28,14,NAVY,True,PP_ALIGN.CENTER) #17 sl=base('PHP subtypes and pseudopseudohypoparathyroidism','PTH RESISTANCE',17) table(sl,['Entity','PTH resistance','AHO phenotype','Other hormone resistance','Core clue'],[ ['PHP1A','Yes','Usually yes','Often yes','Maternal GNAS inactivation; ↓ urinary cAMP response'], ['PHP1B','Yes','Less frequent/milder','Sometimes','GNAS methylation defect; renal predominant'], ['PHP2','Yes','No','No','cAMP response preserved but phosphaturic response impaired'], ['PPHP','No','Yes','No','Paternal GNAS inactivation: phenotype without biochemical PTH resistance'] ],.45,1.25,12.45,4.45,[.17,.17,.18,.23,.25],13) rect(sl,.8,6.05,11.7,.52,PALE,TEAL,True); text(sl,'AHO: short stature, round facies, obesity tendency, brachydactyly and subcutaneous ossification. Diagnose phenotype plus biochemistry, then obtain expert genetic evaluation.',1.0,6.2,11.3,.18,14,NAVY,True,PP_ALIGN.CENTER) #18 image sl=base('Imaging clue: hyperparathyroid bone disease','HYPERPARATHYROIDISM',18) img=str(AS/'img0.jpg'); sl.shapes.add_picture(img,Inches(.75),Inches(1.28),width=Inches(5.35),height=Inches(4.75)) rect(sl,6.5,1.28,5.95,4.75,PALE,GOLD,True); text(sl,'Hand radiograph',6.78,1.6,5.35,.35,20,GOLD,True,PP_ALIGN.CENTER) rich(sl,[('Look for:',NAVY,True),('• Subperiosteal resorption along radial middle phalanges',INK,False),('• Acroosteolysis of distal tufts',INK,False),('• Generalized osteopenia; brown tumors in severe disease',INK,False),('Interpretation:',NAVY,True),('These features indicate high-turnover bone disease. In practice, distinguish PHPT from renal osteodystrophy by the biochemical and kidney context.',INK,False)],6.82,2.28,5.25,2.95,16) text(sl,'Educational image from indexed medical-image library. This example is classically described in secondary hyperparathyroidism/renal osteodystrophy.',.8,6.35,11.7,.25,11,MID,False,PP_ALIGN.CENTER) #19 image sl=base('Clinical clue: Albright hereditary osteodystrophy','PTH RESISTANCE',19) img=str(AS/'img1.jpg'); sl.shapes.add_picture(img,Inches(.75),Inches(1.2),width=Inches(5.3),height=Inches(4.95)) rect(sl,6.5,1.2,5.95,4.95,PALE,PURPLE,True); text(sl,'Phenotype is not the diagnosis',6.75,1.55,5.45,.35,20,PURPLE,True,PP_ALIGN.CENTER) rich(sl,[('AHO may include short stature, rounded facies, short neck, brachydactyly and ectopic ossification.',INK,False),('The phenotype occurs in PHP1A and PPHP. The biochemical difference is PTH resistance:',NAVY,True),('PHP: hypocalcemia, hyperphosphatemia, elevated PTH.',RED,True),('PPHP: no PTH resistance, thus normal calcium-phosphate physiology.',TEAL,True)],6.82,2.25,5.25,2.95,16) text(sl,'Educational clinical photograph from indexed medical-image library. Seek consent and use respectful, phenotype-focused language in clinical teaching.',.8,6.35,11.7,.25,11,MID,False,PP_ALIGN.CENTER) #20 cases sl=base('Three rapid-fire cases','INTEGRATION',20) for x,head,dat,q,c in [(.58,'A','Ca 12.2 mg/dL\nPTH 118 pg/mL\nPhosphate low','PTH-dependent hypercalcemia: PHPT until proven otherwise.',TEAL),(4.55,'B','Ca 7.1 mg/dL\nPTH 8 pg/mL\nPhosphate high','Hypoparathyroidism. Ask about neck surgery and magnesium.',RED),(8.52,'C','Ca 7.5 mg/dL\nPTH 240 pg/mL\nPhosphate high\neGFR normal','PTH resistance: evaluate PHP and AHO/associated hormone resistance.',PURPLE)]: rect(sl,x,1.45,3.72,4.65,PALE,c,True); text(sl,head,x+.18,1.7,.45,.45,28,c,True); text(sl,dat,x+.7,1.73,2.75,1.2,18,NAVY,True,PP_ALIGN.CENTER); rect(sl,x+.25,3.35,3.2,.04,c); text(sl,q,x+.3,3.72,3.1,1.45,16,INK,False,PP_ALIGN.CENTER) text(sl,'Pattern pairing: calcium tells you the direction; PTH tells you whether the response is appropriate.',.9,6.5,11.5,.25,16,NAVY,True,PP_ALIGN.CENTER) #21 take home sl=base('Take-home messages','INTEGRATION',21) items=[('1','Interpret PTH in relation to calcium, not in isolation.',TEAL),('2','High calcium + non-suppressed PTH is PTH-dependent until proven otherwise.',PURPLE),('3','Low calcium + low/inappropriate PTH suggests hypoparathyroidism or magnesium-related dysfunction.',RED),('4','Low calcium + high PTH + high phosphate suggests renal failure or PTH resistance.',GOLD),('5','In chronic hypoparathyroidism, target symptom control and kidney safety, not high-normal calcium.',GREEN)] for i,(num,s,c) in enumerate(items): y=1.2+i*1.05; sh=sl.shapes.add_shape(MSO_SHAPE.OVAL,Inches(.9),Inches(y),Inches(.55),Inches(.55));sh.fill.solid();sh.fill.fore_color.rgb=c;sh.line.color.rgb=c;text(sl,num,.9,y+.12,.55,.18,16,WHITE,True,PP_ALIGN.CENTER);text(sl,s,1.75,y+.11,10.2,.28,19,INK,True) #22 refs sl=base('Selected references and guideline anchors','REFERENCES',22) refs=[ 'Harrison’s Principles of Internal Medicine, 22nd ed. 2025. Disorders of calcium and phosphate metabolism; pseudohypoparathyroidism.', 'Bollerslev J, et al. Revised European Society of Endocrinology Clinical Practice Guideline: Treatment of Chronic Hypoparathyroidism in Adults. Eur J Endocrinol. 2025;193:G49-G78. PMID: 41231236.', 'Bilezikian JP, et al. Evaluation and management of primary hyperparathyroidism: Fifth International Workshop guidelines. J Bone Miner Res. 2022;37:2293-2314.', 'KDIGO 2017 Clinical Practice Guideline Update for CKD-MBD. Kidney Int Suppl. 2017;7:1-59.', 'Goldman-Cecil Medicine. Causes of hypocalcemia and hypoparathyroidism (textbook content consulted for this deck).', 'Image slides: indexed educational medical-image library; captions identify hyperparathyroid bone disease and AHO phenotype.' ] rect(sl,.7,1.25,11.95,5.55,PALE,TEAL,True); rich(sl,[(f'{i+1}. {r}',INK,False) for i,r in enumerate(refs)],1.0,1.65,11.35,4.6,15) text(sl,'For bedside decisions, follow local emergency medication protocols and current specialty guidance.',1.1,6.45,11.15,.22,13,RED,True,PP_ALIGN.CENTER) # metadata prs.core_properties.title='Calcium and phosphate metabolism with parathyroid disorders' prs.core_properties.subject='Postgraduate Internal Medicine teaching presentation' prs.core_properties.author='Orris' prs.save(OUT) print(OUT) PY python "/tmp/workspace/calcium-phosphate-ppt/src/create_deck.py"
python - <<'PY' from pptx import Presentation p='/tmp/workspace/calcium-phosphate-ppt/output/Calcium_Phosphate_Parathyroid_Disorders_PGIM.pptx' prs=Presentation(p) print('slides',len(prs.slides)) for i,s in enumerate(prs.slides,1): txt=' | '.join(sh.text.replace('\n',' / ') for sh in s.shapes if getattr(sh,'has_text_frame',False) and sh.text.strip()) print(i, len(txt), txt[:130]) PY python - <<'PY' import zipfile p='/tmp/workspace/calcium-phosphate-ppt/output/Calcium_Phosphate_Parathyroid_Disorders_PGIM.pptx' with zipfile.ZipFile(p) as z: print('zip test',z.testzip(), 'media',len([n for n in z.namelist() if n.startswith('ppt/media/')])) PY
~/calcium-phosphate-ppt/output/
Calcium Phosphate Parathyroid Disorders PGIM
Presentation · PPTX
Turn this into a cartoonist interactive powerpoint case presentation for my YouTube medical channel add some slides on the end for managing hyperparathyroidism
~/
2025 pediatric primary hyperparathyroidism management guideline parathyroidectomy adolescent
pediatric primary hyperparathyroidism management
~/attachments/7d04afb2-3521-47a9-a89d-a7b5249f4a55/
primary hyperparathyroidism parathyroid adenoma sestamibi scan medical illustration
mkdir -p "/tmp/workspace/hpt-case-youtube/src" "/tmp/workspace/hpt-case-youtube/assets" "/tmp/workspace/hpt-case-youtube/output" && python - <<'PY' import pdfplumber p='/tmp/workspace/attachments/7d04afb2-3521-47a9-a89d-a7b5249f4a55/A CASE OF A 13 YEAR OLD WITH BONE PAINS.pdf' with pdfplumber.open(p) as pdf: print('pages',len(pdf.pages)) for i,page in enumerate(pdf.pages): t=page.extract_text() or '' open(f'/tmp/workspace/hpt-case-youtube/assets/page_{i+1}.txt','w').write(t) print('\n---PAGE',i+1,'---\n',t[:8000]) PY
~/hpt-case-youtube/
Cartoon educational scene for a medical case video: a 13-year-old girl with hand discomfort visiting a clinician, subtle bone and calcium-phosphate symbols, friendly clinical setting, no text
python "/tmp/skills/shared/scripts/fetch_images.py" "https://cdn.orris.care/image-gen/e161f10b1b054d9399eee1f9f658a556.png" > "/tmp/workspace/hpt-case-youtube/assets/cartoon.json" && python - <<'PY' import json,base64 x=json.load(open('/tmp/workspace/hpt-case-youtube/assets/cartoon.json'))[0] open('/tmp/workspace/hpt-case-youtube/assets/cartoon.png','wb').write(base64.b64decode(x['base64'].split(',',1)[1])) import pdfplumber p='/tmp/workspace/attachments/7d04afb2-3521-47a9-a89d-a7b5249f4a55/A CASE OF A 13 YEAR OLD WITH BONE PAINS.pdf' with pdfplumber.open(p) as pdf: for i in range(7,14): im=pdf.pages[i].to_image(resolution=110) im.save(f'/tmp/workspace/hpt-case-youtube/assets/case_page_{i+1}.png',format='PNG') PY
python - <<'PY' from PIL import Image from pathlib import Path for p in Path('/tmp/workspace/hpt-case-youtube/assets').glob('case_page_*.png'): im=Image.open(p);print(p.name,im.size) PY
python - <<'PY' import pdfplumber p='/tmp/workspace/attachments/7d04afb2-3521-47a9-a89d-a7b5249f4a55/A CASE OF A 13 YEAR OLD WITH BONE PAINS.pdf' with pdfplumber.open(p) as pdf: for i in [1,3,5,6,14,15]: pdf.pages[i].to_image(resolution=110).save(f'/tmp/workspace/hpt-case-youtube/assets/source_{i+1}.png',format='PNG') PY cat > "/tmp/workspace/hpt-case-youtube/src/build.py" <<'PY' from pptx import Presentation from pptx.util import Inches,Pt from pptx.enum.shapes import MSO_SHAPE,MSO_CONNECTOR from pptx.enum.text import PP_ALIGN,MSO_ANCHOR from pptx.dml.color import RGBColor from pathlib import Path P=Path('/tmp/workspace/hpt-case-youtube'); A=P/'assets'; O=P/'output'/'Interactive_Cartoon_Case_13yo_Bone_Pain_Hyperparathyroidism.pptx' prs=Presentation();prs.slide_width=Inches(13.333);prs.slide_height=Inches(7.5); blank=prs.slide_layouts[6] NAVY=RGBColor(24,37,64); SKY=RGBColor(70,183,204); MINT=RGBColor(122,213,170); YEL=RGBColor(255,203,89); RED=RGBColor(236,99,91); PINK=RGBColor(247,235,238); WHITE=RGBColor(255,255,255); INK=RGBColor(33,45,58); PALE=RGBColor(245,249,251); PURP=RGBColor(126,91,185); GRAY=RGBColor(105,120,130) slides=[] def box(sl,x,y,w,h,c,line=None,round=True): s=sl.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE if round else MSO_SHAPE.RECTANGLE, Inches(x),Inches(y), Inches(w), Inches(h));s.fill.solid();s.fill.fore_color.rgb=c;s.line.color.rgb=line or c;return s def txt(sl,s,x,y,w,h,sz=18,c=INK,b=False,align=PP_ALIGN.LEFT): t=sl.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(.07);f.margin_top=f.margin_bottom=Inches(.03) for i,l in enumerate(s.split('\n')): p=f.paragraphs[0] if i==0 else f.add_paragraph();p.text=l;p.alignment=align;p.space_after=Pt(3) for r in p.runs:r.font.name='Aptos Display' if b else 'Aptos';r.font.size=Pt(sz);r.font.bold=b;r.font.color.rgb=c return t def base(title,subtitle=''): sl=prs.slides.add_slide(blank);slides.append(sl);box(sl,0,0,13.333,7.5,PALE,PALE,False);box(sl,0,0,13.333,.18,SKY,SKY,False);txt(sl,title,.55,.32,11.6,.45,27,NAVY,True);txt(sl,subtitle,.58,.84,10,.22,10,SKY,True);return sl def pill(sl,s,x,y,w,c):box(sl,x,y,w,.4,c,c,True);txt(sl,s,x,y+.08,w,.18,11,WHITE,True,PP_ALIGN.CENTER) def opt(sl,label,body,x,y,w,c,target=None): sh=box(sl,x,y,w,1.2,WHITE,c,True);txt(sl,label,x+.18,y+.16,.55,.3,20,c,True);txt(sl,body,x+.78,y+.14,w-.95,.68,15,INK,True) if target is not None:sh.click_action.target_slide=slides[target] return sh def character(sl,x,y,expression='?',coat=SKY): # cartoon doctor/patient avatar sh=sl.shapes.add_shape(MSO_SHAPE.OVAL, Inches(x+.35), Inches(y), Inches(.8), Inches(.8));sh.fill.solid();sh.fill.fore_color.rgb=YEL;sh.line.color.rgb=NAVY box(sl,x+.15,y+.73,1.2,1.0,coat,coat,True);txt(sl,expression,x+.47,y+.22,.55,.2,20,NAVY,True,PP_ALIGN.CENTER) def note(sl,s):txt(sl,s,.62,7.1,10.8,.18,9,GRAY) # 0 sl=prs.slides.add_slide(blank);slides.append(sl);box(sl,0,0,13.333,7.5,NAVY,NAVY,False);sl.shapes.add_picture(str(A/'cartoon.png'),Inches(7.5),Inches(.4),width=Inches(5.15),height=Inches(6.4));txt(sl,'Can You Solve\nThis Bone-Pain Case?',.65,1.1,6.8,1.2,33,WHITE,True);txt(sl,'A 13-year-old with trauma, osteolytic lesions\nand a surprising PTH result',.7,2.8,6.1,.65,19,RGBColor(204,237,242));pill(sl,'INTERACTIVE CASE',.72,4.25,1.8,RED);txt(sl,'Click the choices. Pause before every reveal.',.7,5.05,5.6,.3,16,MINT,True);txt(sl,'Medical education only | De-identified case',.72,6.85,4,.2,10,RGBColor(178,205,215)) # 1 sl=base('Episode roadmap','CLICK-THROUGH CASE'); for x,num,s,c in [(.75,'01','Meet T.K.P.',SKY),(3.3,'02','Read the clues',YEL),(5.85,'03','Choose tests',PURP),(8.4,'04','Name the pattern',RED),(10.95,'05','Manage it',MINT)]:box(sl,x,2.4,1.8,1.8,c,c,True);txt(sl,num,x,2.73,1.8,.3,24,NAVY,True,PP_ALIGN.CENTER);txt(sl,s,x+.1,3.28,1.6,.5,14,NAVY,True,PP_ALIGN.CENTER) txt(sl,'Rule for viewers: stop the video at the question slides, commit to an answer, then click REVEAL.',1.0,5.15,11.2,.35,19,NAVY,True,PP_ALIGN.CENTER) #2 sl=base('Part 1 | Meet the patient','CASE REVEAL');character(sl,.7,1.4,'🙂',PINK);txt(sl,'T.K.P. • 13-year-old girl',2.0,1.35,5,.35,24,NAVY,True);txt(sl,'Referred after right-hand trauma failed to “heal normally.”\nHand pain plus a history of right-knee bone pain and previous dislocations.',2.0,2.0,6.4,1.1,19,INK);box(sl,9.0,1.3,3.4,3.9,WHITE,SKY,True);txt(sl,'At presentation',9.3,1.65,2.8,.3,18,SKY,True,PP_ALIGN.CENTER);txt(sl,'BP 99/68 mmHg\nPulse 61 bpm\nWeight 66 kg\nNo neck mass',9.55,2.38,2.35,1.5,17,INK,True,PP_ALIGN.CENTER);note(sl,'Source: submitted case PDF. Identifier omitted from presentation.') #3 question sl=base('Pause #1 | What do the hand lesions mean?','YOUR CALL');sl.shapes.add_picture(str(A/'source_4.png'),Inches(.55),Inches(1.2),width=Inches(5.5),height=Inches(4.55));txt(sl,'Radiology description:',6.5,1.35,5.6,.3,19,NAVY,True);txt(sl,'Multiple central osteolytic, expansile lesions with a sclerotic rim and narrow zone of transition. The report raised enchondromas versus a metabolic/inflammatory process.',6.5,1.85,5.7,1.5,18,INK);opt(sl,'A','“This is definitely enchondromatosis.”',6.5,3.75,5.6,SKY,4);opt(sl,'B','“Biochemistry must decide whether this is metabolic bone disease.”',6.5,5.15,5.6,MINT,4);note(sl,'Click either answer to reveal the teaching point.') #4 reveal sl=base('Reveal #1 | Lesions can mislead','WHY BIOCHEMISTRY MATTERS');box(sl,.7,1.28,3.7,4.8,WHITE,RED,True);txt(sl,'Radiology is a clue, not a conclusion.',.98,1.65,3.15,.7,23,RED,True,PP_ALIGN.CENTER);txt(sl,'Brown tumors and other high-turnover lesions can mimic tumors. Enchondroma and Ollier disease remain differentials, but a metabolic screen is mandatory.',1.0,2.65,3.1,2.05,17,INK,False,PP_ALIGN.CENTER);sl.shapes.add_picture(str(A/'cartoon.png'),Inches(4.95),Inches(1.3),width=Inches(3.6),height=Inches(4.5));box(sl,9.05,1.28,3.55,4.8,WHITE,PURP,True);txt(sl,'Host takeaway',9.3,1.65,3.05,.3,19,PURP,True,PP_ALIGN.CENTER);txt(sl,'“Bone lesion” + bone pain = check Ca, phosphate, ALP, PTH, vitamin D, renal function and urinary calcium.',9.42,2.45,2.75,2.25,18,INK,True,PP_ALIGN.CENTER) #5 labs sl=base('Part 2 | The first laboratory clue','CASE REVEAL'); for x,h,v,c in [(1.0,'Calcium','10.10',YEL),(4.1,'PTH','111 ↑',RED),(7.2,'Phosphate','1.25 ↓',SKY),(10.3,'ALP','105.20',MINT)]:box(sl,x,1.6,2.1,1.6,WHITE,c,True);txt(sl,h,x,1.95,2.1,.25,16,c,True,PP_ALIGN.CENTER);txt(sl,v,x,2.42,2.1,.35,25,NAVY,True,PP_ALIGN.CENTER) box(sl,1.05,4.2,11.2,1.2,PINK,RED,True);txt(sl,'Important safety check: verify units and laboratory reference ranges. A “borderline-high” calcium with raised PTH and low phosphate is discordant with simple vitamin-D-deficiency secondary HPT and needs confirmation.',1.4,4.47,10.5,.5,17,INK,True,PP_ALIGN.CENTER);note(sl,'Submitted PDF did not provide units/reference intervals for every test.') #6 question sl=base('Pause #2 | Which test bundle comes next?','YOUR CALL');opt(sl,'A','Repeat total + ionized calcium, albumin, PTH, phosphate, Mg, creatinine/eGFR and 25(OH)D from the same draw.',.8,1.45,5.6,MINT,7);opt(sl,'B','Order parathyroid imaging immediately to prove an adenoma.',6.9,1.45,5.6,RED,7);opt(sl,'C','Order autoimmune serology only.',.8,3.2,5.6,SKY,7);opt(sl,'D','Start treatment without confirming calcium status.',6.9,3.2,5.6,YEL,7);txt(sl,'Bonus discriminator if PTH-dependent hypercalcemia persists: 24-hour urine calcium or Ca/Cr clearance ratio, plus family history and genetic evaluation when appropriate.',1.0,5.4,11.3,.5,17,NAVY,True,PP_ALIGN.CENTER) #7 reveal sl=base('Reveal #2 | Build the biochemical diagnosis first','DIAGNOSTIC DISCIPLINE'); for x,t,b,c in [(.7,'Confirm calcium','Total Ca + albumin; ionized Ca if uncertainty.',SKY),(3.85,'Classify PTH','Is PTH appropriately suppressed or not?',RED),(7.0,'Find modifiers','Phosphate, Mg, renal function, 25(OH)D.',YEL),(10.15,'Separate FHH','Urinary calcium; consider CaSR-pathway genetics.',PURP)]:box(sl,x,1.6,2.45,3.55,WHITE,c,True);txt(sl,t,x+.15,1.95,2.15,.35,19,c,True,PP_ALIGN.CENTER);txt(sl,b,x+.22,2.72,2.0,1.1,15,INK,False,PP_ALIGN.CENTER) box(sl,1.0,5.65,11.25,.5,WHITE,MINT,True);txt(sl,'Do not order ultrasound, sestamibi or 4D-CT until biochemical primary hyperparathyroidism is established. Imaging localizes for surgery, it does not diagnose PHPT.',1.2,5.8,10.85,.2,14,NAVY,True,PP_ALIGN.CENTER) #8 differential sl=base('Pause #3 | Which explanation best fits?','YOUR CALL'); for y,lab,body,c in [(1.35,'A. Vitamin-D-deficiency secondary HPT','Usually low or normal Ca, elevated PTH and often low phosphate.',SKY),(2.6,'B. Primary HPT','Raised/inappropriately normal PTH despite high Ca; phosphate often low.',RED),(3.85,'C. FHH','Mild hypercalcemia with low urinary calcium; family pattern may help.',PURP),(5.1,'D. PTH resistance','Low calcium, high phosphate, high PTH.',YEL)]:opt(sl,lab,body,.9,y,11.4,c,9) #9 reconcile sl=base('Reveal #3 | The case needs a disciplined re-check','INTEGRATION');box(sl,.75,1.25,5.7,4.95,WHITE,RED,True);txt(sl,'What we can say',1.05,1.6,5.1,.3,21,RED,True,PP_ALIGN.CENTER);txt(sl,'The submitted profile is PTH-elevated with low phosphate and a reported borderline-high calcium. If hypercalcemia is confirmed, this is PTH-dependent and PHPT/FHH move forward.',1.15,2.3,4.9,1.75,18,INK,False,PP_ALIGN.CENTER);box(sl,6.85,1.25,5.7,4.95,WHITE,SKY,True);txt(sl,'What we cannot say yet',7.15,1.6,5.1,.3,21,SKY,True,PP_ALIGN.CENTER);txt(sl,'Vitamin D 20.6 ng/mL can raise PTH, but isolated vitamin-D-deficiency secondary HPT generally does not cause confirmed hypercalcemia. Replete appropriately, then reassess calcium and PTH.',7.25,2.3,4.9,1.75,18,INK,False,PP_ALIGN.CENTER);txt(sl,'A 13-year-old with possible PHPT warrants pediatric endocrinology and genetic-risk assessment.',1.1,6.48,11.2,.25,16,NAVY,True,PP_ALIGN.CENTER) #10 interaction sl=base('Interactive board | Choose your next move','CLICK A PATH');opt(sl,'1','Recheck paired calcium-PTH and correct vitamin D / magnesium.',.9,1.35,5.4,MINT,11);opt(sl,'2','If high Ca + non-suppressed PTH persists, distinguish PHPT from FHH.',7.0,1.35,5.4,PURP,12);opt(sl,'3','If PHPT is established, assess kidneys, skeleton and hereditary syndromes.',.9,3.25,5.4,RED,13);opt(sl,'4','Plan definitive treatment with a pediatric endocrine-surgery team.',7.0,3.25,5.4,SKY,14) #11 workup sl=base('Management 1 | Confirm and phenotype the hyperparathyroidism','HYPERPARATHYROIDISM'); for x,t,b,c in [(.7,'Repeat labs','Ca + albumin / ionized Ca, PTH, phosphate, Mg, creatinine/eGFR, 25(OH)D.',MINT),(4.25,'End-organ screen','Renal ultrasound, urine calcium, DXA including distal radius; vertebral assessment when indicated.',SKY),(7.8,'Genetic lens','Young age, multigland disease or family history: assess MEN1, CDC73, RET and CaSR-pathway conditions with specialists.',PURP),(11.35,'Localize later','Ultrasound ± sestamibi / 4D imaging only once surgery is planned.',YEL)]:box(sl,x,1.55,1.55,3.85,WHITE,c,True);txt(sl,t,x+.1,1.9,1.35,.5,16,c,True,PP_ALIGN.CENTER);txt(sl,b,x+.13,2.7,1.28,2.0,13,INK,False,PP_ALIGN.CENTER) #12 fhh sl=base('Management 2 | PHPT versus FHH','HYPERPARATHYROIDISM'); for x,t,items,c in [(.85,'Primary HPT',['Hypercalcemia persists','PTH non-suppressed','Urine Ca usually normal/high','Symptomatic child: surgery typically favored'],RED),(6.8,'FHH',['Mild stable hypercalcemia','PTH normal/mildly high','Low urinary Ca','Avoid unnecessary parathyroid surgery'],PURP)]:box(sl,x,1.45,5.6,4.7,WHITE,c,True);txt(sl,t,x+.25,1.8,5.1,.35,23,c,True,PP_ALIGN.CENTER);txt(sl,'\n'.join('• '+i for i in items),x+.45,2.6,4.7,2.1,18,INK,False) txt(sl,'Caution: urine calcium is distorted by vitamin D deficiency, reduced GFR, low calcium intake, thiazides and lithium. Interpret in clinical context.',1.0,6.45,11.4,.25,15,NAVY,True,PP_ALIGN.CENTER) #13 surgical sl=base('Management 3 | Established pediatric PHPT: definitive care','HYPERPARATHYROIDISM'); box(sl,.75,1.3,3.6,4.75,WHITE,RED,True);txt(sl,'1. Refer early',1.05,1.67,3.0,.3,20,RED,True,PP_ALIGN.CENTER);txt(sl,'Pediatric endocrinology + experienced endocrine surgeon. Evaluate inherited disease and multigland risk before selecting an operation.',1.15,2.45,2.8,1.8,17,INK,False,PP_ALIGN.CENTER);box(sl,4.85,1.3,3.6,4.75,WHITE,SKY,True);txt(sl,'2. Localize for surgery',5.15,1.67,3.0,.3,20,SKY,True,PP_ALIGN.CENTER);txt(sl,'Neck ultrasound and functional imaging are planning tools. Operative strategy depends on sporadic single-gland versus hereditary/multigland disease.',5.25,2.45,2.8,1.8,17,INK,False,PP_ALIGN.CENTER);box(sl,8.95,1.3,3.6,4.75,WHITE,MINT,True);txt(sl,'3. Monitor post-op',9.25,1.67,3.0,.3,20,MINT,True,PP_ALIGN.CENTER);txt(sl,'Watch calcium, phosphate, PTH and symptoms. Anticipate hungry bone syndrome in high-turnover disease; provide clinician-directed calcium/calcitriol.',9.35,2.45,2.8,1.8,17,INK,False,PP_ALIGN.CENTER) #14 medical sl=base('Management 4 | Medical treatment: bridge, not substitute','HYPERPARATHYROIDISM'); for x,t,b,c in [(.8,'Hydration & safety','Avoid dehydration; review thiazides, lithium, supplements. Urgent assessment if significant hypercalcemia symptoms.',SKY),(4.5,'Correct contributors','Treat vitamin D deficiency carefully and correct magnesium. Measure response, do not assume the diagnosis.',YEL),(8.2,'Calcimimetic','Cinacalcet can lower calcium/PTH in selected specialist-managed cases when surgery is not immediate or feasible.',PURP)]:box(sl,x,1.55,3.5,3.9,WHITE,c,True);txt(sl,t,x+.2,1.92,3.1,.35,19,c,True,PP_ALIGN.CENTER);txt(sl,b,x+.28,2.8,2.95,1.5,16,INK,False,PP_ALIGN.CENTER) box(sl,1.1,6.05,11.0,.55,PINK,RED,True);txt(sl,'The submitted case used cinacalcet and low-dose vitamin D. Dosing and appropriateness in adolescents require specialist supervision and local protocol.',1.35,6.22,10.5,.2,14,INK,True,PP_ALIGN.CENTER) #15 ending sl=base('Final takeaway | What should the audience remember?','CASE CLOSE'); items=['Bone lesions can be metabolic: never stop at the radiology label.','Validate units, reference ranges and ionized calcium before naming hyperparathyroidism.','Vitamin D deficiency raises PTH, but confirmed hypercalcemia demands a PTH-dependent hypercalcemia work-up.','In a child/adolescent, persistent PHPT should trigger early pediatric endocrine, genetics and endocrine-surgery involvement.'] for i,it in enumerate(items): y=1.3+i*1.05;box(sl,.9,y,.55,.55,[SKY,YEL,RED,MINT][i],[SKY,YEL,RED,MINT][i],True);txt(sl,str(i+1),.9,y+.12,.55,.2,17,NAVY,True,PP_ALIGN.CENTER);txt(sl,it,1.75,y+.1,10.5,.35,18,INK,True) #16 refs sl=base('Sources and disclaimer','REFERENCES');refs=['Submitted case PDF: “A Case of a 13 Year Old with Bone Pains.” Case facts reproduced and de-identified for education.','Harrison’s Principles of Internal Medicine, 22nd ed. (2025): calcium/phosphate disorders and pseudohypoparathyroidism.','Bilezikian JP et al. Fifth International Workshop on Primary Hyperparathyroidism. J Bone Miner Res. 2022;37:2293-2314.','Primary Hyperparathyroidism in the Pediatric Population: Surgical Considerations and Outcomes. Narrative review, 2026 (PMC12939526).','Medical education only. This deck is not patient-specific medical advice.'] txt(sl,'\n\n'.join('• '+r for r in refs),.9,1.35,11.6,4.7,16,INK) # footer navigation after all slides created for i,sl in enumerate(slides): if i==0:continue back=box(sl,11.9,6.93,.52,.3,NAVY,NAVY,True);txt(sl,'◀',11.9,6.985,.52,.12,10,WHITE,True,PP_ALIGN.CENTER) home=box(sl,12.48,6.93,.52,.3,SKY,SKY,True);txt(sl,'⌂',12.48,6.98,.52,.12,10,NAVY,True,PP_ALIGN.CENTER) back.click_action.target_slide=slides[max(0,i-1)];home.click_action.target_slide=slides[1] prs.core_properties.title='Interactive Cartoon Case: 13-year-old with bone pains and hyperparathyroidism' prs.save(O);print(O, len(slides)) PY python "/tmp/workspace/hpt-case-youtube/src/build.py"
python - <<'PY' p='/tmp/workspace/hpt-case-youtube/src/build.py' s=open(p).read() s=s.replace("slides=[]\ndef box", "slides=[]\npending_links=[]\ndef box") s=s.replace("if target is not None:sh.click_action.target_slide=slides[target]", "if target is not None: pending_links.append((sh,target))") s=s.replace("# footer navigation after all slides created", "# activate forward/reveal click targets after all slides exist\nfor sh,target in pending_links:\n sh.click_action.target_slide=slides[target]\n# footer navigation after all slides created") open(p,'w').write(s) PY python "/tmp/workspace/hpt-case-youtube/src/build.py" && python - <<'PY' from pptx import Presentation p='/tmp/workspace/hpt-case-youtube/output/Interactive_Cartoon_Case_13yo_Bone_Pain_Hyperparathyroidism.pptx' r=Presentation(p) print('slides',len(r.slides)) for i,s in enumerate(r.slides,1): print(i, sum(1 for x in s.shapes if getattr(x,'click_action',None) and x.click_action.target_slide is not None), sum(1 for x in s.shapes if getattr(x,'has_text_frame',False) and x.text.strip())) PY
python - <<'PY' from pptx import Presentation from pathlib import Path p=Path('/tmp/workspace/hpt-case-youtube/output/Interactive_Cartoon_Case_13yo_Bone_Pain_Hyperparathyroidism.pptx') assert p.exists() and p.stat().st_size>100000 r=Presentation(str(p)) assert len(r.slides)==17 for idx in [4,7,9,11,12,13,14,15]: s=r.slides[idx-1] assert any(getattr(sh,'has_text_frame',False) and sh.text.strip() for sh in s.shapes), idx print('verified',p.stat().st_size,'bytes; slides',len(r.slides)) PY python - <<'PY' import zipfile p='/tmp/workspace/hpt-case-youtube/output/Interactive_Cartoon_Case_13yo_Bone_Pain_Hyperparathyroidism.pptx' with zipfile.ZipFile(p) as z: print('integrity',z.testzip(),'media files',len([x for x in z.namelist() if x.startswith('ppt/media/')])) PY
Interactive Cartoon Case 13yo Bone Pain Hyperparathyroidism
Presentation · PPTX