Clinical Commander

All dossiers
gi.ugib.core.v1

Upper GI Bleeding

gastroenterologyacuteadultacuteinpatient

Manifest is full and current (ACG 2021 + ESGE 2021 + Baveno VII 2022 + NICE NG141 2024 + TRIGGER + HALT-IT + ABOVE 2024 + PLACE 2024) with 10 phenotypes (peptic-ulcer Forrest, variceal, Mallory-Weiss, Dieulafoy, Cameron, erosive, malignancy, on-anticoag, massive hemodynamic, obscure recurrent) and full medication/dosing tables. Problem-package at assessment-of-upper-gastrointestinal-bleeding/ has all atoms; design brief lives at sibling gi.gi_bleed.acute/_design-brief.md (shared with LGIB). Workup `ugib` is registered in clinical-tools-registry. GBS, AIMS-65, MELD-Na, shock index, qSOFA calculators wired. Gaps for PRODUCTION: evidence.pmids array empty (manifest cites guideline labels but no numeric PMIDs); no engine-specific test_files; manifest LOINC array contains a placeholder line (14647-2 marked as not needed — clean up before promoting). No regimen_axes — pantoprazole/esomeprazole/omeprazole, octreotide, terlipressin, ceftriaxone variceal prophylaxis, carvedilol secondary prophylaxis, vitamin K, 4F-PCC, idarucizumab, andexanet alfa, PRBC, norepinephrine, erythromycin prokinetic all in manifest.medications without RxCUI verification through regimen-builder.

Entry points (4)

  • symptom
    Hematemesis (red blood or coffee-ground)
    hematemesis
  • symptom
    Melena (black tarry stools)
    melena
  • symptom
    Syncope / presyncope with GI blood loss
    syncope_with_blood_loss
  • lab_abnormality
    Acute drop in hemoglobin / elevated BUN:Cr
    acute_drop_in_hgb

Required inputs (18)

  • agerequired
    demographic • used at CONTEXT
    AIMS-65 age >65 component; mortality stratification (Saltzman 2011)
  • sbprequired
    vital • used at CONTEXT
    SBP <90 hemodynamically unstable; AIMS-65 component (ACG 2021 Laine)
  • hrrequired
    vital • used at CONTEXT
    Tachycardia / shock index; GBS component (ACG 2021 Laine)
  • hemoglobinrequired
    lab • used at INITIAL_WORKUP
    GBS component; transfusion threshold (Hgb 7 per ACG 2021 / TRIGGER)
  • plateletsrequired
    lab • used at INITIAL_WORKUP
    Coagulopathy management (ACG 2021 Laine)
  • inrrequired
    lab • used at INITIAL_WORKUP
    AIMS-65 INR >1.5; warfarin reversal threshold
  • bunrequired
    lab • used at INITIAL_WORKUP
    GBS component; elevated BUN:Cr suggests upper source (ACG 2021 Laine)
  • creatininerequired
    lab • used at INITIAL_WORKUP
    Renal function; contrast safety; medication dosing (ACG 2021)
  • albuminrequired
    lab • used at INITIAL_WORKUP
    AIMS-65 albumin <3
  • lactate
    lab • used at RED_FLAGS
    Perfusion marker for shock (ESGE 2021)
  • lft_for_cirrhosis
    lab • used at BRANCHING_WORKUP
    MELD if variceal source; cirrhosis severity (Baveno VII 2022)
  • egd_within_24hrequired
    imaging • used at INITIAL_WORKUP
    Diagnostic + therapeutic; Forrest classification
  • cta_abdomen_if_massive
    imaging • used at BRANCHING_WORKUP
    Localize bleed if EGD non-diagnostic / massive (ACG 2021 Laine)
  • cirrhosis_or_varicesrequired
    history • used at CONTEXT
    Variceal pathway — Baveno VII vasoactive + abx prophylaxis
  • nsaid_aspirin_userequired
    history • used at CONTEXT
    PUD pathway; PPI co-prescription (ACG 2021 Laine)
  • anticoag_antiplateletrequired
    history • used at CONTEXT
    Reversal decision; aspirin continuation for secondary CV prevention (ACG 2021 Laine)
  • aortic_graft
    history • used at CONTEXT
    Aortoenteric fistula — emergent vascular surgery (ACG 2021)
  • retching_vomiting_preceding
    history • used at CONTEXT
    Mallory-Weiss tear pattern (ACG 2021)

12-phase flow (12)

  1. 1FRAME
    Confirm UGIB scope; remember some apparent UGIB is actually nasal/oropharyngeal swallowed blood — and ~15% of melena can be lower source (ACG 2021 Laine)
    inputs: age
    advance: upper source plausible
  2. 2ENTRY
    Recognize hematemesis, coffee-ground emesis, melena, syncope with blood loss, acute Hgb drop
    advance: one entry trigger present
  3. 3CONTEXT
    Vitals, cirrhosis/varices history, NSAID/aspirin, anticoag/antiplatelet, retching, alcohol, prior PUD/HP, aortic graft, malignancy symptoms
    inputs: sbp, hr, cirrhosis_or_varices, nsaid_aspirin_use, anticoag_antiplatelet, aortic_graft, retching_vomiting_preceding
    advance: context captured
  4. 4RED_FLAGS
    Massive hematemesis, hemodynamic instability, syncope, AMS, ongoing hematemesis despite resuscitation, anticoagulation with active bleed, known varices/cirrhosis, anemia-induced ACS, suspected aortoenteric fistula
    inputs: sbp, hr, hemoglobin, lactate
    advance: unstable patient routed to ICU/airway protection or stabilized
  5. 5INITIAL_WORKUP
    CBC, type and crossmatch, BMP (BUN/Cr), coags (INR/aPTT), lactate, LFTs+albumin+bilirubin, ECG/troponin in anemia, GBS calculation, EGD within 24h
    inputs: hemoglobin, platelets, inr, bun, creatinine, albumin, egd_within_24h
    actions: panel.cbc, panel.lft, panel.renal, ugib
    advance: baseline labs + EGD plan / GBS computed
  6. 6BRANCHING_WORKUP
    CTA if massive / EGD non-diagnostic; liver US + MELD if cirrhosis; capsule endoscopy if obscure recurrent; H. pylori biopsy at EGD
    inputs: cta_abdomen_if_massive, lft_for_cirrhosis
    advance: phenotype identified (peptic-ulcer-Forrest / variceal / Mallory-Weiss / Dieulafoy / Cameron / erosive / malignancy / on-anticoag / massive / obscure)
  7. 7DIFFERENTIAL
    PUD > varices > Mallory-Weiss > erosive esophagitis/gastritis > Dieulafoy > Cameron lesion > malignancy > angiodysplasia > aortoenteric fistula > hemobilia > epistaxis swallowed blood
    advance: etiology + Forrest stage identified
  8. 8RISK_STRATIFICATION
    Glasgow-Blatchford pre-EGD (GBS 0-1 → outpatient), AIMS-65 mortality, shock index, MELD if variceal, Rockall post-EGD, Forrest classification
    inputs: hemoglobin, bun, sbp, inr, albumin
    actions: calc.glasgow_blatchford, calc.aims65, calc.meld_na, calc.shock_index
    advance: risk score documented; outpatient eligibility decided
  9. 9TREATMENT
    ABC resuscitation, restrictive transfusion (Hgb 7; 8-9 ACS), pre-EGD IV PPI (note: ABOVE 2024 — PPI no benefit pre-EGD), EGD within 24h with hemostasis, post-EGD high-dose IV PPI x 72h for high-risk Forrest (PLACE 2024); variceal: octreotide + ceftriaxone prophylaxis + band ligation + TIPS for refractory; HALT-IT 2020: NO tranexamic acid; anticoag reversal (vit K + 4F-PCC for warfarin; idarucizumab for dabigatran; andexanet for Xa)
    inputs: hemoglobin, inr
    advance: hemostasis achieved or escalated to IR/surgery
  10. 10DISPOSITION
    ICU for hemodynamic instability / variceal bleed / massive transfusion / airway concern; floor for stable; outpatient discharge if GBS 0-1
    inputs: sbp
    advance: destination set
  11. 11MONITORING
    Serial Hgb q6-8h, vitals q1-4h, hourly UOP if shock, lactate clearance q6h, stool color/output, coags post-reversal, rebleeding watch 48-72h, hepatic encephalopathy watch in variceal
    inputs: hemoglobin
    advance: stable for 24h or escalated
  12. 12FOLLOWUP
    Repeat EGD 6-8w for ulcer/malignancy; HP eradication confirmation 4w; variceal band ligation series q2-4w + secondary NSBB prophylaxis; anticoag resumption with cardiology; GI clinic 2-4w; iron studies
    advance: follow-up scheduled