feat(pe-guide): step-by-step OSCE checklist, Bates/Nelson/Hutchison sourced

Replaces the generic one-line-per-component format with a step-level
checklist. Each exam component now contains 3–13 discrete steps, each
with its own Normal/Abnormal/Skip toggle and optional abnormal note.
Physician ticks the exam off step-by-step; report generation
summarises at the component level but knows exactly which steps were
performed.

Example — previously the adolescent "Cranial nerves (II–XII)" was a
single row: "How to perform: Full formal adult-pattern exam. Expected:
All cranial nerves intact." That's unhelpful. Now it's 14 discrete
steps: CN I, CN II acuity, CN II fields, CN II fundoscopy, CN II/III
pupils, CN III/IV/VI EOM, CN V sensation V1/V2/V3, CN V motor, CN V
corneal, CN VII forehead/eye-close/smile/puff, CN VIII, CN IX/X, CN
XI, CN XII — each with specific method and expected finding. Same
depth for MSK: scoliosis = 5 discrete steps (standing inspection,
Adam forward-bend, rib-hump check, scoliometer, plumb-line), joint
stability = 8 named tests (Lachman, anterior drawer, varus/valgus,
McMurray, apprehension, Neer/Hawkins, anterior drawer ankle, talar
tilt), Beighton = 5 per-joint measurements, etc.

Sources cited in code header: Bates' Guide 13th ed, Nelson Textbook
22nd ed, Hutchison's Clinical Methods 25th ed, Fenichel Clinical
Pediatric Neurology 8th ed.

Backend route accepts the flat step array (grouped by component on
the server), passes structured text to the AI with methods and
expected findings per step. Prompts updated to summarise at the
component level rather than step-by-step, so output is clinically
readable.

Scope: MSK + Neuro × 6 age groups (newborn, infant, toddler, preschool,
school-age, adolescent). More systems follow the same pattern —
append to PE_DATA.
This commit is contained in:
Daniel 2026-04-22 17:15:18 +02:00
parent 669908b711
commit 86ab5a5dd3
3 changed files with 696 additions and 328 deletions

View file

@ -1,15 +1,18 @@
// ============================================================
// PHYSICAL EXAM GUIDE — OSCE reference + narrative generator
// PHYSICAL EXAM GUIDE — step-by-step OSCE reference + report generator
// ============================================================
// Data is embedded here rather than fetched: the knowledge is static and
// small, and it needs to be available offline-in-browser without an API
// round-trip. Scope for v1: MSK + Neuro × 6 age groups. Expand later.
// Sources for the exam content:
// - Bates' Guide to Physical Examination, 13th edition (technique)
// - Nelson Textbook of Pediatrics, 22nd edition (age-specific content)
// - Hutchison's Clinical Methods, 25th edition (systematic approach)
// - Developmental reflex timing: Fenichel Clinical Pediatric Neurology, 8th ed
//
// Each exam component has:
// name — what to document
// technique — how to perform (OSCE-style)
// normal — expected finding text (used verbatim when user picks Normal)
// abnormalHints — red flags / things to document if abnormal (reference only)
// Data model:
// PE_DATA[ageGroup][system] = { overview, components: [{ name, steps: [{label, method, normal}], abnormalHints }] }
// Each step has its own Normal / Abnormal / Skip toggle so the physician
// ticks the exam off step-by-step and flags specific abnormal findings.
// Report generation (POST /api/generate-pe-narrative) receives the flat
// step array and produces a Technique + Findings narrative.
// ============================================================
(function () {
@ -18,58 +21,96 @@
// DATA
// ────────────────────────────────────────────────────────────
var PE_DATA = {
newborn: {
label: 'Newborn (028 days)',
msk: {
overview: 'Focus: birth injuries, congenital anomalies, and DDH screening (universal Barlow/Ortolani through 6 months). Examine warm, quiet, undressed infant.',
overview: 'Exam done warm, quiet, undressed. Focus: birth injury, DDH, congenital anomaly. All steps symmetric.',
components: [
{ name: 'Resting posture', technique: 'Observe supine. Note symmetry of limb position.',
normal: 'Symmetric flexion at hips, knees, elbows; hands loosely fisted',
abnormalHints: ['Frog-leg (hypotonia)', 'Asymmetric arm posture (brachial plexus, clavicle fx)', 'Opisthotonic posturing (CNS)'] },
{ name: 'Clavicles', technique: 'Palpate each clavicle from sternoclavicular joint to acromion.',
normal: 'Smooth, continuous bilaterally; no crepitus or step-off',
abnormalHints: ['Crepitus or step-off (fracture — LGA / shoulder dystocia)', 'Pain with passive arm abduction'] },
{ name: 'Hips (Barlow/Ortolani)', technique: 'Flex hips 90°, grasp thighs with thumbs medial. Barlow: adduct + downward pressure. Ortolani: abduct + lift.',
normal: 'Hips stable; no clunk on Barlow or Ortolani; symmetric abduction ≥75°',
abnormalHints: ['Palpable clunk (positive Ortolani = dislocatable or dislocated)', 'Asymmetric thigh/gluteal folds', 'Limited abduction', 'Leg-length discrepancy (Galeazzi)'] },
{ name: 'Spine / back', technique: 'Prone. Palpate midline from C-spine to coccyx. Inspect sacral area.',
normal: 'Straight midline; no cutaneous markers; skin intact; no sacral mass',
abnormalHints: ['Sacral dimple >5mm or >2.5cm from anus (imaging)', 'Midline hair tuft, hemangioma, lipoma (occult dysraphism)', 'Palpable defect'] },
{ name: 'Upper extremities', technique: 'Observe spontaneous movement, count digits, inspect palmar creases.',
normal: 'Symmetric antigravity movement; 5 digits each hand; normal palmar creases',
abnormalHints: ['Erb/Klumpke palsy (asymmetric movement)', 'Polydactyly, syndactyly', 'Single transverse palmar crease (trisomy 21 — soft sign)'] },
{ name: 'Lower extremities / feet', technique: 'Range hips/knees/ankles. Stroke lateral border of foot. Attempt passive correction.',
normal: 'Full range; foot correctable to neutral with ease; no hindfoot deformity',
abnormalHints: ['Rigid clubfoot (talipes equinovarus — non-correctable)', 'Metatarsus adductus (usually flexible)', 'Rocker-bottom foot (trisomy 18)'] }
{ name: 'Resting posture', steps: [
{ label: 'Observe posture', method: 'Place supine and undisturbed for 30s', normal: 'Symmetric flexion at hips, knees, elbows' },
{ label: 'Hand position', method: 'Inspect resting hands', normal: 'Loosely fisted; opens intermittently' },
{ label: 'Symmetry', method: 'Compare left vs right side at rest', normal: 'Mirror-image posture' }
], abnormalHints: ['Frog-leg (hypotonia)', 'Asymmetric arm (brachial plexus/clavicle fx)', 'Opisthotonos (CNS)', 'Persistent fisting with thumb in palm'] },
{ name: 'Clavicles', steps: [
{ label: 'Palpate right clavicle', method: 'Trace from sternoclavicular joint to acromion with index finger', normal: 'Smooth, continuous, no step-off' },
{ label: 'Palpate left clavicle', method: 'Same technique on left side', normal: 'Smooth, continuous' },
{ label: 'Crepitus check', method: 'Light pressure along length of clavicle while gently abducting arm', normal: 'No crepitus, no pain response' }
], abnormalHints: ['Palpable step-off or callus (fracture — LGA, shoulder dystocia)', 'Asymmetric Moro on affected side'] },
{ name: 'Hips — DDH screen', steps: [
{ label: 'Thigh/gluteal folds', method: 'Undress completely; compare skin-fold symmetry', normal: 'Symmetric thigh and gluteal folds' },
{ label: 'Abduction', method: 'Flex hips 90°, abduct simultaneously', normal: 'Both hips abduct to ≥75° symmetrically' },
{ label: 'Barlow maneuver', method: 'Thumb on medial thigh, flex hip 90°, adduct, apply gentle posterior pressure', normal: 'No clunk or movement felt (negative)' },
{ label: 'Ortolani maneuver', method: 'From Barlow position: abduct and lift with fingers on greater trochanter', normal: 'No clunk as hip returns (negative)' },
{ label: 'Galeazzi sign', method: 'Knees flexed together with feet on table; compare knee heights', normal: 'Knees level — no leg-length discrepancy' }
], abnormalHints: ['Palpable Ortolani clunk (dislocated, reducible)', 'Barlow clunk (dislocatable)', 'Limited abduction', 'Positive Galeazzi (shortened femur)'] },
{ name: 'Spine and back', steps: [
{ label: 'Position prone', method: 'Turn infant prone, support chest', normal: 'Tolerates position, lifts head briefly' },
{ label: 'Palpate midline', method: 'Run finger from C-spine to coccyx', normal: 'Straight midline, no step-offs or gaps' },
{ label: 'Sacral inspection', method: 'Inspect sacral dimple if present; measure depth, distance from anus', normal: 'No dimple, or dimple <5mm deep and <2.5cm from anus' },
{ label: 'Cutaneous markers', method: 'Inspect midline skin from neck to coccyx', normal: 'No hair tuft, hemangioma, lipoma, or sinus tract' }
], abnormalHints: ['Deep sacral dimple (>5mm) or >2.5cm from anus — imaging', 'Hair tuft, hemangioma, lipoma (occult dysraphism)', 'Palpable defect'] },
{ name: 'Upper extremities', steps: [
{ label: 'Spontaneous movement', method: 'Observe both arms for 30s', normal: 'Symmetric antigravity movement' },
{ label: 'Digits', method: 'Count and inspect fingers both hands', normal: '5 digits each, no webbing or duplication' },
{ label: 'Palmar creases', method: 'Inspect palmar creases', normal: 'Normal triradiate creases' }
], abnormalHints: ['Erb/Klumpke palsy (paucity of movement)', 'Polydactyly, syndactyly', 'Single transverse (simian) palmar crease'] },
{ name: 'Lower extremities / feet', steps: [
{ label: 'Hip and knee range', method: 'Gently flex, extend, internally/externally rotate each', normal: 'Full symmetric range, no contracture' },
{ label: 'Foot alignment', method: 'Inspect resting foot position', normal: 'Midline or mildly adducted forefoot' },
{ label: 'Passive correction', method: 'Gently attempt to bring foot to neutral', normal: 'Fully correctable to neutral' },
{ label: 'Stroke test', method: 'Stroke lateral border of foot', normal: 'Foot dorsiflexes and everts reflexively' }
], abnormalHints: ['Rigid clubfoot (non-correctable talipes equinovarus)', 'Fixed metatarsus adductus', 'Rocker-bottom foot (trisomy 18)', 'Calcaneovalgus'] }
]
},
neuro: {
overview: 'Focus: primitive reflexes (present and symmetric), tone (passive and active), and absence of focal deficit. A full newborn neuro exam takes 35 min on a quiet, satiated baby.',
overview: 'Primitive reflexes present and symmetric. Tone assessed passively and actively. Full exam 35 min on a quiet, fed infant.',
components: [
{ name: 'Level of alertness', technique: 'Observe spontaneous alertness and response to voice, touch, light.',
normal: 'Alert periods with spontaneous eye opening; responds to voice and light; consolable',
abnormalHints: ['Persistent lethargy / hard to arouse', 'Jitteriness', 'Irritability not consoled by feeding'] },
{ name: 'Cranial nerves', technique: 'Pupils to light; symmetric facial movement at rest and with crying; intact suck; visual blink to light.',
normal: 'Pupils equal and reactive; face symmetric; strong coordinated suck; blinks to bright light',
abnormalHints: ['Asymmetric facial movement (CN VII injury)', 'Poor or uncoordinated suck', 'Fixed pupil', 'Absent blink'] },
{ name: 'Tone (passive)', technique: 'Pull-to-sit (head lag ≤ minimal at term), ventral suspension (head lifts to horizontal), arm recoil, popliteal angle.',
normal: 'Age-appropriate flexor tone; brief head lag on pull-to-sit; head level with spine on ventral suspension',
abnormalHints: ['Significant head lag (hypotonia)', 'Slip-through on vertical suspension', 'Hypertonia / scissoring'] },
{ name: 'Spontaneous movement', technique: 'Observe limb movement for symmetry, range, antigravity effort.',
normal: 'Symmetric, antigravity movements of all four limbs',
abnormalHints: ['Focal paucity of movement (stroke, brachial plexus)', 'Jittery movements that stop on passive flexion', 'Clonic or tonic seizure activity'] },
{ name: 'Moro reflex', technique: 'Support head, allow ~30° head drop or clap.',
normal: 'Symmetric arm extension followed by flexion and often a cry',
abnormalHints: ['Absent (severe CNS depression)', 'Asymmetric (brachial plexus injury, clavicle fx, hemiparesis)'] },
{ name: 'Rooting / sucking', technique: 'Stroke cheek / touch lips. Insert gloved finger.',
normal: 'Turns toward stimulus and opens mouth; strong rhythmic suck',
abnormalHints: ['Absent rooting or suck (CNS depression, prematurity)', 'Uncoordinated suck-swallow'] },
{ name: 'Palmar / plantar grasp', technique: 'Apply pressure to palm; then to ball of foot.',
normal: 'Strong, symmetric finger flexion; toe curl to plantar pressure',
abnormalHints: ['Absent or asymmetric palmar grasp', 'Absent plantar grasp'] },
{ name: 'Babinski', technique: 'Stroke lateral sole from heel to toes.',
normal: 'Up-going great toe with fanning of other toes (expected in neonates)',
abnormalHints: ['Asymmetric response is always abnormal'] }
{ name: 'Alertness and behavior', steps: [
{ label: 'State cycling', method: 'Observe over 12 min for alert periods', normal: 'Alert periods with spontaneous eye opening' },
{ label: 'Response to voice', method: 'Speak softly near ear', normal: 'Quiets to voice or turns toward sound' },
{ label: 'Consolability', method: 'If crying, attempt to soothe with swaddling or voice', normal: 'Consolable within 12 min' }
], abnormalHints: ['Lethargy', 'Jitteriness not stopped by passive flexion', 'Irritability unrelieved by feeding'] },
{ name: 'Cranial nerves', steps: [
{ label: 'CN II — pupil response', method: 'Shine light in each eye', normal: 'Pupils equal, reactive to light, direct and consensual' },
{ label: 'CN II — blink to light', method: 'Bright light in the line of sight', normal: 'Reflex blink' },
{ label: 'CN VII — facial symmetry at rest', method: 'Observe resting face', normal: 'Symmetric nasolabial folds' },
{ label: 'CN VII — facial symmetry with cry', method: 'Note face during a cry', normal: 'Symmetric grimace' },
{ label: 'CN IX, X, XII — suck and swallow', method: 'Offer clean gloved finger, pacifier, or during feed', normal: 'Strong coordinated suck-swallow, no choking' }
], abnormalHints: ['Asymmetric face (CN VII injury — usually forceps)', 'Poor suck or uncoordinated swallow', 'Fixed or unequal pupil'] },
{ name: 'Tone — passive', steps: [
{ label: 'Pull-to-sit', method: 'Grasp hands/wrists, pull smoothly to sit', normal: 'Brief head lag at term; not dramatic' },
{ label: 'Ventral suspension', method: 'Suspend prone over hand at chest', normal: 'Head briefly lifts to horizontal; extremities flexed' },
{ label: 'Arm recoil', method: 'Extend both arms fully at elbows, release', normal: 'Rapid return to flexion' },
{ label: 'Popliteal angle', method: 'Hip flexed 90°, extend knee maximally', normal: '≤110°' }
], abnormalHints: ['Marked head lag (hypotonia)', 'Slip-through on vertical suspension', 'Hypertonia / scissoring', 'Floppy limbs with no recoil'] },
{ name: 'Spontaneous movement', steps: [
{ label: 'Observe limbs', method: 'Undisturbed over 1 min, note movement', normal: 'Symmetric antigravity movement of all 4 limbs' },
{ label: 'Quality of movement', method: 'Note smoothness vs jitteriness', normal: 'Smooth, mildly variable movements' }
], abnormalHints: ['Paucity of movement in one limb', 'Coarse jitteriness', 'Clonic jerks', 'Tonic posturing'] },
{ name: 'Primitive reflexes', steps: [
{ label: 'Moro', method: 'Support head; allow 30° head drop or loud clap', normal: 'Symmetric arm abduction then flexion, often cry' },
{ label: 'Rooting', method: 'Stroke cheek at corner of mouth', normal: 'Turns head toward stroke and opens mouth' },
{ label: 'Palmar grasp', method: 'Press into palm with finger', normal: 'Strong, symmetric finger flexion' },
{ label: 'Plantar grasp', method: 'Press ball of foot below toes', normal: 'Toes flex around finger symmetrically' },
{ label: 'Stepping', method: 'Hold upright with feet touching surface', normal: 'Alternating stepping movements' },
{ label: 'Tonic neck (fencing)', method: 'Turn head to one side with infant supine', normal: 'Same-side arm extends, opposite flexes (not obligate)' },
{ label: 'Galant', method: 'Stroke paravertebrally from shoulder to buttock, one side', normal: 'Trunk curves toward stroked side' }
], abnormalHints: ['Absent or asymmetric Moro — CNS injury, brachial plexus, clavicle fx', 'Absent grasps — CNS depression', 'Obligate tonic neck is abnormal'] },
{ name: 'Babinski (plantar response)', steps: [
{ label: 'Stroke lateral sole', method: 'Firm stroke from heel toward toes along lateral plantar border', normal: 'Up-going great toe with fanning (normal in newborn)' },
{ label: 'Symmetry check', method: 'Repeat opposite foot', normal: 'Symmetric response' }
], abnormalHints: ['Asymmetric response is always abnormal'] }
]
}
},
@ -77,46 +118,68 @@
infant: {
label: 'Infant (112 months)',
msk: {
overview: 'Focus: continued DDH screen through 6 months, gross-motor progression, and symmetry of tone and movement.',
overview: 'Continued DDH screen through 6 months. Watch motor progression and symmetry of tone/movement.',
components: [
{ name: 'Hips (Barlow/Ortolani through 6mo; abduction thereafter)', technique: 'Barlow/Ortolani in first 6 months. After 6 months use limited abduction (<70°), Galeazzi sign, asymmetric skin folds.',
normal: 'Stable hips with symmetric abduction ≥70°; no Galeazzi; symmetric skin folds',
abnormalHints: ['Positive Ortolani / Barlow (before 3mo)', 'Limited abduction after 3mo', 'Asymmetric thigh folds', 'Galeazzi (shortened femur on affected side)'] },
{ name: 'Gross-motor observation', technique: 'Observe head control in prone and pull-to-sit; rolling; sitting; standing — appropriate to age.',
normal: 'Age-appropriate motor milestones (e.g., sits without support by 6mo, pulls to stand by 9mo)',
abnormalHints: ['Asymmetric movement', 'Persistent fisting past 3mo', 'Scissoring', 'Delayed or regressed milestones'] },
{ name: 'Spine', technique: 'Palpate midline when sitting. Observe kyphosis/lordosis as development progresses.',
normal: 'Midline spine; physiologic gentle kyphosis in young infant; no masses',
abnormalHints: ['Fixed kyphoscoliosis', 'Sacral dimple with cutaneous marker', 'Palpable step-off'] },
{ name: 'Extremities', technique: 'Passive range of all major joints. Inspect feet.',
normal: 'Full range of all joints; feet correctable and aligning; no rigid deformity',
abnormalHints: ['Rigid clubfoot', 'Persistent asymmetric tone', 'Joint swelling / warmth (septic arthritis)'] },
{ name: 'Clavicles', technique: 'Palpate bilaterally (if not done at newborn).',
normal: 'Intact, smooth, symmetric',
abnormalHints: ['Healed fracture callus palpable (usually benign finding)'] }
{ name: 'Hips — continued DDH screen', steps: [
{ label: 'Thigh-fold symmetry', method: 'Inspect with infant supine, thighs flexed', normal: 'Symmetric folds' },
{ label: 'Barlow/Ortolani (through 3mo)', method: 'As in newborn — thumb medial, flex 90°, adduct+push then abduct+lift', normal: 'Negative bilaterally' },
{ label: 'Abduction (any age)', method: 'Flex 90°, abduct simultaneously', normal: '≥70° symmetric abduction' },
{ label: 'Galeazzi', method: 'Knees flexed feet flat on exam table', normal: 'Knees equal height' }
], abnormalHints: ['Clunk on Barlow/Ortolani (<3mo)', 'Limited abduction', 'Asymmetric folds', 'Positive Galeazzi'] },
{ name: 'Gross-motor milestones (age-appropriate)', steps: [
{ label: 'Head control', method: 'Prone, pull-to-sit, held upright', normal: 'Age-appropriate: 2mo lifts head 45°; 4mo no head lag' },
{ label: 'Rolling', method: 'Observe on flat surface', normal: 'Rolls back-to-front by 56mo' },
{ label: 'Sitting', method: 'Place in sitting position', normal: 'Tripod sit by 6mo; sits without support by 78mo' },
{ label: 'Standing', method: 'Support under arms', normal: 'Bears weight by 6mo; pulls to stand by 9mo' }
], abnormalHints: ['Milestone delay by ≥2mo', 'Loss of previously attained milestone', 'Asymmetric use of limbs'] },
{ name: 'Spine', steps: [
{ label: 'Palpate seated', method: 'Run finger along spine with infant sitting or held upright', normal: 'Midline, no step-offs' },
{ label: 'Back curvature', method: 'Inspect sitting and lying', normal: 'Physiologic gentle kyphosis in early infancy; lumbar lordosis as sitting develops' }
], abnormalHints: ['Fixed kyphoscoliosis', 'Sacral dimple with cutaneous marker', 'Step-off'] },
{ name: 'Extremities', steps: [
{ label: 'Passive range', method: 'Through each major joint', normal: 'Full symmetric range' },
{ label: 'Joint inspection', method: 'Inspect for swelling, warmth, effusion', normal: 'No swelling, warmth, or effusion' },
{ label: 'Feet alignment', method: 'Observe standing if pulling up, else passive positioning', normal: 'Correctable or aligned feet; flexible' }
], abnormalHints: ['Joint swelling/warmth (septic vs reactive arthritis)', 'Rigid clubfoot', 'Persistent asymmetric tone'] }
]
},
neuro: {
overview: 'Focus: primitive reflexes should be fading on a predictable schedule; protective reflexes should be emerging; milestones and tone tracked together.',
overview: 'Primitive reflexes fading on schedule; protective reflexes emerging; gross motor and tone interlinked.',
components: [
{ name: 'Level of alertness', technique: 'Engage with face, voice, and age-appropriate object (rattle, toy).',
normal: 'Alert, socially engaged, tracks and reaches appropriately for age',
abnormalHints: ['Poor social engagement', 'Absent visual tracking past 3mo'] },
{ name: 'Cranial nerves', technique: 'Visual tracking (180° by 3mo), pupil response, facial symmetry with smile/cry, intact suck, symmetric tongue.',
normal: 'Tracks past midline; pupils equal reactive; symmetric facial movement',
abnormalHints: ['Persistent nystagmus', 'Strabismus past 4mo', 'Asymmetric facial movement'] },
{ name: 'Tone', technique: 'Pull-to-sit (no head lag by 4mo), ventral suspension, vertical suspension.',
normal: 'Age-appropriate tone; no head lag by 4mo; no slip-through on vertical suspension',
abnormalHints: ['Persistent head lag past 4mo (hypotonia)', 'Hypertonia / scissoring (UMN / CP)', 'Mixed tone (dyskinetic)'] },
{ name: 'Primitive reflex status', technique: 'Assess Moro, grasp, tonic neck, Galant — all should be integrated (gone) by 6 months.',
normal: 'Primitive reflexes fading on schedule (Moro absent by 6mo, palmar grasp by 56mo, tonic neck by 46mo)',
abnormalHints: ['Persistence of any primitive reflex past 6mo warrants evaluation (CP, CNS injury)'] },
{ name: 'Protective / parachute reflex', technique: '69mo and beyond: hold prone, tilt head-down suddenly. Observe protective arm extension.',
normal: 'Symmetric arm extension protectively by 9mo (emerges 69mo)',
abnormalHints: ['Absent parachute after 12mo (significant concern)', 'Asymmetric response'] },
{ name: 'Gait (if walking)', technique: 'Observe barefoot walking on flat surface if baby is ambulating.',
normal: 'Wide-based, arms high guard; improving symmetry; appropriate for age',
abnormalHints: ['Persistent toe-walking', 'Asymmetric stride / limp', 'Ataxic or scissoring gait'] }
{ name: 'Alertness and social engagement', steps: [
{ label: 'Social smile', method: 'Face-to-face interaction', normal: 'Social smile by 68 weeks' },
{ label: 'Tracking', method: 'Move object across visual field', normal: '180° horizontal tracking by 3mo' },
{ label: 'Engagement', method: 'Face-to-face, voice, toys', normal: 'Age-appropriate reciprocal interaction' }
], abnormalHints: ['No social smile by 3mo', 'Absent tracking past 3mo', 'Poor engagement (developmental concern)'] },
{ name: 'Cranial nerves', steps: [
{ label: 'Pupils', method: 'Light response each eye', normal: 'Equal reactive' },
{ label: 'Eye alignment', method: 'Inspect with gaze forward and in all directions', normal: 'No strabismus past 4mo' },
{ label: 'Facial symmetry', method: 'Observe smile and cry', normal: 'Symmetric' },
{ label: 'Suck and swallow', method: 'Observe feeding', normal: 'Coordinated, no choking' }
], abnormalHints: ['Persistent nystagmus', 'Strabismus past 4mo', 'Asymmetric face'] },
{ name: 'Tone', steps: [
{ label: 'Pull-to-sit', method: 'Gently pull wrists/hands', normal: 'No head lag by 4mo' },
{ label: 'Ventral suspension', method: 'Support prone, observe', normal: 'Head above horizontal, extremities actively flexed (age-dependent)' },
{ label: 'Vertical suspension', method: 'Support under arms, lift', normal: 'Does not slip through hands' }
], abnormalHints: ['Persistent head lag past 4mo (hypotonia)', 'Hypertonia / scissoring (UMN)', 'Slip-through on vertical suspension'] },
{ name: 'Primitive reflex integration', steps: [
{ label: 'Moro', method: 'Head drop or clap', normal: 'Absent by 6mo' },
{ label: 'Palmar grasp', method: 'Press into palm', normal: 'Integrated by 56mo; replaced by voluntary grasp' },
{ label: 'Tonic neck', method: 'Turn head to side', normal: 'Absent by 6mo' },
{ label: 'Rooting', method: 'Stroke cheek', normal: 'Absent by 34mo' }
], abnormalHints: ['Persistence of any primitive reflex past 6mo warrants eval (CP, CNS injury)'] },
{ name: 'Protective and postural reflexes', steps: [
{ label: 'Parachute', method: 'Held prone, tilt head downward suddenly', normal: 'Symmetric arm extension protectively by 9mo (emerges 69mo)' },
{ label: 'Lateral propping', method: 'Seated infant, gentle tilt to one side', normal: 'Arm extends to catch by 67mo' },
{ label: 'Landau', method: 'Suspend prone', normal: 'Extends head, spine, legs by 6mo' }
], abnormalHints: ['Absent parachute after 12mo (concerning)', 'Asymmetric lateral propping', 'Absent Landau'] }
]
}
},
@ -124,49 +187,86 @@
toddler: {
label: 'Toddler (13 years)',
msk: {
overview: 'Focus: gait, physiologic alignment changes (bow-legs → knock-knees around age 23), in-toeing, and joint range.',
overview: 'Gait, physiologic alignment changes, in-toeing, joint range. Cooperation unpredictable — use play.',
components: [
{ name: 'Gait', technique: 'Observe barefoot walking, running if age-appropriate. Note base, symmetry, heel-strike.',
normal: 'Symmetric stride; base narrowing; heel-strike present; arms swinging reciprocally',
abnormalHints: ['Persistent toe-walking past 2y (idiopathic vs CP)', 'Limp (Legg-Calvé-Perthes, transient synovitis, SCFE)', 'Wide-based ataxic gait'] },
{ name: 'Alignment — knees', technique: 'Stand with feet together. Measure intercondylar (varum) or intermalleolar (valgum) distance if abnormal.',
normal: 'Physiologic genu varum resolves by 1824mo; genu valgum common by 24y and peaks at 34y',
abnormalHints: ['Persistent varum past 2y', 'Severe valgum (>8cm intermalleolar)', 'Unilateral alignment abnormality (Blount disease, rickets)'] },
{ name: 'Alignment — feet', technique: 'Observe foot position on gait and stance. Check forefoot adduction, heel alignment.',
normal: 'Mild in-toeing and flexible flat feet are physiologic',
abnormalHints: ['Rigid flat foot (tarsal coalition)', 'Fixed metatarsus adductus', 'Persistent severe in-toeing (femoral anteversion, tibial torsion)'] },
{ name: 'Joint range of motion', technique: 'Passive range of hips, knees, ankles, shoulders, elbows, wrists.',
normal: 'Full symmetric range at all joints; no pain, crepitus, or swelling',
abnormalHints: ['Joint effusion (septic vs reactive)', 'Guarded motion', 'Asymmetric limitation'] },
{ name: 'Spine', technique: 'Inspect standing. Palpate midline. Observe symmetry of shoulders and hips.',
normal: 'Midline spine, symmetric shoulders and hips; mild lumbar lordosis is normal',
abnormalHints: ['Fixed scoliosis', 'Abnormal kyphosis', 'Palpable step-off', 'Pain with palpation'] }
{ name: 'Gait', steps: [
{ label: 'Base of support', method: 'Have child walk ~10 feet', normal: 'Wide-based initially, narrowing by 2y' },
{ label: 'Heel-strike', method: 'Observe foot contact pattern', normal: 'Heel-strike developing by 18mo, consistent by 2y' },
{ label: 'Arm swing', method: 'Observe reciprocal arm swing', normal: 'Reciprocal arm swing by 18mo' },
{ label: 'Symmetry', method: 'Watch both sides in stance and swing', normal: 'Symmetric stride length and cadence' }
], abnormalHints: ['Toe-walking past 2y (idiopathic vs CP vs DMD)', 'Limp (Legg-Calvé-Perthes, transient synovitis, trauma)', 'Wide-based ataxia'] },
{ name: 'Knee alignment', steps: [
{ label: 'Stand feet together', method: 'Feet/medial malleoli touching; inspect knees', normal: 'Genu varum resolving by 1824mo; mild genu valgum common by 23y' },
{ label: 'Intercondylar or intermalleolar distance', method: 'Measure if alignment appears abnormal', normal: '<5cm intercondylar (varum) or <8cm intermalleolar (valgum)' },
{ label: 'Symmetry', method: 'Compare sides', normal: 'Symmetric' }
], abnormalHints: ['Persistent varum past 2y', 'Severe valgum >8cm', 'Unilateral (Blount disease, rickets)'] },
{ name: 'Feet alignment', steps: [
{ label: 'In-toeing / out-toeing', method: 'Observe foot angle during gait', normal: 'Mild in-toeing common (tibial torsion, femoral anteversion)' },
{ label: 'Arch during stance', method: 'Stand flat, then on tiptoes', normal: 'Flexible flat foot that forms arch on tiptoe' },
{ label: 'Heel alignment', method: 'View from behind standing', normal: 'Neutral or mildly valgus heel' }
], abnormalHints: ['Rigid flat foot (tarsal coalition)', 'Fixed metatarsus adductus', 'Severe in-toeing >15°'] },
{ name: 'Joint range', steps: [
{ label: 'Hips', method: 'Flex, abduct, rotate each hip', normal: 'Full symmetric range, no pain' },
{ label: 'Knees', method: 'Flex, extend; palpate for effusion', normal: 'Full range, no effusion, stable' },
{ label: 'Ankles', method: 'Dorsiflex, plantarflex, invert, evert', normal: 'Full range' },
{ label: 'Shoulders, elbows, wrists', method: 'Through full range each', normal: 'Full symmetric range' }
], abnormalHints: ['Joint effusion (septic vs reactive)', 'Guarded or painful motion', 'Asymmetric limitation'] },
{ name: 'Spine', steps: [
{ label: 'Inspect standing', method: 'View spine from behind', normal: 'Midline, no prominent curve' },
{ label: 'Palpate midline', method: 'Run finger along spinous processes', normal: 'Midline, no step-off, no tenderness' },
{ label: 'Shoulder/hip symmetry', method: 'Compare shoulder and hip heights', normal: 'Symmetric' }
], abnormalHints: ['Fixed scoliosis', 'Abnormal kyphosis', 'Asymmetric shoulder/hip', 'Midline tenderness'] }
]
},
neuro: {
overview: 'Focus: transition to adult-pattern exam. Primitive reflexes should be absent. Cooperation varies — use play-based techniques.',
overview: 'Shifting to adult-pattern exam. Primitive reflexes should be absent. Use play-based techniques.',
components: [
{ name: 'Mental status', technique: 'Observe engagement, language use, ability to follow simple commands.',
normal: 'Alert, interactive, age-appropriate language and commands',
abnormalHints: ['Language regression', 'Poor engagement', 'Repetitive behaviors (developmental concern)'] },
{ name: 'Cranial nerves', technique: 'Follow finger or toy for EOMs; smile/grimace for facial symmetry; open mouth and tongue protrusion.',
normal: 'EOMs intact; symmetric face; tongue midline',
abnormalHints: ['Strabismus', 'Facial asymmetry', 'Tongue deviation'] },
{ name: 'Motor — tone and bulk', technique: 'Passive range all four extremities; observe bulk.',
normal: 'Normal tone and bulk throughout; no contractures',
abnormalHints: ['Hypotonia', 'Spasticity (especially catch in lower extremities)', 'Muscle wasting'] },
{ name: 'Motor — strength (functional)', technique: 'Observe rising from floor (Gowers maneuver), climbing, squatting.',
normal: 'Rises from floor without Gowers; climbs onto furniture without difficulty',
abnormalHints: ['Gowers sign (proximal weakness — Duchenne muscular dystrophy)', 'Inability to climb at expected age'] },
{ name: 'Deep tendon reflexes', technique: 'Patellar, biceps with distraction (toy). Achilles if tolerated.',
normal: '2+ symmetric DTRs throughout',
abnormalHints: ['Hyperreflexia / clonus (UMN)', 'Absent reflexes (LMN, neuropathy)'] },
{ name: 'Coordination / gait', technique: 'Observe walking, running, climbing stairs, kicking ball if age-appropriate.',
normal: 'Age-appropriate coordination; able to run, climb stairs with rail',
abnormalHints: ['Ataxic gait', 'Tremor with action', 'Clumsiness beyond age expectation'] },
{ name: 'Plantar response', technique: 'Stroke lateral sole from heel toward toes.',
normal: 'Down-going (plantar flexion) by age 2',
abnormalHints: ['Up-going after age 2 is an upper-motor-neuron sign (Babinski positive)'] }
{ name: 'Mental status and language', steps: [
{ label: 'Engagement', method: 'Interaction with examiner/parent', normal: 'Alert, interactive, age-appropriate' },
{ label: 'Language — expressive', method: 'Note spontaneous utterances', normal: '1y: 13 words; 2y: 2-word phrases; 3y: short sentences' },
{ label: 'Language — receptive', method: 'Ask to point to body parts or follow simple commands', normal: 'Follows age-appropriate commands' }
], abnormalHints: ['Language regression (autism, epileptic encephalopathy)', 'Poor engagement', 'No 2-word phrases by 2y'] },
{ name: 'Cranial nerves', steps: [
{ label: 'CN II — pupil response', method: 'Shine light each eye', normal: 'Pupils equal reactive' },
{ label: 'CN III, IV, VI — EOM', method: 'Follow toy in H pattern', normal: 'Full smooth tracking, no strabismus' },
{ label: 'CN V — facial sensation', method: 'Light touch on forehead, cheek, jaw', normal: 'Responds to touch, symmetric' },
{ label: 'CN VII — face', method: 'Elicit smile, watch eye closure during cry', normal: 'Symmetric face' },
{ label: 'CN IX, X, XII — mouth', method: 'Say "ahh"; stick out tongue', normal: 'Palate rises symmetrically; tongue midline' }
], abnormalHints: ['Strabismus', 'Facial asymmetry', 'Tongue deviation', 'Absent palate elevation'] },
{ name: 'Motor — tone and bulk', steps: [
{ label: 'Passive tone', method: 'Move each limb through full range', normal: 'Normal resistance throughout' },
{ label: 'Bulk inspection', method: 'Inspect muscle bulk of thighs, calves, glutes', normal: 'Symmetric, age-appropriate bulk' },
{ label: 'Contracture check', method: 'Test for heel-cord tightness, hamstring tightness', normal: 'No contractures' }
], abnormalHints: ['Spasticity (especially catch in ankles)', 'Hypotonia', 'Calf pseudo-hypertrophy (DMD)'] },
{ name: 'Motor — functional strength', steps: [
{ label: 'Rising from floor', method: 'Place flat on back; ask to stand up', normal: 'Rises without using hands to push off thighs (no Gowers)' },
{ label: 'Climbing stairs', method: 'Observe or history', normal: 'Climbs holding rail' },
{ label: 'Squatting/getting up', method: 'Encourage via play', normal: 'Squats and rises without help' }
], abnormalHints: ['Gowers sign (proximal weakness — DMD)', 'Unable to climb stairs at age expected', 'Calf pain on walking (myositis)'] },
{ name: 'Deep tendon reflexes', steps: [
{ label: 'Patellar', method: 'Sitting or supine with distraction (toy)', normal: '2+ symmetric' },
{ label: 'Biceps', method: 'Arm at rest, strike thumb on tendon', normal: '2+ symmetric' },
{ label: 'Achilles', method: 'With distraction', normal: '2+ symmetric' }
], abnormalHints: ['Hyperreflexia or clonus (UMN, CP)', 'Absent reflexes (LMN, neuropathy)', 'Asymmetry'] },
{ name: 'Coordination and gait', steps: [
{ label: 'Run', method: 'Watch run ~10 feet', normal: 'Runs with reciprocal arm swing by 2y' },
{ label: 'Stairs', method: 'Observe', normal: 'Climbs with rail' },
{ label: 'Kick ball', method: 'Place ball; observe kick', normal: 'Kicks by 2y' },
{ label: 'Ataxia check', method: 'Watch for fluency of movement', normal: 'Smooth, no tremor' }
], abnormalHints: ['Ataxic gait', 'Intention tremor', 'Clumsiness beyond age'] },
{ name: 'Plantar response', steps: [
{ label: 'Stroke lateral sole', method: 'Firm stroke from heel to toes', normal: 'Down-going great toe (plantar flexion) by age 2' }
], abnormalHints: ['Up-going toe after age 2 = UMN sign (Babinski positive)'] }
]
}
},
@ -174,49 +274,101 @@
preschool: {
label: 'Preschool (35 years)',
msk: {
overview: 'Focus: functional gait maneuvers, scoliosis screen, and resolving physiologic alignment.',
overview: 'Functional gait maneuvers, scoliosis screen, resolving physiologic alignment.',
components: [
{ name: 'Gait (normal, heel, toe, tandem)', technique: 'Have child walk normally, on heels, on toes, heel-to-toe. Hop on one foot (4y+).',
normal: 'Symmetric smooth gait; able to heel-walk, toe-walk, and tandem; hops on one foot by 45y',
abnormalHints: ['Persistent toe-walking', 'Asymmetric stance', 'Difficulty with tandem'] },
{ name: 'Alignment', technique: 'Stand barefoot. Check knees, feet alignment.',
normal: 'Mild residual genu valgum resolving; neutral by 67y; medial arch developing',
abnormalHints: ['Persistent unilateral varum', 'Rigid flat foot'] },
{ name: 'Scoliosis screen (Adam forward-bend)', technique: 'Child bends forward at waist, arms hanging. Observe for rib or lumbar hump.',
normal: 'Symmetric paraspinal contour; no rib hump or lumbar prominence',
abnormalHints: ['Rib hump (thoracic scoliosis)', 'Asymmetric shoulder / scapular height', 'Leg-length discrepancy causing apparent curve'] },
{ name: 'Joint range and stability', technique: 'Active and passive range all joints. Check knee stability, elbow carrying angle.',
normal: 'Full symmetric range; stable joints; normal carrying angle',
abnormalHints: ['Hypermobility (Beighton score)', 'Joint effusion', 'Pain with motion'] },
{ name: 'Feet', technique: 'Stand and on tiptoes. Observe arch formation.',
normal: 'Flexible flat feet common; arch forms on tiptoe (flexible); symmetric',
abnormalHints: ['Rigid flat foot (does not form arch on tiptoe)', 'Pain'] }
{ name: 'Gait — multiple patterns', steps: [
{ label: 'Normal gait', method: 'Walk ~15 feet barefoot', normal: 'Symmetric, smooth, reciprocal arm swing' },
{ label: 'Heel walking', method: 'Walk on heels only', normal: 'Able by 4y' },
{ label: 'Toe walking', method: 'Walk on toes only', normal: 'Able by 4y' },
{ label: 'Tandem walking', method: 'Heel-to-toe along a line for 5 steps', normal: 'Able by 4y with minimal deviation' },
{ label: 'Hopping', method: 'Hop on one foot', normal: '35 hops on preferred foot by 4y' }
], abnormalHints: ['Persistent toe-walking', 'Asymmetric stance/stride', 'Difficulty with any pattern'] },
{ name: 'Alignment', steps: [
{ label: 'Knee alignment', method: 'Stand feet together', normal: 'Mild residual valgus resolving; neutral by 67y' },
{ label: 'Foot arch', method: 'Standing, then tiptoe', normal: 'Arch forms on tiptoe (flexible flat foot)' },
{ label: 'Heel position', method: 'View from behind standing', normal: 'Neutral or mild valgus' }
], abnormalHints: ['Persistent unilateral varum', 'Rigid flat foot (no arch on tiptoe)', 'Pes cavus'] },
{ name: 'Scoliosis screen (Adam forward-bend)', steps: [
{ label: 'Position', method: 'Feet together, bend forward at waist, arms hanging, palms together', normal: 'Arms and head relaxed' },
{ label: 'View from behind', method: 'Examiner at same height; look along back', normal: 'Symmetric paraspinal contour' },
{ label: 'View from side', method: 'Side view for kyphosis', normal: 'Smooth thoracic curve' }
], abnormalHints: ['Rib hump (thoracic scoliosis)', 'Lumbar prominence', 'Asymmetric scapular height'] },
{ name: 'Joint range and stability', steps: [
{ label: 'Active range', method: 'Ask to perform full range at hips, knees, ankles, shoulders, elbows, wrists', normal: 'Full symmetric range, no pain' },
{ label: 'Knee stability', method: 'Palpate for effusion; assess stability if complaint', normal: 'Stable, no effusion' },
{ label: 'Carrying angle (elbows)', method: 'Arms at sides, palms forward', normal: 'Normal valgus carrying angle' }
], abnormalHints: ['Joint hypermobility (Beighton score)', 'Effusion', 'Pain with motion', 'Valgus >15°'] },
{ name: 'Feet', steps: [
{ label: 'Standing inspection', method: 'View from front and behind', normal: 'Symmetric feet, neutral heel, flexible flat feet common' },
{ label: 'Tiptoe', method: 'Stand on tiptoes', normal: 'Arch forms, symmetric' },
{ label: 'Pes planus vs cavus', method: 'Note arch height', normal: 'Flexible flat foot or mild arch' }
], abnormalHints: ['Rigid flat foot', 'Pes cavus (Charcot-Marie-Tooth)', 'Pain'] }
]
},
neuro: {
overview: 'Focus: more formal exam now possible — most 4- and 5-year-olds cooperate with cranial nerves, strength, coordination, and sensory testing.',
overview: 'Formal pediatric neuro exam now feasible — most 4- and 5-year-olds cooperate with structured testing.',
components: [
{ name: 'Mental status / language', technique: 'Observe speech intelligibility, complexity, and ability to follow 2- and 3-step commands.',
normal: 'Speech clear to strangers by 4y; complex sentences; follows multi-step commands',
abnormalHints: ['Dysarthria', 'Receptive or expressive language delay', 'Poor engagement'] },
{ name: 'Cranial nerves (IIXII)', technique: 'Vision by charts if age-appropriate; EOMs with toy; facial sensation with light touch; symmetric smile; tongue protrusion; shoulder shrug; uvula elevation.',
normal: 'Intact throughout',
abnormalHints: ['Strabismus', 'Facial asymmetry', 'Uvula deviation', 'Tongue fasciculations'] },
{ name: 'Motor — tone, bulk, strength', technique: 'Passive range. Test 5/5 strength in major groups (stand from squat, grip squeeze, arm lift against resistance).',
normal: 'Normal tone and bulk; 5/5 strength symmetrically',
abnormalHints: ['Spasticity', 'Weakness (Gowers if proximal)', 'Atrophy'] },
{ name: 'Deep tendon reflexes', technique: 'Biceps, patellar, Achilles. Compare side to side.',
normal: '2+ symmetric DTRs throughout; down-going plantar response bilaterally',
abnormalHints: ['Hyperreflexia with clonus', 'Asymmetry', 'Up-going plantar (Babinski)'] },
{ name: 'Coordination', technique: 'Finger-to-nose, heel-to-shin, rapid alternating hand movements, tandem walk.',
normal: 'Smooth finger-to-nose, intact tandem; rapid alternating movements coordinated',
abnormalHints: ['Dysmetria', 'Dysdiadochokinesia', 'Ataxic tandem'] },
{ name: 'Sensory (light touch)', technique: 'Light touch distally on all four extremities with eyes closed (if cooperative).',
normal: 'Symmetric light touch throughout',
abnormalHints: ['Focal sensory loss', 'Stocking-glove pattern'] },
{ name: 'Gait (multiple patterns)', technique: 'Normal, heel, toe, tandem, hop on one foot, Romberg (5y+).',
normal: 'All maneuvers performed without difficulty',
abnormalHints: ['Romberg positive (dorsal column)', 'Ataxic tandem (cerebellar)'] }
{ name: 'Mental status and language', steps: [
{ label: 'Orientation (age-appropriate)', method: 'Ask name, age, where you are', normal: 'Knows name and age by 3y; location by 45y' },
{ label: 'Speech intelligibility', method: 'Listen to spontaneous speech', normal: 'Strangers understand by 4y' },
{ label: 'Receptive language', method: '2- and 3-step commands', normal: 'Follows 3-step commands by 45y' }
], abnormalHints: ['Dysarthria', 'Expressive or receptive language delay', 'Inattention'] },
{ name: 'Cranial nerves (IIXII)', steps: [
{ label: 'CN II — visual acuity', method: 'HOTV chart or pictures at 10ft, each eye', normal: '20/30 or better by 4y; 20/25 by 5y' },
{ label: 'CN II — visual fields', method: 'Confrontation with toys from periphery', normal: 'Full fields' },
{ label: 'CN II — pupils', method: 'Light response each eye', normal: 'PERRL' },
{ label: 'CN III, IV, VI — EOM', method: 'Follow toy in H pattern; include convergence', normal: 'Full EOM, convergence present' },
{ label: 'CN V — sensation', method: 'Light touch forehead, cheek, jaw each side', normal: 'Intact, symmetric' },
{ label: 'CN V — motor', method: 'Clench teeth, palpate masseter', normal: 'Symmetric strong bulk' },
{ label: 'CN VII — face', method: 'Smile, wrinkle forehead, close eyes, puff cheeks', normal: 'Symmetric movement of all regions' },
{ label: 'CN VIII — hearing', method: 'Finger rub each ear or whispered words', normal: 'Intact bilaterally' },
{ label: 'CN IX, X — palate', method: 'Open mouth, say "ahh"', normal: 'Palate rises symmetrically, uvula midline' },
{ label: 'CN XI — SCM/trapezius', method: 'Shrug shoulders, turn head against resistance', normal: 'Symmetric strength' },
{ label: 'CN XII — tongue', method: 'Stick tongue out, move side to side', normal: 'Midline, no atrophy, full movement' }
], abnormalHints: ['Strabismus (amblyopia risk)', 'Facial weakness', 'Tongue deviation/fasciculations', 'Uvula off-midline'] },
{ name: 'Motor — tone, bulk, strength', steps: [
{ label: 'Tone inspection', method: 'Passive range all four limbs', normal: 'Normal tone throughout' },
{ label: 'Bulk inspection', method: 'Observe muscle bulk symmetry', normal: 'Symmetric, age-appropriate' },
{ label: 'Strength — shoulder abduction', method: 'Arms out, push down against resistance', normal: '5/5 bilaterally' },
{ label: 'Strength — elbow flexion', method: 'Flex elbow against resistance', normal: '5/5 bilaterally' },
{ label: 'Strength — grip', method: 'Squeeze examiner\'s fingers', normal: '5/5 symmetric' },
{ label: 'Strength — hip flexion', method: 'Lift leg off table against resistance', normal: '5/5 bilaterally' },
{ label: 'Strength — knee extension', method: 'Straighten knee against resistance', normal: '5/5 bilaterally' },
{ label: 'Strength — dorsiflexion', method: 'Pull toes up against resistance', normal: '5/5 bilaterally' }
], abnormalHints: ['Focal weakness', 'Gowers sign', 'Pseudohypertrophy (DMD)', 'Atrophy'] },
{ name: 'Deep tendon reflexes', steps: [
{ label: 'Biceps', method: 'Thumb on biceps tendon, strike', normal: '2+ symmetric' },
{ label: 'Patellar', method: 'Knees hanging, strike patellar tendon', normal: '2+ symmetric' },
{ label: 'Achilles', method: 'Slight dorsiflexion, strike Achilles tendon', normal: '2+ symmetric' },
{ label: 'Plantar response', method: 'Stroke lateral sole heel-to-toes', normal: 'Down-going great toe' }
], abnormalHints: ['Hyperreflexia or clonus (UMN)', 'Hyporeflexia (LMN)', 'Up-going plantar (Babinski — abnormal past 2y)', 'Asymmetry'] },
{ name: 'Coordination', steps: [
{ label: 'Finger-to-nose', method: 'Touch examiner\'s finger then own nose, repeat', normal: 'Smooth, no dysmetria' },
{ label: 'Heel-to-shin', method: 'Run heel down opposite shin', normal: 'Smooth bilaterally' },
{ label: 'Rapid alternating movements', method: 'Tap palm with opposite hand alternating palm/back', normal: 'Rhythmic, symmetric' },
{ label: 'Tandem walk', method: 'Heel-to-toe for 5 steps', normal: 'Minimal deviation' }
], abnormalHints: ['Dysmetria', 'Dysdiadochokinesia', 'Intention tremor', 'Ataxic tandem'] },
{ name: 'Sensory', steps: [
{ label: 'Light touch — hands', method: 'Cotton wisp on palm/dorsum, eyes closed', normal: 'Feels each touch' },
{ label: 'Light touch — feet', method: 'Same on dorsum of foot bilaterally', normal: 'Feels each touch' }
], abnormalHints: ['Focal sensory loss', 'Stocking-glove loss'] },
{ name: 'Gait and Romberg', steps: [
{ label: 'Normal gait', method: 'Walk ~20 feet', normal: 'Smooth, symmetric' },
{ label: 'Heel walk', method: 'Walk on heels', normal: 'Able without difficulty' },
{ label: 'Toe walk', method: 'Walk on toes', normal: 'Able without difficulty' },
{ label: 'Tandem', method: 'Heel-to-toe', normal: 'Intact' },
{ label: 'Romberg (5y+)', method: 'Feet together, eyes closed, stand 10s', normal: 'Stable without sway' }
], abnormalHints: ['Ataxic gait (cerebellar)', 'Romberg positive (dorsal column)', 'Circumduction (UMN)'] }
]
}
},
@ -224,49 +376,116 @@
school: {
label: 'School-age (611 years)',
msk: {
overview: 'Focus: scoliosis screening (especially peri-puberty), sports-related overuse, and resolution of alignment.',
overview: 'Scoliosis screening peri-puberty, sports overuse injuries, resolving alignment.',
components: [
{ name: 'Scoliosis screen (forward-bend)', technique: 'Adam forward-bend test. Consider scoliometer if available (angle of trunk rotation).',
normal: 'No rib or lumbar prominence; ATR < 5°; symmetric shoulders and hips',
abnormalHints: ['Rib hump', 'ATR ≥ 7° warrants referral', 'Shoulder or scapular asymmetry'] },
{ name: 'Alignment', technique: 'Standing exam of knees and feet.',
normal: 'Neutral knee alignment; medial arch present; symmetric',
abnormalHints: ['Residual valgum', 'Pes cavus (possible CMT)', 'Asymmetric alignment'] },
{ name: 'Joint stability and range', technique: 'Active range all joints. Knee Lachman/anterior drawer if sports-active. Shoulder impingement tests.',
normal: 'Full stable range at all joints',
abnormalHints: ['Joint laxity or hypermobility', 'Sports-related instability', 'Pain with specific maneuvers'] },
{ name: 'Gait and functional movement', technique: 'Observe gait, running, squatting, single-leg stance.',
normal: 'Symmetric efficient gait; able to squat and single-leg stand',
abnormalHints: ['Trendelenburg sign (hip abductor weakness)', 'Antalgic gait', 'Asymmetric squat depth'] },
{ name: 'Sports-specific exam (if relevant)', technique: 'Targeted to activity — shoulder, knee, ankle per chief complaint.',
normal: 'No pain, instability, or impingement in tested maneuvers',
abnormalHints: ['Overuse injury signs (Osgood-Schlatter, Sever, osteochondritis dissecans)', 'Apophysitis'] }
{ name: 'Scoliosis screen (forward-bend + scoliometer)', steps: [
{ label: 'Standing inspection', method: 'Shoulders and iliac crest heights', normal: 'Symmetric shoulder and pelvic heights' },
{ label: 'Forward bend (Adam test)', method: 'Feet together, bend forward at waist, arms hanging palms together', normal: 'Symmetric paraspinal contour' },
{ label: 'Rib hump', method: 'View tangentially from behind at level of curve', normal: 'No rib hump' },
{ label: 'Lumbar prominence', method: 'Same view at lumbar level', normal: 'No prominence' },
{ label: 'Scoliometer (if available)', method: 'Place scoliometer across rib hump, read angle of trunk rotation', normal: 'ATR < 5°; ≥7° → refer' }
], abnormalHints: ['Rib hump', 'ATR ≥7°', 'Asymmetric shoulders or pelvis', 'Decompensation (plumb line offset)'] },
{ name: 'Back and spine', steps: [
{ label: 'Posture inspection', method: 'Standing, view front/back/side', normal: 'Normal spinal curves; plumb line centered' },
{ label: 'Palpate spinous processes', method: 'From C2 to S1', normal: 'No tenderness, no step-off' },
{ label: 'Range of motion', method: 'Flex, extend, lateral bend, rotate', normal: 'Full painless range' }
], abnormalHints: ['Midline tenderness', 'Step-off (spondylolisthesis)', 'Limited motion with pain'] },
{ name: 'Alignment', steps: [
{ label: 'Knees', method: 'Feet together, inspect', normal: 'Neutral alignment by 67y' },
{ label: 'Feet', method: 'Stand, then tiptoes', normal: 'Medial arch present, symmetric' },
{ label: 'Leg lengths', method: 'Supine, measure ASIS to medial malleolus if asymmetric', normal: 'Equal within 1cm' }
], abnormalHints: ['Residual valgum', 'Pes cavus', 'Leg-length discrepancy >1cm'] },
{ name: 'Joint stability and sports exam (if active)', steps: [
{ label: 'Active range all joints', method: 'Through full range', normal: 'Full symmetric range, no pain or crepitus' },
{ label: 'Knee — Lachman (if sports-active)', method: 'Knee 20° flexion, stabilize femur, pull tibia forward', normal: 'Firm endpoint, no laxity' },
{ label: 'Knee — McMurray', method: 'Flexed knee, rotate tibia while extending', normal: 'No pain or click' },
{ label: 'Shoulder — impingement (Neer/Hawkins)', method: 'Passive shoulder flexion with arm in internal rotation', normal: 'No pain' },
{ label: 'Ankle stability', method: 'Anterior drawer and talar tilt', normal: 'No laxity' }
], abnormalHints: ['ACL laxity (positive Lachman)', 'Meniscal click', 'Shoulder impingement', 'Ankle instability'] },
{ name: 'Gait and functional movement', steps: [
{ label: 'Normal gait', method: 'Walk 20 feet', normal: 'Smooth, symmetric' },
{ label: 'Single-leg stance', method: 'Stand on one foot 10s each side', normal: 'Stable without Trendelenburg drop' },
{ label: 'Squat', method: 'Full squat and rise', normal: 'Full squat without pain or asymmetry' },
{ label: 'Hop on one foot', method: '5 hops each side', normal: 'Able and symmetric' }
], abnormalHints: ['Trendelenburg sign (hip abductor weakness)', 'Antalgic gait', 'Asymmetric squat', 'Pain with hop'] }
]
},
neuro: {
overview: 'Focus: adult-pattern exam across all six components (mental status, cranial nerves, motor, reflexes, sensory, coordination/gait).',
overview: 'Adult-pattern six-component exam: mental status, CN, motor, reflexes, sensory, coordination/gait.',
components: [
{ name: 'Mental status', technique: 'Orientation, attention (count backward), memory (3-item recall), appropriate language.',
normal: 'Alert, oriented, attention intact, age-appropriate language',
abnormalHints: ['Inattention / ADHD signs', 'Language concerns', 'Memory deficit'] },
{ name: 'Cranial nerves (IIXII)', technique: 'Full formal exam including visual fields, EOMs, facial sensation, hearing, palate elevation, tongue.',
normal: 'All cranial nerves intact',
abnormalHints: ['Any focal cranial nerve deficit warrants workup'] },
{ name: 'Motor', technique: 'Inspect bulk; test tone; strength 5/5 in major groups (deltoids, biceps, triceps, grip, hip flexors, knee extensors, dorsiflexion).',
normal: 'Normal bulk and tone; 5/5 strength symmetric',
abnormalHints: ['Focal weakness', 'Spasticity', 'Atrophy'] },
{ name: 'Deep tendon reflexes', technique: 'Biceps, triceps, brachioradialis, patellar, Achilles. Plantar response.',
normal: '2+ symmetric DTRs; down-going plantar',
abnormalHints: ['Hyperreflexia with clonus (UMN)', 'Hyporeflexia (LMN, neuropathy)', 'Asymmetry', 'Up-going Babinski'] },
{ name: 'Sensory', technique: 'Light touch and pain distally; vibration at distal IP joints; proprioception at great toe.',
normal: 'Intact light touch, pain, vibration, proprioception throughout',
abnormalHints: ['Stocking-glove loss', 'Dermatomal pattern', 'Loss of vibration or proprioception (dorsal column)'] },
{ name: 'Coordination', technique: 'Finger-nose-finger, heel-shin, rapid alternating movements.',
normal: 'Smooth coordinated movements bilaterally',
abnormalHints: ['Dysmetria', 'Intention tremor', 'Dysdiadochokinesia'] },
{ name: 'Gait and Romberg', technique: 'Normal, heel, toe, tandem. Romberg with eyes closed.',
normal: 'All gait patterns smooth and symmetric; Romberg negative',
abnormalHints: ['Wide-based gait (cerebellar)', 'Steppage (peripheral neuropathy)', 'Romberg positive (dorsal column)'] }
{ name: 'Mental status', steps: [
{ label: 'Orientation', method: 'Name, age, school, city, day of week', normal: 'Oriented x 4' },
{ label: 'Attention', method: 'Count backward from 20; days of week backward', normal: 'Intact' },
{ label: '3-item recall', method: 'Ball-flag-tree; ask at 3 and 5 min', normal: '3/3 recall at 5 min' },
{ label: 'Language', method: 'Name common objects; repeat a sentence', normal: 'Fluent, no paraphasia' }
], abnormalHints: ['Inattention (ADHD features)', 'Memory deficits', 'Word-finding difficulty', 'Perseveration'] },
{ name: 'Cranial nerves (IIXII)', steps: [
{ label: 'CN II — acuity', method: 'Snellen at 20ft each eye with corrective lenses if worn', normal: '20/20 or baseline' },
{ label: 'CN II — fields', method: 'Confrontation, 4 quadrants each eye', normal: 'Full fields' },
{ label: 'CN II — fundoscopy (if indicated)', method: 'Direct ophthalmoscopy — disc, vessels, macula', normal: 'Sharp disc, normal cup-disc ratio, no papilledema' },
{ label: 'CN II, III — pupils', method: 'Direct and consensual light, accommodation', normal: 'PERRLA' },
{ label: 'CN III, IV, VI — EOM', method: 'Follow finger in H pattern; convergence', normal: 'Full EOM, no nystagmus, convergence intact' },
{ label: 'CN V — sensation', method: 'Light touch V1 (forehead), V2 (cheek), V3 (jaw) each side', normal: 'Intact, symmetric' },
{ label: 'CN V — motor', method: 'Clench teeth, palpate masseter/temporalis; jaw opening', normal: 'Symmetric strength' },
{ label: 'CN VII', method: 'Raise eyebrows, close eyes tight, smile/show teeth, puff cheeks', normal: 'Symmetric movement, all regions' },
{ label: 'CN VIII', method: 'Finger rub each ear; Weber/Rinne if deficit', normal: 'Hears bilaterally' },
{ label: 'CN IX, X', method: 'Palate elevation with "ahh"; uvula midline; voice quality', normal: 'Symmetric elevation, uvula midline, normal voice' },
{ label: 'CN XI', method: 'Shrug shoulders against resistance; head turn against resistance', normal: '5/5 SCM and trapezius' },
{ label: 'CN XII', method: 'Stick tongue out; side-to-side', normal: 'Midline, no atrophy or fasciculations' }
], abnormalHints: ['Papilledema (increased ICP)', 'Focal cranial nerve deficit — any warrants workup', 'Tongue fasciculations (LMN/MND)'] },
{ name: 'Motor — bulk, tone, strength', steps: [
{ label: 'Bulk inspection', method: 'Shoulders, thighs, calves, intrinsic hand muscles', normal: 'Symmetric, no atrophy' },
{ label: 'Tone', method: 'Passive range at elbows, wrists, knees, ankles', normal: 'Normal resistance throughout' },
{ label: 'Strength — deltoids', method: 'Shoulder abduction against resistance', normal: '5/5 bilaterally' },
{ label: 'Strength — biceps', method: 'Elbow flexion against resistance', normal: '5/5' },
{ label: 'Strength — triceps', method: 'Elbow extension against resistance', normal: '5/5' },
{ label: 'Strength — grip', method: 'Squeeze 2 fingers', normal: '5/5 symmetric' },
{ label: 'Strength — finger abduction', method: 'Spread fingers against resistance', normal: '5/5' },
{ label: 'Strength — hip flexion', method: 'Lift leg supine against resistance', normal: '5/5' },
{ label: 'Strength — knee extension', method: 'Straighten knee against resistance', normal: '5/5' },
{ label: 'Strength — dorsiflexion', method: 'Pull toes up against resistance', normal: '5/5' },
{ label: 'Strength — plantarflexion', method: 'Push foot down against resistance', normal: '5/5' }
], abnormalHints: ['Focal weakness (localize)', 'Spasticity (UMN)', 'Atrophy', 'Fasciculations'] },
{ name: 'Deep tendon reflexes', steps: [
{ label: 'Biceps (C5-C6)', method: 'Thumb on tendon, strike', normal: '2+ symmetric' },
{ label: 'Triceps (C7-C8)', method: 'Strike triceps tendon', normal: '2+ symmetric' },
{ label: 'Brachioradialis (C5-C6)', method: 'Strike distal radius', normal: '2+ symmetric' },
{ label: 'Patellar (L3-L4)', method: 'Knees hanging, strike tendon', normal: '2+ symmetric' },
{ label: 'Achilles (S1)', method: 'Slight dorsiflexion, strike tendon', normal: '2+ symmetric' },
{ label: 'Plantar response', method: 'Stroke lateral sole heel-to-toes', normal: 'Down-going bilaterally' },
{ label: 'Clonus', method: 'Rapid dorsiflexion at ankle', normal: 'No sustained clonus' }
], abnormalHints: ['Hyperreflexia with clonus (UMN: stroke, MS, cord lesion)', 'Hyporeflexia (LMN, neuropathy, myopathy)', 'Asymmetry', 'Up-going Babinski', 'Sustained clonus'] },
{ name: 'Sensory', steps: [
{ label: 'Light touch — upper', method: 'Cotton wisp dorsum of hands, eyes closed', normal: 'Intact, symmetric' },
{ label: 'Light touch — lower', method: 'Same on dorsum of feet', normal: 'Intact, symmetric' },
{ label: 'Pain — upper', method: 'Broken Q-tip or pin on hands', normal: 'Intact, symmetric' },
{ label: 'Pain — lower', method: 'Same on feet', normal: 'Intact, symmetric' },
{ label: 'Vibration', method: '128 Hz tuning fork at distal IP joint of great toes', normal: 'Feels vibration; counts down seconds' },
{ label: 'Proprioception', method: 'Move great toe up/down with eyes closed', normal: 'Identifies direction correctly' }
], abnormalHints: ['Dermatomal loss (nerve root)', 'Stocking-glove (neuropathy)', 'Loss of vibration/proprioception (dorsal column — B12, tabes, MS)'] },
{ name: 'Coordination', steps: [
{ label: 'Finger-nose-finger', method: 'Touch examiner finger then own nose, examiner moves target', normal: 'Smooth, accurate, no dysmetria' },
{ label: 'Heel-to-shin', method: 'Supine: heel down opposite shin', normal: 'Smooth, on-target' },
{ label: 'Rapid alternating movements', method: 'Supinate/pronate hand on knee rapidly', normal: 'Rhythmic, symmetric' },
{ label: 'Fine motor', method: 'Finger tapping (thumb to each finger in sequence)', normal: 'Rhythmic, accurate' }
], abnormalHints: ['Dysmetria (past-pointing, overshoot)', 'Intention tremor', 'Dysdiadochokinesia'] },
{ name: 'Gait and Romberg', steps: [
{ label: 'Normal gait', method: 'Walk 20 feet', normal: 'Narrow-based, smooth, reciprocal arm swing' },
{ label: 'Heel walk', method: 'Walk on heels', normal: 'Able without difficulty' },
{ label: 'Toe walk', method: 'Walk on toes', normal: 'Able without difficulty' },
{ label: 'Tandem', method: 'Heel-to-toe along a line', normal: 'Minimal deviation, 10+ steps' },
{ label: 'Romberg', method: 'Feet together, eyes closed, 30s', normal: 'Stable without fall or significant sway' }
], abnormalHints: ['Wide-based (cerebellar)', 'Steppage (peripheral neuropathy)', 'Scissoring (UMN)', 'Romberg positive (dorsal column)', 'Circumduction'] }
]
}
},
@ -274,62 +493,158 @@
adolescent: {
label: 'Adolescent (1221 years)',
msk: {
overview: 'Focus: sports-related injuries, late-onset scoliosis, apophyseal overuse injuries, and screening for hypermobility spectrum.',
overview: 'Sports-related injuries, adolescent scoliosis, apophyseal overuse, hypermobility screening.',
components: [
{ name: 'Scoliosis screen', technique: 'Adam forward-bend with scoliometer if available. Consider recurrent screening through adolescent growth spurt.',
normal: 'No rib or lumbar prominence; ATR < 5°',
abnormalHints: ['Progressive scoliosis (especially girls 1014)', 'ATR ≥ 7°', 'Shoulder asymmetry'] },
{ name: 'Back / spine', technique: 'Palpate midline and paraspinal muscles. Single-leg hyperextension test if back pain present (spondylolysis).',
normal: 'Non-tender spine and paraspinals; no pain with hyperextension',
abnormalHints: ['Midline tenderness (spondylolysis/spondylolisthesis)', 'Positive stork test', 'Radicular symptoms'] },
{ name: 'Joint stability and sports-specific exam', technique: 'Shoulder, knee, ankle exams per activity and complaint. Beighton score if hypermobile presentation.',
normal: 'Stable joints; no effusion; Beighton < 4',
abnormalHints: ['ACL/MCL laxity', 'Shoulder apprehension', 'Ankle instability', 'Beighton ≥ 5 (hypermobility spectrum)'] },
{ name: 'Alignment and gait', technique: 'Observe standing posture and walking.',
normal: 'Neutral alignment; symmetric efficient gait',
abnormalHints: ['Antalgic gait', 'Leg-length discrepancy', 'Trendelenburg'] },
{ name: 'Overuse / apophysitis screen', technique: 'Palpate tibial tubercle, calcaneal apophysis, iliac apophyses if sports-active.',
normal: 'Non-tender apophyses',
abnormalHints: ['Osgood-Schlatter (tibial tubercle)', 'Sever (calcaneal)', 'Iliac apophysitis in sprinters'] }
{ name: 'Scoliosis screen', steps: [
{ label: 'Standing inspection', method: 'Patient undressed to waist (keep privacy); compare shoulders, iliac crests, scapular heights', normal: 'Symmetric shoulders and pelvis' },
{ label: 'Forward bend (Adam)', method: 'Feet together, bend forward, arms hanging palms together', normal: 'Symmetric paraspinal contour' },
{ label: 'Scoliometer', method: 'Place across thoracic and lumbar regions at maximum prominence', normal: 'ATR <5°; 56° monitor; ≥7° refer' },
{ label: 'Plumb line check', method: 'Drop plumb from C7; note where it falls', normal: 'Passes through gluteal cleft (compensated)' },
{ label: 'Leg lengths', method: 'Supine; ASIS to medial malleolus each side', normal: 'Within 1cm' }
], abnormalHints: ['Rib/lumbar hump', 'ATR ≥7°', 'Decompensation (plumb off gluteal cleft)', 'Leg-length discrepancy driving apparent curve'] },
{ name: 'Back pain evaluation (if complaint)', steps: [
{ label: 'Inspect and palpate', method: 'Spinous processes, paraspinal muscles, SI joints', normal: 'Non-tender' },
{ label: 'Range of motion', method: 'Flex, extend, lateral bend, rotate', normal: 'Full painless range' },
{ label: 'Single-leg hyperextension (stork)', method: 'Stand on one foot, extend back — each side', normal: 'No pain (negative for spondylolysis)' },
{ label: 'Straight-leg raise', method: 'Supine, lift straight leg to 70°+', normal: 'No radicular pain to 70°' },
{ label: 'SI joint tests', method: 'FABER, SI compression', normal: 'No pain' }
], abnormalHints: ['Spondylolysis (positive stork test)', 'Radicular pain (disc herniation)', 'SI joint pathology', 'Inflammatory back pain pattern'] },
{ name: 'Joint stability — sports-specific', steps: [
{ label: 'Knee — Lachman', method: 'Knee 20° flexion, stabilize femur, pull tibia anteriorly', normal: 'Firm endpoint, no laxity (ACL intact)' },
{ label: 'Knee — anterior drawer', method: 'Knee 90°, pull tibia forward', normal: 'No excess anterior translation' },
{ label: 'Knee — varus/valgus stress', method: 'Stress at 0 and 30° flexion', normal: 'No gap opening (LCL/MCL intact)' },
{ label: 'Knee — McMurray', method: 'Flex, rotate tibia while extending', normal: 'No pain or click' },
{ label: 'Shoulder — apprehension', method: 'Abduct and externally rotate', normal: 'No apprehension' },
{ label: 'Shoulder — Neer/Hawkins', method: 'Passive flexion with internal rotation', normal: 'No pain' },
{ label: 'Ankle — anterior drawer', method: 'Pull heel forward with tibia stabilized', normal: 'No laxity' },
{ label: 'Ankle — talar tilt', method: 'Invert heel with tibia stabilized', normal: 'No excess tilt' }
], abnormalHints: ['ACL/PCL tear', 'MCL/LCL laxity', 'Meniscal injury', 'Shoulder instability/impingement', 'Ankle ligament laxity'] },
{ name: 'Apophysitis and overuse screen', steps: [
{ label: 'Tibial tubercle', method: 'Palpate with knee flexed', normal: 'Non-tender' },
{ label: 'Calcaneal apophysis', method: 'Palpate posterior calcaneus', normal: 'Non-tender' },
{ label: 'Iliac apophyses', method: 'Palpate ASIS, AIIS, iliac crest', normal: 'Non-tender' },
{ label: 'Rotator cuff', method: 'Empty-can (Jobe) test', normal: 'No pain or weakness' }
], abnormalHints: ['Osgood-Schlatter (tibial tubercle tender)', 'Sever (calcaneal tender)', 'Iliac apophysitis', 'Rotator cuff tendinopathy'] },
{ name: 'Hypermobility screen (Beighton)', steps: [
{ label: 'Fifth finger extension', method: 'Passive extension of fifth MCP to >90°', normal: 'No hyperextension (1 pt each side if positive)' },
{ label: 'Thumb to forearm', method: 'Passive flexion of thumb to touch forearm', normal: 'Does not reach (1 pt each side if positive)' },
{ label: 'Elbow hyperextension', method: 'Hyperextension >10°', normal: 'No hyperextension (1 pt each side if positive)' },
{ label: 'Knee hyperextension', method: 'Hyperextension >10°', normal: 'No hyperextension (1 pt each side if positive)' },
{ label: 'Palms to floor', method: 'Feet together, bend forward, palms flat on floor with knees straight', normal: 'Cannot reach (1 pt if positive)' }
], abnormalHints: ['Beighton ≥5/9 suggests hypermobility spectrum (hEDS workup if with other features)'] },
{ name: 'Alignment and gait', steps: [
{ label: 'Standing alignment', method: 'View knees, feet', normal: 'Neutral alignment, medial arch' },
{ label: 'Normal gait', method: 'Walk 20 feet', normal: 'Symmetric, smooth' },
{ label: 'Functional movements', method: 'Squat, single-leg stance, hop', normal: 'Full symmetric function' }
], abnormalHints: ['Antalgic gait', 'Trendelenburg', 'Asymmetric squat'] }
]
},
neuro: {
overview: 'Focus: adult-pattern full exam. Screen specifically for concussion sequelae if sports-active; frontal release signs should be absent.',
overview: 'Full adult-pattern neuro exam. Screen for concussion sequelae in sports-active adolescents; frontal release signs should be absent.',
components: [
{ name: 'Mental status', technique: 'Orientation, attention, memory, language, executive function (MMSE-style questions tailored to age).',
normal: 'Alert, oriented, attention/memory intact, age-appropriate executive function',
abnormalHints: ['Post-concussion cognitive symptoms', 'Mood changes', 'Subtle executive dysfunction'] },
{ name: 'Cranial nerves (IIXII)', technique: 'Full formal adult-pattern exam.',
normal: 'All cranial nerves intact',
abnormalHints: ['Any focal deficit'] },
{ name: 'Motor', technique: 'Bulk, tone, 5/5 strength in all major groups. Fine motor (finger tapping).',
normal: 'Normal bulk, tone, strength throughout',
abnormalHints: ['Focal weakness', 'Spasticity', 'Subtle tremor'] },
{ name: 'Deep tendon reflexes', technique: 'Biceps, triceps, brachioradialis, patellar, Achilles. Plantar response.',
normal: '2+ symmetric; down-going plantar',
abnormalHints: ['Hyperreflexia, clonus, or up-going Babinski (UMN)', 'Hyporeflexia (peripheral nerve, myopathy, hypothyroid)'] },
{ name: 'Sensory', technique: 'Light touch, pain, vibration, proprioception, two-point discrimination.',
normal: 'Intact modalities throughout',
abnormalHints: ['Dermatomal loss', 'Length-dependent sensory loss', 'Dorsal column signs'] },
{ name: 'Coordination', technique: 'Finger-nose-finger, heel-shin, rapid alternating, tandem gait.',
normal: 'Smooth coordinated movements; tandem intact',
abnormalHints: ['Cerebellar signs', 'Intention tremor'] },
{ name: 'Gait and Romberg', technique: 'Normal, heel, toe, tandem, Romberg.',
normal: 'All smooth; Romberg negative',
abnormalHints: ['Ataxic gait', 'Steppage', 'Romberg positive'] },
{ name: 'Frontal release / primitive reflexes', technique: 'Test grasp, snout, glabellar, palmomental. Should be absent.',
normal: 'Absent — no frontal release signs',
abnormalHints: ['Presence suggests frontal lobe pathology, neurodegenerative disease, or severe TBI — consider in post-concussion setting'] }
{ name: 'Mental status', steps: [
{ label: 'Orientation', method: 'Name, age, date, location, situation', normal: 'Oriented x 4' },
{ label: 'Attention', method: 'Count backward from 100 by 7s (serial 7s) or months of year backward', normal: 'Intact' },
{ label: 'Short-term memory', method: '3-item registration and recall at 5 min', normal: '3/3 recall' },
{ label: 'Language', method: 'Object naming; sentence repetition; reading; writing', normal: 'Fluent, no paraphasia, comprehends written and spoken' },
{ label: 'Executive function', method: 'Similarities (apple/orange); interpret proverb', normal: 'Abstract, age-appropriate' }
], abnormalHints: ['Post-concussion cognitive changes', 'Mood or personality changes', 'Subtle executive dysfunction', 'Word-finding difficulty'] },
{ name: 'Cranial nerves (IIXII, full formal exam)', steps: [
{ label: 'CN I (if indicated)', method: 'Coffee or cinnamon each nostril separately', normal: 'Identifies both' },
{ label: 'CN II — acuity', method: 'Snellen at 20ft each eye; corrective lenses if worn', normal: '20/20 or baseline' },
{ label: 'CN II — fields', method: 'Confrontation, 4 quadrants each eye', normal: 'Full fields' },
{ label: 'CN II — fundoscopy', method: 'Direct ophthalmoscopy — disc, vessels, macula', normal: 'Sharp disc, normal cup/disc, no papilledema' },
{ label: 'CN II, III — pupils', method: 'Direct, consensual, swinging flashlight, accommodation', normal: 'PERRLA, no RAPD' },
{ label: 'CN III, IV, VI — EOM', method: 'H pattern, convergence, note nystagmus or ptosis', normal: 'Full conjugate movement, no nystagmus, convergence intact' },
{ label: 'CN V — sensation', method: 'Light touch V1, V2, V3 each side', normal: 'Intact, symmetric' },
{ label: 'CN V — motor', method: 'Clench jaw, palpate masseter/temporalis; lateral jaw movement', normal: 'Symmetric strength and bulk' },
{ label: 'CN V — corneal reflex (if indicated)', method: 'Cotton wisp to cornea', normal: 'Blinks bilaterally' },
{ label: 'CN VII', method: 'Wrinkle forehead, close eyes against resistance, smile/bare teeth, puff cheeks', normal: 'Symmetric all four movements' },
{ label: 'CN VIII — hearing', method: 'Finger rub each ear; Weber (midline) + Rinne (air > bone) if deficit', normal: 'Equal bilaterally' },
{ label: 'CN IX, X', method: 'Palate elevation with "ahh"; uvula midline; voice; gag (if indicated)', normal: 'Symmetric palate, uvula midline, normal voice' },
{ label: 'CN XI', method: 'Shoulder shrug and head turn against resistance', normal: '5/5 SCM and trapezius bilaterally' },
{ label: 'CN XII', method: 'Tongue protrusion, side to side; inspect for fasciculations/atrophy', normal: 'Midline, no atrophy or fasciculations, full movement' }
], abnormalHints: ['Any focal cranial nerve deficit', 'Papilledema', 'RAPD', 'Nystagmus', 'Facial asymmetry', 'Tongue deviation'] },
{ name: 'Motor — bulk, tone, strength', steps: [
{ label: 'Bulk inspection', method: 'Shoulders, arms, thighs, calves, interossei', normal: 'Symmetric, no atrophy' },
{ label: 'Tone — upper', method: 'Passive range elbows, wrists; pronator drift test', normal: 'Normal tone, no drift' },
{ label: 'Tone — lower', method: 'Passive knee and ankle range', normal: 'Normal tone, no catch' },
{ label: 'Strength — deltoid (C5)', method: 'Shoulder abduction', normal: '5/5 bilaterally' },
{ label: 'Strength — biceps (C5-C6)', method: 'Elbow flexion', normal: '5/5' },
{ label: 'Strength — triceps (C7)', method: 'Elbow extension', normal: '5/5' },
{ label: 'Strength — wrist extension (C6-C7)', method: 'Dorsiflex wrist against resistance', normal: '5/5' },
{ label: 'Strength — finger flexion (C8)', method: 'Grip strength', normal: '5/5 symmetric' },
{ label: 'Strength — finger abduction (T1)', method: 'Spread fingers', normal: '5/5' },
{ label: 'Strength — hip flexion (L2-L3)', method: 'Lift thigh supine', normal: '5/5' },
{ label: 'Strength — knee extension (L3-L4)', method: 'Straighten knee', normal: '5/5' },
{ label: 'Strength — ankle dorsiflexion (L4-L5)', method: 'Pull toes up', normal: '5/5' },
{ label: 'Strength — great toe extension (L5)', method: 'Dorsiflex great toe against resistance', normal: '5/5' },
{ label: 'Strength — ankle plantarflexion (S1)', method: 'Push foot down; toe-walk', normal: '5/5 bilaterally' }
], abnormalHints: ['Focal weakness (localize by myotome)', 'Pronator drift (subtle UMN)', 'Spasticity', 'Atrophy', 'Fasciculations'] },
{ name: 'Deep tendon reflexes', steps: [
{ label: 'Biceps (C5-C6)', method: 'Thumb on tendon, strike', normal: '2+ symmetric' },
{ label: 'Brachioradialis (C5-C6)', method: 'Strike distal radius', normal: '2+ symmetric' },
{ label: 'Triceps (C7)', method: 'Strike triceps tendon', normal: '2+ symmetric' },
{ label: 'Finger flexors (Hoffmann)', method: 'Flick distal phalanx of middle finger', normal: 'No thumb flexion (negative Hoffmann)' },
{ label: 'Patellar (L3-L4)', method: 'Knees hanging, strike tendon', normal: '2+ symmetric' },
{ label: 'Achilles (S1)', method: 'Slight dorsiflexion, strike tendon', normal: '2+ symmetric' },
{ label: 'Plantar response (Babinski)', method: 'Stroke lateral sole heel to toes', normal: 'Down-going bilaterally' },
{ label: 'Ankle clonus', method: 'Rapid dorsiflexion', normal: 'No sustained clonus (≤3 beats)' }
], abnormalHints: ['Hyperreflexia with clonus (UMN: MS, myelopathy, cord lesion)', 'Hyporeflexia (GBS, neuropathy, myopathy, hypothyroid)', 'Asymmetry', 'Positive Hoffmann (corticospinal)', 'Up-going Babinski', 'Sustained clonus'] },
{ name: 'Sensory', steps: [
{ label: 'Light touch — upper', method: 'Cotton wisp, dorsum of hands, eyes closed', normal: 'Intact, symmetric' },
{ label: 'Light touch — lower', method: 'Dorsum of feet', normal: 'Intact, symmetric' },
{ label: 'Pain — upper', method: 'Broken Q-tip sharp end, hands', normal: 'Intact, symmetric' },
{ label: 'Pain — lower', method: 'Same on feet', normal: 'Intact, symmetric' },
{ label: 'Temperature (if indicated)', method: 'Cold tuning fork each area', normal: 'Intact' },
{ label: 'Vibration', method: '128 Hz tuning fork at distal IP of great toes; count seconds to fade', normal: 'Feels vibration; appropriate duration' },
{ label: 'Proprioception', method: 'Move great toe up/down with eyes closed', normal: 'Identifies direction correctly' },
{ label: 'Two-point discrimination (if indicated)', method: 'Blunt calipers on fingertip', normal: '<5mm on fingertip' },
{ label: 'Stereognosis (if indicated)', method: 'Identify coin/key in hand with eyes closed', normal: 'Correct identification' }
], abnormalHints: ['Dermatomal loss (nerve root)', 'Stocking-glove loss (length-dependent neuropathy)', 'Dorsal column loss (B12, tabes, MS — positive Romberg, vibration loss)', 'Cortical deficit (astereognosis, impaired 2-pt)'] },
{ name: 'Coordination', steps: [
{ label: 'Finger-nose-finger', method: 'Alternate examiner\'s finger and own nose; examiner moves target', normal: 'Smooth, accurate bilaterally' },
{ label: 'Heel-to-shin', method: 'Supine: heel down opposite shin and back', normal: 'Smooth, accurate' },
{ label: 'Rapid alternating (Dysdiadochokinesis)', method: 'Supinate/pronate hand rapidly on thigh', normal: 'Rhythmic, symmetric' },
{ label: 'Finger tapping', method: 'Thumb to each finger in sequence rapidly', normal: 'Rhythmic, smooth, symmetric' }
], abnormalHints: ['Dysmetria (cerebellar)', 'Intention tremor', 'Dysdiadochokinesia', 'Decomposed movement'] },
{ name: 'Gait and Romberg', steps: [
{ label: 'Normal gait', method: 'Walk 20 feet', normal: 'Narrow-based, smooth, reciprocal arm swing' },
{ label: 'Heel walk', method: 'Walk on heels only', normal: 'Able without difficulty' },
{ label: 'Toe walk', method: 'Walk on toes only', normal: 'Able without difficulty' },
{ label: 'Tandem', method: 'Heel-to-toe along a line, 10+ steps', normal: 'Minimal deviation' },
{ label: 'Romberg', method: 'Feet together, eyes open then closed, 30s', normal: 'Stable — no significant sway or fall with eyes closed' },
{ label: 'Single-leg stance', method: '10s each side, eyes open', normal: 'Stable without drift' }
], abnormalHints: ['Ataxic (wide-based — cerebellar)', 'Steppage (peripheral neuropathy / foot drop)', 'Circumduction (UMN hemiparesis)', 'Scissoring', 'Romberg positive (dorsal column)'] },
{ name: 'Frontal release / primitive reflexes', steps: [
{ label: 'Grasp reflex', method: 'Stroke palm', normal: 'Absent' },
{ label: 'Snout reflex', method: 'Tap upper lip', normal: 'No lip pucker' },
{ label: 'Glabellar tap', method: 'Tap between eyebrows — should habituate after 34 taps', normal: 'Habituates (no sustained blink)' },
{ label: 'Palmomental', method: 'Stroke thenar eminence', normal: 'No ipsilateral chin twitch' }
], abnormalHints: ['Presence suggests frontal lobe pathology, neurodegenerative disease, or severe TBI — rare in adolescence but relevant in post-concussion workup'] }
]
}
}
};
// ────────────────────────────────────────────────────────────
// RENDER + STATE
// STATE + RENDER
// ────────────────────────────────────────────────────────────
var _inited = false;
var state = {}; // key = 'msk-0' etc → { name, status, note, normal_finding }
// state keyed as 'system-componentIdx-stepIdx' → { label, method, normal, status, note }
var state = {};
var currentSystem = 'msk';
var currentAgeGroup = '';
@ -387,34 +702,46 @@
html += ' <div style="padding:12px 16px;font-size:13px;line-height:1.6;color:var(--g700);">' + esc(section.overview) + '</div>';
html += '</div>';
section.components.forEach(function (c, i) {
var key = currentSystem + '-' + i;
if (!state[key]) state[key] = { name: c.name, status: null, note: '', normal_finding: c.normal, technique: c.technique };
html += '<div class="card" style="margin-bottom:10px;" data-pe-key="' + key + '">';
html += ' <div class="card-header" style="display:flex;align-items:center;gap:8px;flex-wrap:wrap;">';
html += ' <h3 style="margin:0;flex:1;min-width:0;">' + esc(c.name) + '</h3>';
html += ' <div style="display:flex;gap:4px;">';
html += ' <button class="visit-status-btn ' + (state[key].status === 'normal' ? 'done' : '') + '" data-pe-status="normal" data-pe-key="' + key + '">Normal</button>';
html += ' <button class="visit-status-btn ' + (state[key].status === 'abnormal' ? 'refused' : '') + '" data-pe-status="abnormal" data-pe-key="' + key + '">Abnormal</button>';
html += ' <button class="visit-status-btn ' + (state[key].status === null ? 'not-due' : '') + '" data-pe-status="skip" data-pe-key="' + key + '">Skip</button>';
html += ' </div>';
section.components.forEach(function (c, ci) {
html += '<div class="card" style="margin-bottom:10px;">';
html += ' <div class="card-header" style="display:flex;align-items:center;justify-content:space-between;">';
html += ' <h3 style="margin:0;">' + esc(c.name) + '</h3>';
html += ' <span style="font-size:11px;color:var(--g500);">' + c.steps.length + ' steps</span>';
html += ' </div>';
html += ' <div style="padding:10px 16px;font-size:12px;color:var(--g700);line-height:1.6;">';
html += ' <div style="margin-bottom:6px;"><strong>How to perform:</strong> ' + esc(c.technique) + '</div>';
html += ' <div style="margin-bottom:6px;"><strong>Expected normal:</strong> ' + esc(c.normal) + '</div>';
html += ' <div style="padding:10px 16px;">';
c.steps.forEach(function (s, si) {
var key = currentSystem + '-' + ci + '-' + si;
if (!state[key]) state[key] = { component: c.name, label: s.label, method: s.method, normal: s.normal, status: null, note: '' };
var st = state[key].status;
html += '<div class="pe-step" data-pe-key="' + key + '" style="padding:8px 10px;border:1px solid var(--g200);border-radius:8px;margin-bottom:6px;' + (st === 'normal' ? 'background:#ecfdf5;' : st === 'abnormal' ? 'background:#fef2f2;' : '') + '">';
html += ' <div style="display:flex;align-items:flex-start;gap:10px;">';
html += ' <div style="flex:1;min-width:0;">';
html += ' <div style="font-weight:600;font-size:13px;color:var(--g800);">' + (si + 1) + '. ' + esc(s.label) + '</div>';
html += ' <div style="font-size:12px;color:var(--g600);margin-top:2px;line-height:1.5;"><strong>Method:</strong> ' + esc(s.method) + '</div>';
html += ' <div style="font-size:12px;color:var(--g600);line-height:1.5;"><strong>Expected:</strong> ' + esc(s.normal) + '</div>';
html += ' </div>';
html += ' <div style="display:flex;gap:3px;flex-shrink:0;">';
html += ' <button class="visit-status-btn ' + (st === 'normal' ? 'done' : '') + '" data-pe-status="normal" data-pe-key="' + key + '">✓</button>';
html += ' <button class="visit-status-btn ' + (st === 'abnormal' ? 'refused' : '') + '" data-pe-status="abnormal" data-pe-key="' + key + '">✗</button>';
html += ' <button class="visit-status-btn ' + (st === null ? 'not-due' : '') + '" data-pe-status="skip" data-pe-key="' + key + '">—</button>';
html += ' </div>';
html += ' </div>';
html += ' <div class="pe-abnormal-detail" style="margin-top:6px;' + (st === 'abnormal' ? '' : 'display:none;') + '">';
html += ' <input type="text" class="pe-note" data-pe-key="' + key + '" placeholder="Describe the abnormal finding (e.g., 4/5 strength, left pronator drift)" value="' + esc(state[key].note || '') + '" style="width:100%;padding:5px 8px;font-size:12px;border:1px solid var(--g300);border-radius:6px;">';
html += ' </div>';
html += '</div>';
});
if (c.abnormalHints && c.abnormalHints.length) {
html += ' <div style="color:var(--g600);"><strong>Watch for:</strong> ' + c.abnormalHints.map(esc).join(' · ') + '</div>';
html += '<div style="margin-top:8px;padding:8px 10px;background:var(--g50);border-radius:6px;font-size:11px;color:var(--g600);line-height:1.6;">';
html += '<strong>Watch for:</strong> ' + c.abnormalHints.map(esc).join(' · ');
html += '</div>';
}
html += ' <div class="pe-abnormal-detail" style="margin-top:8px;' + (state[key].status === 'abnormal' ? '' : 'display:none;') + '">';
html += ' <input type="text" class="pe-note" data-pe-key="' + key + '" placeholder="Describe the abnormal finding (e.g., positive Ortolani left hip)" value="' + esc(state[key].note || '') + '" style="width:100%;padding:6px 8px;font-size:13px;border:1px solid var(--g300);border-radius:6px;">';
html += ' </div>';
html += ' </div>';
html += '</div>';
html += ' </div>'; // end padding
html += '</div>'; // end card
});
content.innerHTML = html;
// Wire events
content.querySelectorAll('[data-pe-status]').forEach(function (btn) {
btn.addEventListener('click', function () { handleStatus(btn); });
});
@ -431,16 +758,16 @@
var status = btn.dataset.peStatus;
if (!state[key]) return;
state[key].status = (status === 'skip') ? null : status;
// Redraw this card's buttons + abnormal input visibility
var card = btn.closest('[data-pe-key]');
if (card) {
card.querySelectorAll('[data-pe-status]').forEach(function (b) {
var row = btn.closest('.pe-step');
if (row) {
row.style.background = state[key].status === 'normal' ? '#ecfdf5' : state[key].status === 'abnormal' ? '#fef2f2' : '';
row.querySelectorAll('[data-pe-status]').forEach(function (b) {
b.classList.remove('done', 'refused', 'not-due');
if (b.dataset.peStatus === 'normal' && state[key].status === 'normal') b.classList.add('done');
if (b.dataset.peStatus === 'abnormal' && state[key].status === 'abnormal') b.classList.add('refused');
if (b.dataset.peStatus === 'skip' && state[key].status === null) b.classList.add('not-due');
});
var detail = card.querySelector('.pe-abnormal-detail');
var detail = row.querySelector('.pe-abnormal-detail');
if (detail) detail.style.display = (state[key].status === 'abnormal') ? '' : 'none';
}
}
@ -456,12 +783,12 @@
function generate() {
if (!currentAgeGroup || !PE_DATA[currentAgeGroup]) return;
var components = Object.keys(state)
var steps = Object.keys(state)
.filter(function (k) { return k.indexOf(currentSystem + '-') === 0; })
.map(function (k) { return state[k]; });
var assessed = components.filter(function (c) { return c.status !== null; });
if (assessed.length === 0) { showToast('Mark at least one component Normal or Abnormal', 'error'); return; }
var assessed = steps.filter(function (s) { return s.status !== null; });
if (assessed.length === 0) { showToast('Mark at least one step Normal or Abnormal', 'error'); return; }
var btn = document.getElementById('pe-generate-btn');
btn.disabled = true; btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Generating...';
@ -474,7 +801,7 @@
method: 'POST',
headers: getAuthHeaders(),
body: JSON.stringify({
components: components,
steps: steps,
ageGroup: PE_DATA[currentAgeGroup].label,
system: currentSystem,
patientAge: document.getElementById('pe-age').value,

View file

@ -1,11 +1,11 @@
// ============================================================
// PHYSICAL EXAM GUIDE — narrative + list generation
// PHYSICAL EXAM GUIDE — step-level narrative + list generation
// ============================================================
// Takes an age group, system (msk | neuro), and a set of assessed
// components (each flagged Normal or Abnormal, abnormal with optional
// note) and returns a professional narrative paragraph or structured
// list. Mirrors the milestone-narrative pattern exactly: same guardrails,
// same injection wrapping, same audit log category.
// Receives a flat array of exam STEPS (each with component name, label,
// method, expected normal, status, and optional abnormal note). Returns
// a professional two-section report (Technique performed + Findings).
// Mirrors the milestone-narrative pattern: same AppRole-injection guard,
// same clinical audit category.
var express = require('express');
var router = express.Router();
@ -16,41 +16,58 @@ var logger = require('../utils/logger');
router.post('/generate-pe-narrative', authMiddleware, async function (req, res) {
try {
var { components, ageGroup, system, patientAge, patientGender, model, format } = req.body;
if (!Array.isArray(components) || components.length === 0) {
return res.status(400).json({ error: 'No components provided' });
var { steps, ageGroup, system, patientAge, patientGender, model, format } = req.body;
if (!Array.isArray(steps) || steps.length === 0) {
return res.status(400).json({ error: 'No steps provided' });
}
// Partition by assessment status
var normal = components.filter(function (c) { return c.status === 'normal'; });
var abnormal = components.filter(function (c) { return c.status === 'abnormal'; });
var normal = steps.filter(function (s) { return s.status === 'normal'; });
var abnormal = steps.filter(function (s) { return s.status === 'abnormal'; });
if (normal.length === 0 && abnormal.length === 0) {
return res.json({
success: true,
narrative: 'No physical-exam components were assessed.',
summary: { normal: 0, abnormal: 0, notAssessed: components.length }
success: true,
narrative: 'No physical-exam steps were assessed.',
summary: { normal: 0, abnormal: 0, notAssessed: steps.length }
});
}
// Structured text for the model — includes both technique (how the exam
// component was performed) and the finding. The prompt instructs the AI
// to produce a "Technique" preamble + "Findings" narrative.
// Group by component for readability — AI works better with structure.
function groupByComponent(list) {
var groups = {};
list.forEach(function (s) {
var key = s.component || 'Other';
if (!groups[key]) groups[key] = [];
groups[key].push(s);
});
return groups;
}
var normalGroups = groupByComponent(normal);
var abnormalGroups = groupByComponent(abnormal);
// Build structured text for the model
var text = '';
if (normal.length > 0) {
text += 'NORMAL findings:\n';
normal.forEach(function (c) {
text += ' - ' + c.name + '\n';
text += ' technique: ' + (c.technique || 'standard method') + '\n';
text += ' normal finding: ' + (c.normal_finding || 'unspecified') + '\n';
if (Object.keys(normalGroups).length) {
text += 'NORMAL FINDINGS (grouped by exam component):\n';
Object.keys(normalGroups).forEach(function (comp) {
text += '\n[' + comp + ']\n';
normalGroups[comp].forEach(function (s) {
text += ' • ' + s.label + '\n';
text += ' method: ' + (s.method || 'standard method') + '\n';
text += ' expected normal: ' + (s.normal || 'unspecified') + '\n';
});
});
}
if (abnormal.length > 0) {
text += '\nABNORMAL findings:\n';
abnormal.forEach(function (c) {
text += ' - ' + c.name + '\n';
text += ' technique: ' + (c.technique || 'standard method') + '\n';
text += ' physician note: ' + (c.note || 'abnormal, no detail provided') + '\n';
if (Object.keys(abnormalGroups).length) {
text += '\nABNORMAL FINDINGS (grouped by exam component):\n';
Object.keys(abnormalGroups).forEach(function (comp) {
text += '\n[' + comp + ']\n';
abnormalGroups[comp].forEach(function (s) {
text += ' • ' + s.label + '\n';
text += ' method: ' + (s.method || 'standard method') + '\n';
text += ' physician note: ' + (s.note || 'abnormal, no detail provided') + '\n';
});
});
}
@ -63,8 +80,8 @@ router.post('/generate-pe-narrative', authMiddleware, async function (req, res)
'Patient: ' + (patientAge || 'Unknown') + ', ' + (patientGender || 'Unknown') + '\n' +
'Age group: ' + (ageGroup || 'Unknown') + '\n' +
'Exam system: ' + systemLabel + '\n\n' +
wrapUserText('pe_components', text) +
'\n\nAssessed: ' + (normal.length + abnormal.length) +
wrapUserText('pe_steps', text) +
'\n\nAssessed steps: ' + (normal.length + abnormal.length) +
' | Normal: ' + normal.length +
' | Abnormal: ' + abnormal.length
}
@ -74,7 +91,7 @@ router.post('/generate-pe-narrative', authMiddleware, async function (req, res)
success: true,
narrative: result.content,
model: result.model,
summary: { normal: normal.length, abnormal: abnormal.length, notAssessed: components.length - normal.length - abnormal.length }
summary: { normal: normal.length, abnormal: abnormal.length, notAssessed: steps.length - normal.length - abnormal.length }
});
logger.audit(req.user.id, 'generate_pe_narrative', 'Generated PE narrative (' + systemLabel + ')', req, { category: 'clinical' });
} catch (err) {

View file

@ -214,28 +214,46 @@ Sentence 3: Any concerns or delays. If none, state no concerns identified.
EXACTLY 3 sentences. Professional language. Only mention assessed milestones.`,
// ======================== PHYSICAL EXAM GUIDE ========================
// The route sends data grouped by exam COMPONENT (e.g. "Cranial nerves
// IIXII") with the individual STEPS that were performed inside each
// component (e.g. CN II acuity, CN III EOM, CN VII face). The AI
// summarises at the component level, weaving in the techniques used.
peGuideNarrative: `You are a pediatric documentation specialist.
Generate a professional OSCE-style physical-exam report with TWO sections.
${CORE_RULES}
Input shape: steps are grouped under an exam COMPONENT (e.g. "Deep tendon
reflexes"). Each step has a specific label (e.g. "Biceps C5-C6"), the method
used, and either the expected-normal phrase (if marked normal) or the
physician's abnormal note.
Structure the output as:
Technique:
A short paragraph describing HOW the examination was performed. Mention the
maneuvers, tests, or methods used for each assessed component, using the
"technique" strings provided. Weave them into prose do NOT list them
bullet-by-bullet. Omit techniques for components that were not assessed.
A short paragraph describing HOW the examination was performed, grouped by
component. Mention the specific maneuvers or tests used (e.g. "Cranial
nerves were assessed including visual acuity by Snellen, visual fields by
confrontation, pupillary response, EOMs in H pattern, facial sensation to
light touch in V1/V2/V3 distributions, facial symmetry with smile and eye
closure, hearing to finger rub, palatal elevation, shoulder shrug and head
turn against resistance, and tongue protrusion"). Weave into prose do NOT
list bullet-by-bullet. Omit components that had no assessed steps.
Findings:
A narrative paragraph or two describing what was observed.
- ONLY components that were assessed (Normal or Abnormal)
- Normal findings: use concise language describing the specific normal result
(e.g. "Hips stable to Barlow and Ortolani" not "Hips normal")
- Abnormal findings: lead with the physician's note verbatim, then add a
brief clinical qualifier only if the note is clearly incomplete
- Group related findings by region when natural (upper extremities together,
spine separately, etc.)
- End with a single-phrase overall impression
A narrative paragraph or two describing what was observed, grouped
naturally by region or system. Summarise at the component level do not
parrot every individual step unless clinically important. Example good
finding: "Cranial nerves II through XII are intact except for a left-sided
facial droop involving only the lower face, consistent with central
weakness." NOT: "CN II: intact. CN III: intact. CN IV: intact. ..."
Rules:
- ONLY report on steps that were assessed (marked Normal or Abnormal)
- Normal findings: use specific clinical language, not "normal"
(e.g. "2+ symmetric deep tendon reflexes throughout with down-going plantar response" NOT "DTRs normal")
- Abnormal findings: lead with the physician's note verbatim, add a brief
localisation or clinical qualifier only if the note is clearly incomplete
- End with a single-sentence overall impression
- Do NOT fabricate measurements, grades, or adverbs not provided
- Do NOT mention components that were not assessed`,
@ -243,20 +261,26 @@ A narrative paragraph or two describing what was observed.
Generate an OSCE-style physical-exam report as a STRUCTURED numbered LIST.
${CORE_RULES}
Input shape: steps grouped under exam COMPONENT. Condense at the component
level unless a specific step had an abnormal finding worth flagging.
Produce TWO sections, each as a numbered list:
Technique performed:
1. [method for component 1]
2. [method for component 2]
... using the "technique" strings provided one per assessed component.
1. [Component 1] brief description of maneuvers used
2. [Component 2] brief description of maneuvers used
...
Findings:
1. [finding for component 1]
2. [finding for component 2]
... one line per assessed component.
1. [Component 1]: specific normal finding, or abnormal description
2. [Component 2]: same
...
Rules:
- One numbered item per assessed COMPONENT (not per step)
- Normal findings: describe the specific normal result, not just "normal"
- Abnormal findings: start with the physician's note, then qualifier if provided
- One-line overall impression at the end
- Abnormal findings: start with physician's note, add qualifier if provided
- Final item: one-line overall impression
- No markdown, no symbols, plain numbered list`,
// ======================== REFINE ========================