DiagnosticTree/EarTMJ: Difference between revisions

From Painwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{
/* ══════════════════════════════════════════════════════
   "tree_id": "ear-tmj",
  TREE DATA
  "region": "Ear & Temporomandibular Joint Pain",
  ══════════════════════════════════════════════════════ */
  "start": "rom-1",
var TREE_DATA = {
   "redflags": {
   tree_id: "ear-tmj", region: "Ear & Temporomandibular Joint Pain", start: "rom-1",
     "emergency": [
   nodes: {
      {
 
        "id": "rf-e1",
     /* ── JAW MOVEMENT BRANCH ── */
        "label": "Otitis media / Mastoiditis",
        "question": "Is there fever, acute hearing loss, or purulent ear discharge?",
        "rationale": "Requires urgent antibiotic treatment or surgical referral",
        "action": "Call emergency services or send directly to Emergency Department"
      },
      {
        "id": "rf-e2",
        "label": "Cardiac referred pain",
        "question": "Is there jaw or ear pain with an exertional component, particularly on the left side?",
        "rationale": "Cardiac pain can refer to the jaw and ear — must be excluded immediately",
        "action": "Call emergency services immediately"
      }
    ],
    "urgent": [
      {
        "id": "rf-u1",
        "label": "Temporal arteritis",
        "question": "Is the patient 50+ with jaw claudication, temporal headache, or scalp tenderness?",
        "rationale": "Can cause irreversible blindness if untreated. Same-day ESR required.",
        "action": "Same-day GP referral + ESR blood test"
      },
      {
        "id": "rf-u2",
        "label": "Parotid / neck malignancy",
        "question": "Is there a hard fixed parotid or neck swelling, or any facial nerve weakness?",
        "rationale": "Possible salivary gland malignancy with nerve involvement",
        "action": "Urgent ENT or oncology referral"
      },
      {
        "id": "rf-u3",
        "label": "Cervical instability",
        "question": "Is there a history of trauma to the head or neck combined with upper cervical pain and ear symptoms?",
        "rationale": "Odontoid fracture or cervical instability can refer to the ear region",
        "action": "Urgent spinal assessment — no manual therapy until cleared"
      }
    ]
  },
  "nodes": {
     "rom-1": {
     "rom-1": {
       "type": "rom",
       type:"rom", question:"Is jaw movement — opening, chewing, or clenching — the PRIMARY aggravator of pain?",
      "question": "Is jaw movement — opening, chewing, or clenching — the PRIMARY aggravator of pain?",
       movement:"Jaw opening / chewing / clenching", direction:"aggravating",
       "movement": "Jaw opening / chewing / clenching",
       muscles_implicated:["Masseter","Medial Pterygoid","Lateral Pterygoid"],
      "direction": "aggravating",
       muscles_excluded:["SCM (Clavicular head)"],
       "muscles_implicated": ["Masseter", "Medial Pterygoid", "Lateral Pterygoid"],
       yes:"rom-2", no:"rom-5"
       "muscles_excluded": ["SCM (Clavicular head)"],
       "yes": "rom-2",
      "no": "rom-5"
     },
     },
     "rom-2": {
     "rom-2": {
       "type": "rom",
       type:"rom", question:"Is maximum mouth opening restricted (less than ~40mm between upper and lower incisors) or painful at end range?",
      "question": "Is maximum mouth opening restricted (less than ~40mm between upper and lower incisors) or painful at end range?",
       movement:"Mouth opening — end range", direction:"aggravating",
       "movement": "Mouth opening — end range",
       muscles_implicated:["Medial Pterygoid","Lateral Pterygoid"],
      "direction": "aggravating",
       muscles_excluded:["Masseter (superficial head)"],
       "muscles_implicated": ["Medial Pterygoid", "Lateral Pterygoid"],
       yes:"rom-3", no:"result-masseter-superficial"
       "muscles_excluded": ["Masseter (superficial head)"],
       "yes": "rom-3",
      "no": "result-masseter-superficial"
     },
     },
     "rom-3": {
     "rom-3": {
       "type": "rom",
       type:"rom", question:"Is there a history of facial trauma, jaw injury, or is bony crepitus palpable over the mandible?",
      "question": "Is pain reproduced or worsened by closing the mouth against resistance (e.g. biting down on a depressor)?",
       movement:"Trismus differential screen", direction:"aggravating",
       "movement": "Resisted jaw closure",
       clinical_rationale:"Mandibular fracture must be excluded before proceeding with myofascial assessment of restricted opening",
      "direction": "aggravating",
       yes:"refer-urgent-fracture", no:"rom-4"
       "muscles_implicated": ["Lateral Pterygoid"],
       "muscles_excluded": ["Medial Pterygoid"],
      "yes": "result-lateral-pterygoid",
      "no": "symptom-1"
     },
     },
    "rom-4": {
      type:"rom", question:"Is pain reproduced or worsened by closing the mouth against resistance — e.g. biting down on a tongue depressor?",
      movement:"Resisted jaw closure", direction:"aggravating",
      muscles_implicated:["Lateral Pterygoid"], muscles_excluded:["Medial Pterygoid"],
      yes:"result-lateral-pterygoid", no:"symptom-1"
    },
    /* ── NECK / SCM BRANCH ── */
     "rom-5": {
     "rom-5": {
       "type": "rom",
       type:"rom",
       "question": "Is pain aggravated by neck rotation, sustained neck postures, or carrying weight on the shoulder?",
       question:"Is pain aggravated by neck rotation, sustained postures, or carrying weight on the shoulder?",
       "movement": "Neck rotation / ipsilateral head tilt",
       movement:"Neck rotation / ipsilateral head tilt", direction:"aggravating",
      "direction": "aggravating",
       muscles_implicated:["SCM (Clavicular head)"],
       "muscles_implicated": ["SCM (Clavicular head)"],
       muscles_excluded:["Masseter","Medial Pterygoid","Lateral Pterygoid"],
       "muscles_excluded": ["Masseter", "Medial Pterygoid", "Lateral Pterygoid"],
       clinical_rationale:"If neck rotation is also stiff or restricted, additional TrPs in levator scapulae, splenius cervicis, or posterior cervical muscles may be co-active alongside SCM.",
       "yes": "symptom-scm-1",
       yes:"exam-scm-1", no:"result-overlap"
      "no": "symptom-scm-2"
    },
    "symptom-1": {
      "type": "symptom",
      "question": "Does the patient report difficulty swallowing (dysphagia) or a sensation of throat tightness?",
      "symptom_name": "Dysphagia / throat tightness",
      "patient_reported": true,
      "muscles_implicated": ["Medial Pterygoid"],
      "muscles_excluded": ["Lateral Pterygoid"],
      "yes": "exam-medial-1",
      "no": "exam-masseter-deep-1"
    },
    "symptom-scm-1": {
      "type": "symptom",
      "question": "Does the patient report dizziness, spatial disorientation, or a feeling of imbalance — without obvious inner ear diagnosis?",
      "symptom_name": "Dizziness / spatial disorientation",
      "patient_reported": true,
      "muscles_implicated": ["SCM (Clavicular head)"],
      "yes": "exam-scm-1",
      "no": "exam-scm-1"
    },
    "symptom-scm-2": {
      "type": "symptom",
      "question": "Does the patient report ipsilateral tearing, nasal congestion, or conjunctival redness without allergic cause?",
      "symptom_name": "Autonomic signs — tearing, congestion, conjunctival redness",
      "patient_reported": true,
      "muscles_implicated": ["SCM (Clavicular head)"],
       "yes": "exam-scm-1",
      "no": "result-overlap"
     },
     },
    /* ── SCM EXAMINATION ── */
     "exam-scm-1": {
     "exam-scm-1": {
       "type": "examination",
       type:"examination",
       "question": "Does palpation along the posterior border of the sternocleidomastoid particularly the clavicular head — reproduce the patient's deep ear pain or dizziness?",
       question:"Does palpation of the SCM both sternal and clavicular heads — reproduce the patient's familiar ear pain or facial symptoms?",
       "exam_type": "palpation",
       exam_type:"palpation",
       "landmark": "Clavicular head of SCM: palpate the medial clavicle attachment, follow the muscle belly superiorly toward the mastoid",
       landmark:"Sternal head: pincer palpation along muscle belly from mastoid to sternum. Clavicular head: flat palpation of posterior/deep head from medial clavicle upward.",
       "positive_finding": "Reproduces deep ear pain, dizziness, or spatial symptoms",
       positive_finding:"Reproduces deep ear pain, facial pain, or familiar symptoms",
       "muscles_implicated": ["SCM (Clavicular head)"],
       clinical_rationale:"Note which head is more reactive — sternal vs clavicular determines the dominant symptom cluster. Full clinical detail on the muscle landing page.",
       "yes": "nerve-scm-1",
      muscles_implicated:["SCM (Sternal head)","SCM (Clavicular head)"],
      "no": "result-overlap"
       yes:"result-scm", no:"result-overlap"
     },
     },
     "nerve-scm-1": {
 
       "type": "nerve_entrapment",
    /* ── CN XI ENTRAPMENT — on landing page, not algorithm ── */
      "question": "Is there weakness or paresis of the ipsilateral trapezius — tested by resisted shoulder shrug or resisted scapular elevation?",
 
       "nerve": "Spinal Accessory Nerve (CN XI)",
    /* ── PTERYGOID / MASSETER SYMPTOMS ── */
       "entrapment_muscle": "SCM (Clavicular head)",
     "symptom-1": {
      "distinguishing_feature": "Myogenic torticollis due to SCM contracture can entrap CN XI on its path to trapezius, causing ipsilateral trapezius weakness",
       type:"symptom", question:"Does the patient report difficulty swallowing (dysphagia) or a sensation of throat tightness or foreign body in the throat?",
       "yes": "result-scm-cn11",
       symptom_name:"Dysphagia / throat tightness",
      "no": "result-scm"
       muscles_implicated:["Medial Pterygoid"], muscles_excluded:["Lateral Pterygoid"],
       yes:"exam-medial-1", no:"exam-masseter-deep-1"
     },
     },
    /* ── EXAMINATIONS ── */
     "exam-medial-1": {
     "exam-medial-1": {
       "type": "examination",
       type:"examination", question:"Does intraoral palpation of the medial pterygoid reproduce the ear or throat pain?",
      "question": "Does intraoral palpation of the medial pterygoid (along the medial aspect of the mandible, posterior to the last molar) reproduce the ear or throat pain?",
       exam_type:"palpation",
       "exam_type": "palpation",
       landmark:"Intraoral: gloved finger along medial surface of posterior mandible behind last molar. Extraoral: just anterior to the angle of the mandible.",
       "landmark": "Intraoral: gloved finger along medial surface of posterior mandible. Extraoral: just anterior to the angle of the mandible",
       positive_finding:"Reproduces deep ear pain, throat tightness, or jaw ache",
       "positive_finding": "Reproduces deep ear pain, throat tightness, or jaw ache",
       muscles_implicated:["Medial Pterygoid"],
       "muscles_implicated": ["Medial Pterygoid"],
       yes:"result-medial-pterygoid", no:"result-overlap"
       "yes": "result-medial-pterygoid",
      "no": "result-overlap"
     },
     },
     "exam-masseter-deep-1": {
     "exam-masseter-deep-1": {
       "type": "examination",
       type:"examination", question:"Does palpation of the deep masseter just anterior to the tragus of the ear reproduce ear pain or tinnitus?",
      "question": "Does palpation of the deep masseter (just anterior to the tragus of the ear, at the TMJ level) reproduce ear pain or tinnitus?",
       exam_type:"palpation",
       "exam_type": "palpation",
       landmark:"Deep masseter: just anterior to the tragus at TMJ level; press medially toward the condyle",
       "landmark": "Deep masseter: palpate just anterior to the tragus, at the level of the TMJ; press medially toward the condyle",
       positive_finding:"Reproduces ear pain or tinnitus",
       "positive_finding": "Reproduces ear pain or tinnitus",
       muscles_implicated:["Masseter (deep head)"],
       "muscles_implicated": ["Masseter (deep head)"],
       yes:"result-masseter-deep", no:"result-overlap"
       "yes": "result-masseter-deep",
      "no": "result-overlap"
     },
     },
    /* ══════════════════════════════════
      RESULTS
      ══════════════════════════════════ */
     "result-scm": {
     "result-scm": {
       "type": "result",
       type:"result", diagnosis:"SCM Trigger Point — Myofascial Pain", confidence:"high",
      "diagnosis": "SCM — Clavicular Head Trigger Point",
       wiki_page:"Muscle:Sternocleidomastoid",
      "confidence": "high",
       chapter_ref:"Travell & Simons Vol.1 — Ch.7 Sternocleidomastoid",
       "wiki_page": "Trigger_point:Sternocleidomastoid_clavicular",
       division:"both",
       "chapter_ref": "Travell & Simons Vol.1 — Ch.7 Sternocleidomastoid",
      notes:"Soreness may be misattributed to lymphadenopathy. Patient prefers to lie on the sore side with pillow supporting head so the sore face does not bear weight.",
       "notes": "The clavicular head refers deep into the ear canal and can cause dizziness, spatial disorientation, and autonomic signs. Often misdiagnosed as inner ear disorder.",
       treatment_hint:"Spray and stretch (superior to inferior), ischemic compression, correct forward head posture. Treating SCM often improves satellite TrPs.",
       "treatment_hint": "Spray and stretch (superior to inferior), ischemic compression, correct forward head posture",
       also_consider:["Scalene muscles","Splenius cervicis","Levator scapulae"],
       "also_consider": ["Splenius capitis", "Suboccipitals"]
      satellite_trps:["Scalene muscles","Sternalis","Pectoralis major","Pectoralis minor","Masseter","Temporalis","Orbicularis oculi","Frontalis"],
    },
       confirmatory:[
    "result-scm-cn11": {
        "Horner's excluded — pupils equal and reactive, no miosis, ciliospinal reflex present",
      "type": "result",
        "Spasmodic torticollis excluded — no jaw-pressure inhibition of head rotation; any dystonic movement ceases in sleep",
      "diagnosis": "SCM Trigger Point + CN XI Entrapment",
        "Note which head is more reactive: sternal (facial/autonomic symptoms) vs clavicular (dizziness/frontal headache)"
       "confidence": "high",
      ],
      "wiki_page": "Trigger_point:Sternocleidomastoid_clavicular",
      landing_page_topics:[
      "chapter_ref": "Travell & Simons Vol.1 Ch.7 Sternocleidomastoid",
        "Sternal vs clavicular division — full symptom profiles",
      "notes": "Ipsilateral trapezius paresis indicates spinal accessory nerve entrapment secondary to SCM contracture. Release of SCM contracture should resolve the entrapment.",
        "Dizziness — vestibular vs non-vestibular differentiation",
      "treatment_hint": "Priority: release SCM contracture. Spray and stretch, ischemic compression. Refer if trapezius weakness persists after SCM treatment.",
        "Neurological screen: Romberg, nystagmus, postural BP, carotid bruit",
       "also_consider": ["Upper Trapezius", "Levator scapulae"]
        "Autonomic features tearing, rhinitis, palpebral fissure narrowing",
        "Horner syndrome — full exclusion protocol",
        "CN XI entrapment — examination and monitoring",
        "Visual symptoms — venetian blinds phenomenon",
        "Patient posture and sleep advice",
        "Satellite TrP activation and treatment sequence"
      ],
       related_pages:[
        {label:"Scalene TrPs →", page:"Muscle:Scalene"},
        {label:"Sternalis TrP →", page:"Muscle:Sternalis"}
      ]
     },
     },
     "result-masseter-superficial": {
     "result-masseter-superficial": {
       "type": "result",
       type:"result", diagnosis:"Masseter — Superficial Head Trigger Point", confidence:"high",
      "diagnosis": "Masseter — Superficial Head Trigger Point",
       wiki_page:"Trigger_point:Masseter_superficial", chapter_ref:"Travell & Simons Vol.1 — Ch.8",
      "confidence": "high",
       notes:"Refers to cheek, lower jaw, upper and lower molar teeth, and eyebrow. Chewing pain without restriction.",
       "wiki_page": "Trigger_point:Masseter_superficial",
       treatment_hint:"Spray and stretch, intraoral massage, correct parafunctional habits (clenching, bruxism)",
      "chapter_ref": "Travell & Simons Vol.1 — Ch.8 Masseter",
       also_consider:["Temporalis","Medial Pterygoid"]
       "notes": "Refers to cheek, lower jaw, upper and lower molar teeth, and the eyebrow. Chewing pain without restriction.",
       "treatment_hint": "Spray and stretch, intraoral massage, correct parafunctional habits (clenching, bruxism)",
       "also_consider": ["Temporalis", "Medial Pterygoid"]
     },
     },
     "result-masseter-deep": {
     "result-masseter-deep": {
       "type": "result",
       type:"result", diagnosis:"Masseter — Deep Head Trigger Point", confidence:"high",
      "diagnosis": "Masseter — Deep Head Trigger Point",
       wiki_page:"Trigger_point:Masseter_deep", chapter_ref:"Travell & Simons Vol.1 — Ch.8",
      "confidence": "high",
       notes:"Refers deep into the ear and TMJ area. Tinnitus is a strongly associated feature of deep head involvement.",
       "wiki_page": "Trigger_point:Masseter_deep",
       treatment_hint:"Deep pressure release, spray and stretch over TMJ, address bruxism",
      "chapter_ref": "Travell & Simons Vol.1 — Ch.8 Masseter",
       also_consider:["Lateral Pterygoid","SCM clavicular head"]
       "notes": "Refers deep into the ear and TMJ area. Tinnitus is a strongly associated feature of deep head involvement.",
       "treatment_hint": "Deep pressure release, spray and stretch over TMJ, address bruxism",
       "also_consider": ["Lateral Pterygoid", "SCM clavicular head"]
     },
     },
     "result-medial-pterygoid": {
     "result-medial-pterygoid": {
       "type": "result",
       type:"result", diagnosis:"Medial Pterygoid Trigger Point", confidence:"high",
      "diagnosis": "Medial Pterygoid Trigger Point",
       wiki_page:"Trigger_point:Medial_pterygoid", chapter_ref:"Travell & Simons Vol.1 — Ch.9",
      "confidence": "high",
       notes:"Refers to inside the mouth, hard palate, throat, posterior TMJ, and ear. Dysphagia is key distinguishing feature. Intraoral palpation required.",
       "wiki_page": "Trigger_point:Medial_pterygoid",
       treatment_hint:"Intraoral spray and stretch, ischemic compression. Refer to dental/oral medicine if needed.",
      "chapter_ref": "Travell & Simons Vol.1 — Ch.9 Pterygoids",
       also_consider:["Lateral Pterygoid","Digastric (posterior belly)"]
       "notes": "Refers to inside the mouth, hard palate, throat, posterior TMJ, and ear. Dysphagia is a key distinguishing feature. Intraoral palpation required.",
       "treatment_hint": "Intraoral spray and stretch, intraoral ischemic compression, refer to dental/oral medicine if needed",
       "also_consider": ["Lateral Pterygoid", "Digastric (posterior belly)"]
     },
     },
     "result-lateral-pterygoid": {
     "result-lateral-pterygoid": {
       "type": "result",
       type:"result", diagnosis:"Lateral Pterygoid Trigger Point", confidence:"high",
      "diagnosis": "Lateral Pterygoid Trigger Point",
       wiki_page:"Trigger_point:Lateral_pterygoid", chapter_ref:"Travell & Simons Vol.1 — Ch.9",
      "confidence": "high",
       notes:"Refers to TMJ area and maxillary sinus. Pain on resisted jaw CLOSING is pathognomonic. Associated with jaw deviation and clicking.",
       "wiki_page": "Trigger_point:Lateral_pterygoid",
       treatment_hint:"Intraoral spray and stretch, address jaw deviation. Refer to dental/oral medicine for occlusal assessment.",
      "chapter_ref": "Travell & Simons Vol.1 — Ch.9 Pterygoids",
       also_consider:["Masseter deep head","Medial Pterygoid"]
       "notes": "Refers to TMJ area and maxillary sinus. Pain on resisted jaw CLOSING is pathognomonic. Often associated with jaw deviation and clicking.",
       "treatment_hint": "Intraoral spray and stretch, address jaw deviation, refer to dental/oral medicine for occlusal assessment",
       "also_consider": ["Masseter deep head", "Medial Pterygoid"]
     },
     },
     "result-overlap": {
     "result-overlap": {
       "type": "overlap",
       type:"overlap",
       "text": "Findings are inconclusive. Multi-muscle involvement or an atypical presentation is likely. Perform a full palpation screen of all four muscles.",
       text:"Findings are inconclusive. Multi-muscle involvement or atypical presentation likely. Perform a full palpation screen of all four muscles.",
       "screen_these": [
       screen_these:["SCM — Clavicular head","Masseter — superficial and deep heads","Medial Pterygoid (intraoral)","Lateral Pterygoid (intraoral)"],
        "SCM — Clavicular head",
       wiki_page:"Differential:Ear_TMJ_pain"
        "Masseter — superficial and deep heads",
    },
        "Medial Pterygoid (intraoral)",
 
        "Lateral Pterygoid (intraoral)"
    /* ══════════════════════════════════
       ],
      REFERRAL ENDPOINTS
       "wiki_page": "Differential:Ear_TMJ_pain"
      ══════════════════════════════════ */
    "refer-emergency-neuro": {
      type:"neuro_referral", urgency:"emergency",
       title:"Neurological Emergency — Do Not Proceed",
      body:"Impaired or lost consciousness with dizziness or head symptoms indicates serious neurological pathology. Differential includes: pontine haemorrhage, intracranial vascular lesion, cerebellopontine angle tumour, or petit mal epilepsy.",
      action:"Call emergency services or send directly to Emergency Department. Do not perform manual therapy."
    },
    "refer-urgent-fracture": {
      type:"neuro_referral", urgency:"emergency",
      title:"Possible Mandibular Fracture",
      body:"History of facial trauma with restricted mouth opening and/or bony crepitus on palpation of the mandible must be treated as a fracture until proven otherwise.",
      action:"Refer to oral/maxillofacial surgery or Emergency Department. Do not proceed with intraoral assessment."
     }
     }
   }
   }
}
};
 
/* ══════════════════════════════════════════════════════
  RED FLAGS
  ══════════════════════════════════════════════════════ */
var REDFLAG_DATA = {
  emergency: [
    { id:"rf-e1", label:"Otitis media / Mastoiditis",
      question:"Is there fever, acute hearing loss, or purulent ear discharge?",
      rationale:"Requires urgent antibiotic treatment or surgical referral",
      action:"Call emergency services or send directly to Emergency Department" },
    { id:"rf-e2", label:"Cardiac referred pain",
      question:"Is there jaw or ear pain with an exertional component, particularly on the left side?",
      rationale:"Cardiac pain can refer to the jaw and ear — must be excluded immediately",
      action:"Call emergency services immediately" }
  ],
  urgent: [
    { id:"rf-u1", label:"Temporal arteritis",
      question:"Is the patient aged 50+ with jaw claudication (pain building with chewing then easing), temporal headache, or scalp tenderness?",
      rationale:"Can cause irreversible blindness if untreated. Same-day ESR required.",
      action:"Same-day GP referral + ESR blood test" },
    { id:"rf-u2", label:"Parotid / neck malignancy",
      question:"Is there a hard fixed parotid or neck swelling, or any facial nerve weakness?",
      rationale:"Possible salivary gland malignancy with nerve involvement",
      action:"Urgent ENT or oncology referral" },
    { id:"rf-u3", label:"Cervical instability",
      question:"Is there a history of trauma to the head or neck combined with upper cervical pain and ear symptoms?",
      rationale:"Odontoid fracture or cervical instability can refer to the ear region",
      action:"Urgent spinal assessment — no manual therapy until cleared" }
  ]
};
 
/* ══════════════════════════════════════════════════════
  BROAD DIFFERENTIAL
  ══════════════════════════════════════════════════════ */
var BROAD_DIFF_DATA = [
  { id:"bd-1", condition:"Ménière's Disease", confidence:"uncommon",
    mimics:"Episodic deep ear fullness, tinnitus, and dizziness — overlaps strongly with SCM clavicular and masseter deep head patterns",
    distinguishing_feature:"Triad of fluctuating unilateral sensorineural hearing loss, episodic rotational vertigo (minutes to hours), and low-frequency tinnitus. Nystagmus during attacks.",
    action:"Refer to ENT / audiovestibular medicine. Audiometry and caloric testing." },
  { id:"bd-2", condition:"Ramsay Hunt Syndrome", confidence:"rare",
    mimics:"Deep ear pain indistinguishable from SCM clavicular referral at onset",
    distinguishing_feature:"Vesicular eruption in the ear canal or on the pinna — may appear days after pain onset. Facial nerve palsy may follow.",
    action:"Examine the ear canal at every visit. If vesicles present, refer urgently — antiviral window is 72 hours." },
  { id:"bd-3", condition:"Eagle Syndrome", confidence:"rare",
    mimics:"Throat, ear, and TMJ pain overlapping with medial pterygoid and SCM patterns",
    distinguishing_feature:"Pain provoked by turning the head or swallowing. Elongated styloid process may be palpable in the tonsillar fossa on intraoral examination.",
    action:"Panoramic radiograph to assess styloid length. Refer to oral/maxillofacial surgery." },
  { id:"bd-4", condition:"Glossopharyngeal Neuralgia", confidence:"rare",
    mimics:"Severe episodic ear and throat pain overlapping with SCM and medial pterygoid referral",
    distinguishing_feature:"Lancinating, electric shock quality — seconds to minutes duration. Triggered by swallowing, talking, or yawning.",
    action:"Refer to neurology. Carbamazepine is first-line." },
  { id:"bd-5", condition:"Tic Douloureux (Trigeminal Neuralgia)", confidence:"rare",
    mimics:"Facial and jaw pain overlapping with masseter, temporalis, and SCM sternal patterns",
    distinguishing_feature:"Lancinating electric shock quality with characteristic facial grimace. Consciousness is unimpaired. Trigger zones on face. Ceases between attacks completely.",
    action:"Refer to neurology. MRI to exclude vascular compression. Carbamazepine first-line." },
  { id:"bd-6", condition:"Cerebellopontine Angle Tumour", confidence:"rare",
    mimics:"Unilateral ear symptoms, dizziness, and tinnitus overlapping with SCM clavicular and masseter deep patterns",
    distinguishing_feature:"Progressive unilateral sensorineural hearing loss, tinnitus, facial numbness (V), and facial weakness (VII) develop over months. Positive Romberg.",
    action:"Refer to neurology / ENT. MRI internal auditory meatus urgently." },
  { id:"bd-7", condition:"Subclavian Steal Syndrome", confidence:"rare",
    mimics:"Postural dizziness and neck-related symptoms overlapping with SCM clavicular TrP pattern",
    distinguishing_feature:"Reversed vertebral artery flow from subclavian stenosis. BP difference of >15mmHg between arms. Bruit in supraclavicular fossa. Symptoms provoked by arm exercise.",
    action:"Check BP in both arms. Refer to vascular surgery. Carotid/subclavian Doppler." },
  { id:"bd-8", condition:"Adrenocortical Insufficiency", confidence:"rare",
    mimics:"Postural dizziness identical to SCM clavicular division pattern",
    distinguishing_feature:"Orthostatic hypotension (≥20mmHg systolic drop on standing). Generalised fatigue, skin hyperpigmentation, salt craving. Dizziness on rising or postural change.",
    action:"Refer to GP / endocrinology for serum cortisol and ACTH stimulation test." },
  { id:"bd-9", condition:"Spasmodic Torticollis", confidence:"uncommon",
    mimics:"Neck pain and head posture changes resembling SCM TrP-driven posture",
    distinguishing_feature:"Involuntary head rotation inhibited by gentle pressure on jaw ipsilateral to rotation (geste antagoniste). Dystonic movement ceases completely during sleep.",
    action:"Refer to neurology. Botulinum toxin injection is first-line treatment." },
  { id:"bd-10", condition:"Sialolithiasis (Parotid duct calculus)", confidence:"uncommon",
    mimics:"Pre-auricular and TMJ area pain resembling masseter deep head TrP",
    distinguishing_feature:"Pain peaks predictably during or before meals. Visible or palpable parotid swelling that partially resolves after eating.",
    action:"Palpate parotid duct. Ultrasound first-line. Refer to oral surgery." }
];


[[Category:DiagnosticTree|EarTMJ]]
/* ══════════════════════════════════════════════════════
  NODE META
  ══════════════════════════════════════════════════════ */
var NODE_META = {
  rom:             { color:'#1d4ed8', icon:'🔄', label:'Movement Screen' },
  nerve_entrapment: { color:'#6d28d9', icon:'⚡', label:'Nerve Screen' },
  symptom:          { color:'#0f766e', icon:'💬', label:'Patient Symptom' },
  examination:      { color:'#15803d', icon:'🩺', label:'Examination' },
  result:          { color:'#15803d', icon:'✅', label:'Diagnosis' },
  overlap:          { color:'#78716c', icon:'🔍', label:'Inconclusive' },
  neuro_referral:  { color:'#b91c1c', icon:'🧠', label:'Neurological Referral' }
};

Revision as of 01:04, 12 April 2026

/* ══════════════════════════════════════════════════════

  TREE DATA
  ══════════════════════════════════════════════════════ */

var TREE_DATA = {

 tree_id: "ear-tmj", region: "Ear & Temporomandibular Joint Pain", start: "rom-1",
 nodes: {
   /* ── JAW MOVEMENT BRANCH ── */
   "rom-1": {
     type:"rom", question:"Is jaw movement — opening, chewing, or clenching — the PRIMARY aggravator of pain?",
     movement:"Jaw opening / chewing / clenching", direction:"aggravating",
     muscles_implicated:["Masseter","Medial Pterygoid","Lateral Pterygoid"],
     muscles_excluded:["SCM (Clavicular head)"],
     yes:"rom-2", no:"rom-5"
   },
   "rom-2": {
     type:"rom", question:"Is maximum mouth opening restricted (less than ~40mm between upper and lower incisors) or painful at end range?",
     movement:"Mouth opening — end range", direction:"aggravating",
     muscles_implicated:["Medial Pterygoid","Lateral Pterygoid"],
     muscles_excluded:["Masseter (superficial head)"],
     yes:"rom-3", no:"result-masseter-superficial"
   },
   "rom-3": {
     type:"rom", question:"Is there a history of facial trauma, jaw injury, or is bony crepitus palpable over the mandible?",
     movement:"Trismus differential screen", direction:"aggravating",
     clinical_rationale:"Mandibular fracture must be excluded before proceeding with myofascial assessment of restricted opening",
     yes:"refer-urgent-fracture", no:"rom-4"
   },
   "rom-4": {
     type:"rom", question:"Is pain reproduced or worsened by closing the mouth against resistance — e.g. biting down on a tongue depressor?",
     movement:"Resisted jaw closure", direction:"aggravating",
     muscles_implicated:["Lateral Pterygoid"], muscles_excluded:["Medial Pterygoid"],
     yes:"result-lateral-pterygoid", no:"symptom-1"
   },
   /* ── NECK / SCM BRANCH ── */
   "rom-5": {
     type:"rom",
     question:"Is pain aggravated by neck rotation, sustained postures, or carrying weight on the shoulder?",
     movement:"Neck rotation / ipsilateral head tilt", direction:"aggravating",
     muscles_implicated:["SCM (Clavicular head)"],
     muscles_excluded:["Masseter","Medial Pterygoid","Lateral Pterygoid"],
     clinical_rationale:"If neck rotation is also stiff or restricted, additional TrPs in levator scapulae, splenius cervicis, or posterior cervical muscles may be co-active alongside SCM.",
     yes:"exam-scm-1", no:"result-overlap"
   },
   /* ── SCM EXAMINATION ── */
   "exam-scm-1": {
     type:"examination",
     question:"Does palpation of the SCM — both sternal and clavicular heads — reproduce the patient's familiar ear pain or facial symptoms?",
     exam_type:"palpation",
     landmark:"Sternal head: pincer palpation along muscle belly from mastoid to sternum. Clavicular head: flat palpation of posterior/deep head from medial clavicle upward.",
     positive_finding:"Reproduces deep ear pain, facial pain, or familiar symptoms",
     clinical_rationale:"Note which head is more reactive — sternal vs clavicular determines the dominant symptom cluster. Full clinical detail on the muscle landing page.",
     muscles_implicated:["SCM (Sternal head)","SCM (Clavicular head)"],
     yes:"result-scm", no:"result-overlap"
   },
   /* ── CN XI ENTRAPMENT — on landing page, not algorithm ── */
   /* ── PTERYGOID / MASSETER SYMPTOMS ── */
   "symptom-1": {
     type:"symptom", question:"Does the patient report difficulty swallowing (dysphagia) or a sensation of throat tightness or foreign body in the throat?",
     symptom_name:"Dysphagia / throat tightness",
     muscles_implicated:["Medial Pterygoid"], muscles_excluded:["Lateral Pterygoid"],
     yes:"exam-medial-1", no:"exam-masseter-deep-1"
   },
   /* ── EXAMINATIONS ── */
   "exam-medial-1": {
     type:"examination", question:"Does intraoral palpation of the medial pterygoid reproduce the ear or throat pain?",
     exam_type:"palpation",
     landmark:"Intraoral: gloved finger along medial surface of posterior mandible behind last molar. Extraoral: just anterior to the angle of the mandible.",
     positive_finding:"Reproduces deep ear pain, throat tightness, or jaw ache",
     muscles_implicated:["Medial Pterygoid"],
     yes:"result-medial-pterygoid", no:"result-overlap"
   },
   "exam-masseter-deep-1": {
     type:"examination", question:"Does palpation of the deep masseter just anterior to the tragus of the ear reproduce ear pain or tinnitus?",
     exam_type:"palpation",
     landmark:"Deep masseter: just anterior to the tragus at TMJ level; press medially toward the condyle",
     positive_finding:"Reproduces ear pain or tinnitus",
     muscles_implicated:["Masseter (deep head)"],
     yes:"result-masseter-deep", no:"result-overlap"
   },
   /* ══════════════════════════════════
      RESULTS
      ══════════════════════════════════ */
   "result-scm": {
     type:"result", diagnosis:"SCM Trigger Point — Myofascial Pain", confidence:"high",
     wiki_page:"Muscle:Sternocleidomastoid",
     chapter_ref:"Travell & Simons Vol.1 — Ch.7 Sternocleidomastoid",
     division:"both",
     notes:"Soreness may be misattributed to lymphadenopathy. Patient prefers to lie on the sore side with pillow supporting head so the sore face does not bear weight.",
     treatment_hint:"Spray and stretch (superior to inferior), ischemic compression, correct forward head posture. Treating SCM often improves satellite TrPs.",
     also_consider:["Scalene muscles","Splenius cervicis","Levator scapulae"],
     satellite_trps:["Scalene muscles","Sternalis","Pectoralis major","Pectoralis minor","Masseter","Temporalis","Orbicularis oculi","Frontalis"],
     confirmatory:[
       "Horner's excluded — pupils equal and reactive, no miosis, ciliospinal reflex present",
       "Spasmodic torticollis excluded — no jaw-pressure inhibition of head rotation; any dystonic movement ceases in sleep",
       "Note which head is more reactive: sternal (facial/autonomic symptoms) vs clavicular (dizziness/frontal headache)"
     ],
     landing_page_topics:[
       "Sternal vs clavicular division — full symptom profiles",
       "Dizziness — vestibular vs non-vestibular differentiation",
       "Neurological screen: Romberg, nystagmus, postural BP, carotid bruit",
       "Autonomic features — tearing, rhinitis, palpebral fissure narrowing",
       "Horner syndrome — full exclusion protocol",
       "CN XI entrapment — examination and monitoring",
       "Visual symptoms — venetian blinds phenomenon",
       "Patient posture and sleep advice",
       "Satellite TrP activation and treatment sequence"
     ],
     related_pages:[
       {label:"Scalene TrPs →", page:"Muscle:Scalene"},
       {label:"Sternalis TrP →", page:"Muscle:Sternalis"}
     ]
   },
   "result-masseter-superficial": {
     type:"result", diagnosis:"Masseter — Superficial Head Trigger Point", confidence:"high",
     wiki_page:"Trigger_point:Masseter_superficial", chapter_ref:"Travell & Simons Vol.1 — Ch.8",
     notes:"Refers to cheek, lower jaw, upper and lower molar teeth, and eyebrow. Chewing pain without restriction.",
     treatment_hint:"Spray and stretch, intraoral massage, correct parafunctional habits (clenching, bruxism)",
     also_consider:["Temporalis","Medial Pterygoid"]
   },
   "result-masseter-deep": {
     type:"result", diagnosis:"Masseter — Deep Head Trigger Point", confidence:"high",
     wiki_page:"Trigger_point:Masseter_deep", chapter_ref:"Travell & Simons Vol.1 — Ch.8",
     notes:"Refers deep into the ear and TMJ area. Tinnitus is a strongly associated feature of deep head involvement.",
     treatment_hint:"Deep pressure release, spray and stretch over TMJ, address bruxism",
     also_consider:["Lateral Pterygoid","SCM clavicular head"]
   },
   "result-medial-pterygoid": {
     type:"result", diagnosis:"Medial Pterygoid Trigger Point", confidence:"high",
     wiki_page:"Trigger_point:Medial_pterygoid", chapter_ref:"Travell & Simons Vol.1 — Ch.9",
     notes:"Refers to inside the mouth, hard palate, throat, posterior TMJ, and ear. Dysphagia is key distinguishing feature. Intraoral palpation required.",
     treatment_hint:"Intraoral spray and stretch, ischemic compression. Refer to dental/oral medicine if needed.",
     also_consider:["Lateral Pterygoid","Digastric (posterior belly)"]
   },
   "result-lateral-pterygoid": {
     type:"result", diagnosis:"Lateral Pterygoid Trigger Point", confidence:"high",
     wiki_page:"Trigger_point:Lateral_pterygoid", chapter_ref:"Travell & Simons Vol.1 — Ch.9",
     notes:"Refers to TMJ area and maxillary sinus. Pain on resisted jaw CLOSING is pathognomonic. Associated with jaw deviation and clicking.",
     treatment_hint:"Intraoral spray and stretch, address jaw deviation. Refer to dental/oral medicine for occlusal assessment.",
     also_consider:["Masseter deep head","Medial Pterygoid"]
   },
   "result-overlap": {
     type:"overlap",
     text:"Findings are inconclusive. Multi-muscle involvement or atypical presentation likely. Perform a full palpation screen of all four muscles.",
     screen_these:["SCM — Clavicular head","Masseter — superficial and deep heads","Medial Pterygoid (intraoral)","Lateral Pterygoid (intraoral)"],
     wiki_page:"Differential:Ear_TMJ_pain"
   },
   /* ══════════════════════════════════
      REFERRAL ENDPOINTS
      ══════════════════════════════════ */
   "refer-emergency-neuro": {
     type:"neuro_referral", urgency:"emergency",
     title:"Neurological Emergency — Do Not Proceed",
     body:"Impaired or lost consciousness with dizziness or head symptoms indicates serious neurological pathology. Differential includes: pontine haemorrhage, intracranial vascular lesion, cerebellopontine angle tumour, or petit mal epilepsy.",
     action:"Call emergency services or send directly to Emergency Department. Do not perform manual therapy."
   },
   "refer-urgent-fracture": {
     type:"neuro_referral", urgency:"emergency",
     title:"Possible Mandibular Fracture",
     body:"History of facial trauma with restricted mouth opening and/or bony crepitus on palpation of the mandible must be treated as a fracture until proven otherwise.",
     action:"Refer to oral/maxillofacial surgery or Emergency Department. Do not proceed with intraoral assessment."
   }
 }

};

/* ══════════════════════════════════════════════════════

  RED FLAGS
  ══════════════════════════════════════════════════════ */

var REDFLAG_DATA = {

 emergency: [
   { id:"rf-e1", label:"Otitis media / Mastoiditis",
     question:"Is there fever, acute hearing loss, or purulent ear discharge?",
     rationale:"Requires urgent antibiotic treatment or surgical referral",
     action:"Call emergency services or send directly to Emergency Department" },
   { id:"rf-e2", label:"Cardiac referred pain",
     question:"Is there jaw or ear pain with an exertional component, particularly on the left side?",
     rationale:"Cardiac pain can refer to the jaw and ear — must be excluded immediately",
     action:"Call emergency services immediately" }
 ],
 urgent: [
   { id:"rf-u1", label:"Temporal arteritis",
     question:"Is the patient aged 50+ with jaw claudication (pain building with chewing then easing), temporal headache, or scalp tenderness?",
     rationale:"Can cause irreversible blindness if untreated. Same-day ESR required.",
     action:"Same-day GP referral + ESR blood test" },
   { id:"rf-u2", label:"Parotid / neck malignancy",
     question:"Is there a hard fixed parotid or neck swelling, or any facial nerve weakness?",
     rationale:"Possible salivary gland malignancy with nerve involvement",
     action:"Urgent ENT or oncology referral" },
   { id:"rf-u3", label:"Cervical instability",
     question:"Is there a history of trauma to the head or neck combined with upper cervical pain and ear symptoms?",
     rationale:"Odontoid fracture or cervical instability can refer to the ear region",
     action:"Urgent spinal assessment — no manual therapy until cleared" }
 ]

};

/* ══════════════════════════════════════════════════════

  BROAD DIFFERENTIAL
  ══════════════════════════════════════════════════════ */

var BROAD_DIFF_DATA = [

 { id:"bd-1", condition:"Ménière's Disease", confidence:"uncommon",
   mimics:"Episodic deep ear fullness, tinnitus, and dizziness — overlaps strongly with SCM clavicular and masseter deep head patterns",
   distinguishing_feature:"Triad of fluctuating unilateral sensorineural hearing loss, episodic rotational vertigo (minutes to hours), and low-frequency tinnitus. Nystagmus during attacks.",
   action:"Refer to ENT / audiovestibular medicine. Audiometry and caloric testing." },
 { id:"bd-2", condition:"Ramsay Hunt Syndrome", confidence:"rare",
   mimics:"Deep ear pain indistinguishable from SCM clavicular referral at onset",
   distinguishing_feature:"Vesicular eruption in the ear canal or on the pinna — may appear days after pain onset. Facial nerve palsy may follow.",
   action:"Examine the ear canal at every visit. If vesicles present, refer urgently — antiviral window is 72 hours." },
 { id:"bd-3", condition:"Eagle Syndrome", confidence:"rare",
   mimics:"Throat, ear, and TMJ pain overlapping with medial pterygoid and SCM patterns",
   distinguishing_feature:"Pain provoked by turning the head or swallowing. Elongated styloid process may be palpable in the tonsillar fossa on intraoral examination.",
   action:"Panoramic radiograph to assess styloid length. Refer to oral/maxillofacial surgery." },
 { id:"bd-4", condition:"Glossopharyngeal Neuralgia", confidence:"rare",
   mimics:"Severe episodic ear and throat pain overlapping with SCM and medial pterygoid referral",
   distinguishing_feature:"Lancinating, electric shock quality — seconds to minutes duration. Triggered by swallowing, talking, or yawning.",
   action:"Refer to neurology. Carbamazepine is first-line." },
 { id:"bd-5", condition:"Tic Douloureux (Trigeminal Neuralgia)", confidence:"rare",
   mimics:"Facial and jaw pain overlapping with masseter, temporalis, and SCM sternal patterns",
   distinguishing_feature:"Lancinating electric shock quality with characteristic facial grimace. Consciousness is unimpaired. Trigger zones on face. Ceases between attacks completely.",
   action:"Refer to neurology. MRI to exclude vascular compression. Carbamazepine first-line." },
 { id:"bd-6", condition:"Cerebellopontine Angle Tumour", confidence:"rare",
   mimics:"Unilateral ear symptoms, dizziness, and tinnitus overlapping with SCM clavicular and masseter deep patterns",
   distinguishing_feature:"Progressive unilateral sensorineural hearing loss, tinnitus, facial numbness (V), and facial weakness (VII) develop over months. Positive Romberg.",
   action:"Refer to neurology / ENT. MRI internal auditory meatus urgently." },
 { id:"bd-7", condition:"Subclavian Steal Syndrome", confidence:"rare",
   mimics:"Postural dizziness and neck-related symptoms overlapping with SCM clavicular TrP pattern",
   distinguishing_feature:"Reversed vertebral artery flow from subclavian stenosis. BP difference of >15mmHg between arms. Bruit in supraclavicular fossa. Symptoms provoked by arm exercise.",
   action:"Check BP in both arms. Refer to vascular surgery. Carotid/subclavian Doppler." },
 { id:"bd-8", condition:"Adrenocortical Insufficiency", confidence:"rare",
   mimics:"Postural dizziness identical to SCM clavicular division pattern",
   distinguishing_feature:"Orthostatic hypotension (≥20mmHg systolic drop on standing). Generalised fatigue, skin hyperpigmentation, salt craving. Dizziness on rising or postural change.",
   action:"Refer to GP / endocrinology for serum cortisol and ACTH stimulation test." },
 { id:"bd-9", condition:"Spasmodic Torticollis", confidence:"uncommon",
   mimics:"Neck pain and head posture changes resembling SCM TrP-driven posture",
   distinguishing_feature:"Involuntary head rotation inhibited by gentle pressure on jaw ipsilateral to rotation (geste antagoniste). Dystonic movement ceases completely during sleep.",
   action:"Refer to neurology. Botulinum toxin injection is first-line treatment." },
 { id:"bd-10", condition:"Sialolithiasis (Parotid duct calculus)", confidence:"uncommon",
   mimics:"Pre-auricular and TMJ area pain resembling masseter deep head TrP",
   distinguishing_feature:"Pain peaks predictably during or before meals. Visible or palpable parotid swelling that partially resolves after eating.",
   action:"Palpate parotid duct. Ultrasound first-line. Refer to oral surgery." }

];

/* ══════════════════════════════════════════════════════

  NODE META
  ══════════════════════════════════════════════════════ */

var NODE_META = {

 rom:              { color:'#1d4ed8', icon:'🔄', label:'Movement Screen' },
 nerve_entrapment: { color:'#6d28d9', icon:'⚡', label:'Nerve Screen' },
 symptom:          { color:'#0f766e', icon:'💬', label:'Patient Symptom' },
 examination:      { color:'#15803d', icon:'🩺', label:'Examination' },
 result:           { color:'#15803d', icon:'✅', label:'Diagnosis' },
 overlap:          { color:'#78716c', icon:'🔍', label:'Inconclusive' },
 neuro_referral:   { color:'#b91c1c', icon:'🧠', label:'Neurological Referral' }

};