GI bleed (ED workup — upper + lower undifferentiated)
Phase C shard-3-neuro-sym wave-8 expansion (2026-05-15) — pattern-matches symptom.chest_pain.ed_undifferentiated.v1 (be7b7d2f) and symptom.abdominal_pain.ed.v1 / symptom.back_pain.ed.v1 (10eb1bcb wave-7). Engine scope: ED triage + risk-stratification + disposition for the adult undifferentiated GI bleed presentation, covering BOTH upper (hematemesis / coffee-ground / melena) and lower (hematochezia / occult anemia) sources. Downstream confirmed diagnoses route to: gi.ugib.core.v1 (UGI non-variceal), gi.variceal_bleed.v1 (variceal), gi.cirrhosis.core.v1 (cirrhotic decompensation), gi.lgib.core.v1 (LGI bleed), gi.peptic-ulcer.core.v1 (PUD), gi.acute-pancreatitis.core.v1 (hemorrhagic), gi.hepatic-encephalopathy.core.v1 (HE overlay), cardio.nstemi.core.v1 (demand ischemia), id.sepsis.core.v1 (sepsis overlap), symptom.abdominal_pain.ed.v1, symptom.jaundice.v1. Bayesian linkage (LR+, LR−, T_treat, T_test, pre-test priors by source + age, Glasgow-Blatchford / AIMS65 / Rockall / Oakland thresholds) lives in companion depth bundle _briefs/symptom.gi_bleed.ed.v1.depth.md — schema has no first-class likelihood-ratio field. 11 sibling-differentiation rows cover the key look-alikes (UGI / variceal / cirrhosis / LGI / PUD / pancreatitis / NSTEMI / sepsis / hepatic encephalopathy / abdominal pain symptom / jaundice symptom). 14 severity triggers (≥10 per spec): massive_bleed_hemodynamic_instability + upper_gi_bleed_hematemesis + variceal_bleed_cirrhosis + lower_gi_bleed_hematochezia + occult_iron_deficiency_anemia + nsaid_anticoag_induced_bleed + aorto_enteric_fistula + dieulafoy_lesion + mallory_weiss_boerhaave + colonic_diverticular_bleed + angiodysplasia_avm + demand_ischemia_type2_mi + sepsis_post_endoscopy + hepatic_encephalopathy_overlay. Schema-blocked emitted: Glasgow-Blatchford (GBS) / Rockall (clinical + complete) / AIMS65 / Forrest classification / Oakland (LGIB) / workup.gi_bleed — none in clinical-tools-registry; manual application in setting playbook required_assessments + ticketed in shard-3 state file. Regimen_axes intentionally empty — engine is triage-only. Supportive drug actions (LR/pRBC, IV PPI, octreotide, ceftriaxone, erythromycin pre-EGD, 4F-PCC / andexanet / idarucizumab for anticoag reversal, platelets, FFP, esmolol/labetalol for impulse control in suspected AEF) live in setting_playbooks.ed.drug_actions; definitive treatment is owned by downstream routed engines. Setting playbook: single `ed` per user spec — outpatient GI bleed workup is a future engine. SCAFFOLDED status: no workup.gi_bleed in clinical-tools-registry; PRODUCTION audit would fail. Will promote once registry entries land.
Entry points (10)
- symptomHematemesis (bright red OR coffee-ground emesis) — upper GI bleed proximal to ligament of Treitz (Laine Am J Gastro 2012 PMID 22825597; ACG 2023 PMID 36038243)hematemesis
- symptomMelena (black tarry stool) — usually upper GI source (~90%); lower source if right-sided + slow transit (Laine 2012)melena
- symptomHematochezia (bright red blood per rectum) — lower GI source ~85%; massive UGI bleed ~15% (Strate ACG 2016 PMID 24042191)hematochezia
- symptomOccult bleed — positive FOBT / iron-deficiency anemia without overt bleeding (Strate 2016)occult_gi_bleed
- vital_abnormalitySBP <90 OR HR >120 OR shock index >1 OR Hgb drop ≥2 g/dL with GI bleed — life-threat triage (massive UGI bleed, variceal bleed, aorto-enteric fistula, ruptured AAA)hemodynamic_instability_gi_bleed
- lab_abnormalityAcute Hgb drop ≥2 g/dL or BUN:Cr >30 (UGI bleed signature from absorbed blood protein) (Laine 2012)acute_drop_in_hgb
- historyKnown cirrhosis / portal HTN / prior varices / EGD banding → variceal bleed phenotype (Garcia-Tsao AASLD 2017 PMID 21670378)known_cirrhosis_or_portal_htn
- historyRecent AAA repair or aortic graft + UGI bleed → aorto-enteric fistula STAT (Laine 2012)recent_aaa_repair_or_aortic_graft
- historyNSAID / DOAC / warfarin / antiplatelet use → drug-induced bleed; deprescribe + reversal (Laine 2012)nsaid_or_anticoag_use
- historyRepeated retching before hematemesis → Mallory-Weiss tear (usually self-limited) OR Boerhaave (transmural — surgical emergency)post_emetic_retching
Required inputs (34)
- agerequireddemographic • used at CONTEXTAge shifts priors: variceal/PUD peaks 50-70; diverticular/angiodysplasia >65; Meckel diverticulum pediatric (Laine 2012; Strate 2016)
- sexrequireddemographic • used at CONTEXTMale preponderance for cirrhosis / variceal bleed; female preponderance for angiodysplasia / aortic stenosis-associated GI bleed (Heyde syndrome) (Strate 2016)
- bleed_characterrequiredsymptom • used at FRAMEHematemesis / coffee-ground / melena / hematochezia / occult — each anchors location and acuity (Laine 2012)
- bleed_onset_timerequiredsymptom • used at FRAMEAcute vs subacute vs chronic — drives resuscitation tempo and intervention urgency (Laine 2012)
- bleed_volume_estimaterequiredsymptom • used at FRAMEEstimated volume (tablespoons / cups / "filled the toilet") + frequency → resuscitation magnitude (Laine 2012)
- associated_abdominal_painrequiredsymptom • used at ENTRYPUD / mesenteric ischemia / pancreatitis / aorto-enteric fistula / perforation — pain pattern differentiates (route to symptom.abdominal_pain.ed.v1 overlay)
- associated_retching_vomitingrequiredsymptom • used at ENTRYRetching before hematemesis = Mallory-Weiss; persistent vomiting + chest pain + subcutaneous emphysema = Boerhaave
- syncope_or_presyncoperequiredsymptom • used at ENTRYSyncope/presyncope with GI bleed implies significant volume loss → high pretest for massive bleed (Laine 2012)
- jaundice_or_ascitessymptom • used at ENTRYJaundice + ascites → cirrhosis → variceal source until proven otherwise (Garcia-Tsao 2017 PMID 21670378)
- change_in_bowel_habitsymptom • used at ENTRYNew-onset change + LGI bleed + weight loss + age >50 → colorectal CA screen (Strate 2016)
- sbprequiredvital • used at CONTEXTHypotension flags massive bleed; orthostatics (SBP drop ≥20 mmHg) indicate >15% volume loss (Laine 2012)
- hrrequiredvital • used at CONTEXTTachycardia early; HR >120 implies >30% volume loss; shock index (HR/SBP) >1 → severe (Laine 2012)
- rrrequiredvital • used at CONTEXTTachypnea in compensated hemorrhagic shock or aspiration (Laine 2012)
- spo2requiredvital • used at CONTEXTHypoxia → aspiration of blood / pulmonary edema from over-resuscitation
- temprequiredvital • used at CONTEXTFever in cirrhotic + GI bleed → SBP empiric ceftriaxone per AASLD (Garcia-Tsao 2017)
- cirrhosis_or_portal_htnrequiredhistory • used at CONTEXTCirrhosis triples mortality in UGI bleed; mandates variceal pathway + ceftriaxone prophylaxis + octreotide (Garcia-Tsao 2017 PMID 21670378)
- prior_ugi_bleedrequiredhistory • used at CONTEXTPrior PUD / varices / Mallory-Weiss / Dieulafoy raise pretest for recurrence (Laine 2012)
- nsaid_aspirin_userequiredhistory • used at CONTEXTNSAID-induced PUD is leading non-H. pylori cause of UGI bleed; deprescribe + PPI prophylaxis (Laine 2012; FDA PPI long-term PMID 27069334)
- anticoagulant_antiplatelet_userequiredhistory • used at CONTEXTWarfarin / DOAC / DAPT raise bleed severity + complicate hemostasis; reversal pathway (4F-PCC for warfarin; andexanet/idarucizumab for DOAC; transfusion for antiplatelet)
- prior_aaa_or_aortic_graftrequiredhistory • used at CONTEXTAorto-enteric fistula classically presents with herald bleed → massive bleed; STAT CTA aorta + vascular surgery (Laine 2012)
- radiation_to_pelvishistory • used at CONTEXTPelvic radiation → radiation proctitis (chronic hematochezia) (Strate 2016)
- cardiac_disease_demand_ischemiarequiredhistory • used at CONTEXTUnderlying CAD + acute anemia → demand ischemia (type 2 MI) — keep Hgb >7-8 g/dL; route to cardio.nstemi.core.v1 if hs-cTn rise
- cbc_with_diffrequiredlab • used at INITIAL_WORKUPHgb / Hct may be initially normal in acute bleed (equilibrium ~24 h); platelet count <50 alters transfusion threshold; serial Hgb drives transfusion decisions
- bmprequiredlab • used at INITIAL_WORKUPBUN:Cr >30 (with normal renal function) is signature of UGI bleed from absorbed Hgb protein load (Laine 2012); AKI in poor perfusion
- lftrequiredlab • used at INITIAL_WORKUPAST/ALT/bili/alb/INR for cirrhosis recognition + Child-Pugh / MELD severity (Garcia-Tsao 2017)
- coags_inr_pttrequiredlab • used at INITIAL_WORKUPINR / PTT for coagulopathy; cirrhotic patients have rebalanced hemostasis (not always corrected with FFP); on anticoagulant patients need reversal pathway
- type_and_crossrequiredlab • used at INITIAL_WORKUPMANDATORY type & cross ≥2-4 units pRBC; ≥4-6 units if hemodynamically unstable; activate massive transfusion protocol if needed
- lactaterequiredlab • used at INITIAL_WORKUPLactate >2 raises shock / mesenteric ischemia / sepsis prior; lactate clearance tracks resuscitation adequacy (SSC 2026)
- troponin_hslab • used at INITIAL_WORKUPHs-cTn for demand ischemia (type 2 MI) — common in massive bleed + underlying CAD; route to cardio.nstemi.core.v1 if rise/fall pattern
- ecg_12_leadrequiredimaging • used at INITIAL_WORKUPECG for demand ischemia screen + baseline rhythm; ST-changes prompt cardio.nstemi.core.v1 overlay
- upright_cxrimaging • used at INITIAL_WORKUPFree air under diaphragm = perforated viscus (PUD perforation); mediastinal widening / pneumomediastinum = Boerhaave
- cta_abdomen_for_aefimaging • used at BRANCHING_WORKUPCTA abdomen if aorto-enteric fistula suspected (prior AAA repair / aortic graft + UGI bleed) — STAT vascular surgery (Laine 2012)
- cta_mesenteric_for_lgibimaging • used at BRANCHING_WORKUPCT angiography for active LGIB localization (>0.3 mL/min bleed rate) → IR embolization (Strate 2016 PMID 24042191)
- rbc_scan_for_obscure_bleedimaging • used at BRANCHING_WORKUPTc-99m RBC scintigraphy for slow / intermittent obscure GI bleed when EGD + colonoscopy negative (Strate 2016)
12-phase flow (12)
- 1FRAMEBleed character (hematemesis / melena / hematochezia / occult), onset, volume, hemodynamic state, anchor source (UGI vs LGI vs occult) (Laine 2012; Strate 2016)inputs: bleed_character, bleed_onset_time, bleed_volume_estimate, sbpadvance: bleed characterized + hemodynamic risk classified
- 2ENTRYAssociated abdominal pain, retching, syncope/presyncope, jaundice/ascites, bowel-habit change → narrow phenotype (Laine 2012)inputs: associated_abdominal_pain, associated_retching_vomiting, syncope_or_presyncope, jaundice_or_ascites, change_in_bowel_habitadvance: entry presentation captured
- 3CONTEXTAge, sex, cirrhosis/portal HTN, prior GI bleed, NSAID/aspirin, anticoagulant/antiplatelet, prior AAA/aortic graft, pelvic RT, cardiac disease, vitals + temp (Laine 2012; Garcia-Tsao 2017)inputs: age, sex, sbp, hr, rr, spo2, temp, cirrhosis_or_portal_htn, prior_ugi_bleed, nsaid_aspirin_use, anticoagulant_antiplatelet_use, prior_aaa_or_aortic_graft, cardiac_disease_demand_ischemiaadvance: context complete
- 4RED_FLAGSMassive bleed with hemodynamic instability; aorto-enteric fistula (prior AAA repair + UGI bleed); ruptured esophagus (Boerhaave); cirrhotic variceal bleed; demand ischemia / type 2 MI; perforated PUD; mesenteric ischemia overlap (Laine 2012; Garcia-Tsao 2017)inputs: sbp, hradvance: no immediate life-threat OR resuscitation + downstream engine activation
- 5INITIAL_WORKUPCBC + diff, BMP (BUN:Cr ratio), LFT + albumin + INR, PTT, type & cross ≥2-4 units, lactate, hs-cTn (selective), ECG, upright CXR if perforation suspected (Laine 2012; ACG 2023 PMID 36038243)inputs: cbc_with_diff, bmp, lft, coags_inr_ptt, type_and_cross, lactate, troponin_hs, ecg_12_lead, upright_cxractions: panel.cbc, panel.renal, panel.lft, panel.coag, panel.cardiacadvance: initial workup reviewed + risk score assigned
- 6BRANCHING_WORKUPUGI bleed: pre-endoscopy IV PPI + octreotide if cirrhotic + ceftriaxone prophylaxis + EGD within 24 h (Laine 2012; ESGE 2017 PMID 27083250). LGI bleed: hemodynamically stable → colonoscopy within 24 h after prep; unstable + active → CTA + IR embolization (Strate 2016 PMID 24042191). Obscure: capsule endoscopy / push enteroscopy / RBC scan. Suspected aorto-enteric fistula → STAT CTA + vascular surgery.inputs: cta_abdomen_for_aef, cta_mesenteric_for_lgib, rbc_scan_for_obscure_bleedadvance: definitive procedure pathway selected
- 7DIFFERENTIALUGI phenotypes (Laine 2012): PUD ~30-50%, varices ~10-15%, Mallory-Weiss ~5-10%, esophagitis ~5%, gastritis ~5%, malignancy ~5%, Dieulafoy ~1-3%, aorto-enteric fistula <1% but lethal. LGI phenotypes (Strate 2016): diverticular ~30-40%, angiodysplasia ~5-15%, colitis (ischemic/infectious/IBD) ~10-20%, neoplasm ~10%, hemorrhoidal/anorectal ~10%, post-polypectomy ~5%, radiation proctitis ~3%. Occult: angiodysplasia / NSAID-PUD / malignancy.advance: phenotype ranked with pre-test priors
- 8RISK_STRATIFICATIONUGI: Glasgow-Blatchford (GBS) ≤1 → low risk outpatient; ≥7 → high risk endoscopy + ICU; pre-endoscopy Rockall (age + shock + comorbidity); AIMS65 (alb<3, INR>1.5, AMS, SBP<90, age>65) — schema-blocked in clinical-tools-registry. LGIB: Oakland score (age, sex, prior LGIB, HR, SBP, Hgb, exam) for outpatient triage — schema-blocked. Forrest classification at endoscopy (Ia spurter → IIc pigmented spot → III clean base) drives endoscopic Rx + rebleed risk (Laine 2012). Cirrhotic: Child-Pugh / MELD overlay (Garcia-Tsao 2017).inputs: age, sbp, hradvance: risk scores documented
- 9TREATMENTResuscitation (restrictive Hgb 7 g/dL trigger for stable; 8 g/dL for cardiac comorbidity per Villanueva NEJM 2013); two large-bore IVs; crystalloid then pRBC; massive transfusion protocol if SBP <90 despite 2 L; reverse anticoagulation (4F-PCC for warfarin INR >1.5, andexanet for apixaban/rivaroxaban, idarucizumab for dabigatran, platelets if <50 or on antiplatelet); IV PPI (omeprazole 80 mg bolus + 8 mg/hr OR pantoprazole 80 mg IV) for ALL suspected UGI bleed pending EGD (Laine 2012); octreotide 50 mcg IV bolus + 50 mcg/hr for suspected variceal source (Garcia-Tsao 2017); ceftriaxone 1 g IV daily x 7 days for cirrhotic UGI bleed (SBP prophylaxis); erythromycin 250 mg IV 30-90 min pre-EGD for gastric blood clearance.inputs: sbp, cbc_with_diffadvance: resuscitation initiated; endoscopic / IR / surgical pathway selected
- 10DISPOSITIONGBS 0-1 → outpatient EGD if reliable follow-up; GBS ≥7 OR Rockall ≥3 → admit + EGD within 24 h; hemodynamically unstable / massive bleed / variceal bleed / suspected aorto-enteric fistula → ICU + emergent intervention; LGIB unstable + active → CTA + IR; LGIB stable → colonoscopy within 24 h; obscure bleed → admit for capsule / push enteroscopy; cirrhotic variceal → ICU + EGD banding + octreotide + ceftriaxone → route to gi.variceal_bleed.v1.advance: disposition assigned + downstream handoff complete
- 11MONITORINGSerial vitals q15 min × 1 h then q30 min × 4 h; serial Hgb q4-6h × 24 h then q12-24h; lactate clearance; urine output ≥0.5 mL/kg/h; mental status; serial abdominal exams (perforation watch); telemetry if cardiac comorbidityinputs: cbc_with_diff, lactate, sbpadvance: stability achieved or escalation triggered
- 12FOLLOWUPDischarged low-risk UGI bleed: PPI 8 wks + H. pylori test-and-treat + outpatient EGD ≤2 wks + return precautions; cirrhotic post-bleed: 2° prophylaxis (NSBB + endoscopic surveillance per AASLD); discharge bundle (NSAID deprescribe, alcohol cessation counseling); LGIB diverticular: low-residue diet + outpatient colonoscopy 4-8 wks; H. pylori-positive PUD → triple/quadruple therapyadvance: discharge bundle prescribed + follow-up scheduled