A patient presented to the hospital with melena (dark stool), gastrointestinal ulcer, and low hemoglobin and hematocrit. Which ICD‑10 codes should be assigned for these findings and the associated CBC and CMP laboratory results?

Medical Advisory BoardAll articles are reviewed for accuracy by our Medical Advisory Board
Educational purpose only • Exercise caution as content is pending human review
Article Review Status
Submitted
Under Review
Approved

Last updated: October 26, 2026 • View editorial policy

Have a follow-up question?

Our Medical A.I. is used by practicing medical doctors at top research institutions around the world. Ask any follow up question and get world-class guideline-backed answers instantly.

ICD-10 Coding for Melena with Anemia and GI Ulcer

For this patient presenting with melena (dark stool), gastrointestinal ulcer, and low hemoglobin/hematocrit, use K92.1 (Melena) as the principal diagnosis code, followed by D62 (Acute posthemorrhagic anemia) and the specific ulcer code (K25.x-K28.x series depending on ulcer location and bleeding status).

Primary Diagnosis Code Selection

The principal diagnosis should reflect the reason for admission and the most clinically significant condition requiring immediate intervention. Based on the clinical presentation:

  • K92.1 (Melena) is the most appropriate principal diagnosis code, as melena represents the presenting symptom that brought the patient to the hospital and indicates active or recent gastrointestinal bleeding 1.

  • Melena is defined as "the passage of black tarry stools" and generally indicates more severe bleeding, particularly when accompanied by hemodynamic changes 1.

Secondary Diagnosis Codes

Anemia Code

  • D62 (Acute posthemorrhagic anemia) should be assigned as a secondary diagnosis to capture the low hemoglobin and hematocrit resulting from the GI bleeding.

  • This code specifically identifies anemia due to blood loss, which is clinically distinct from chronic anemia and carries different management implications 2.

Ulcer-Specific Codes

The specific ulcer code depends on endoscopic findings:

  • K25.0 - Gastric ulcer, acute with hemorrhage
  • K25.4 - Gastric ulcer, chronic with hemorrhage
  • K26.0 - Duodenal ulcer, acute with hemorrhage
  • K26.4 - Duodenal ulcer, chronic with hemorrhage
  • K27.0 - Peptic ulcer, site unspecified, acute with hemorrhage
  • K27.4 - Peptic ulcer, site unspecified, chronic with hemorrhage

Use the 4th digit to specify acute versus chronic and the 5th digit to indicate hemorrhage status. If endoscopy has not yet been performed, K27.x (peptic ulcer, site unspecified) is appropriate until the specific location is identified 1.

Laboratory Test Justification

For the CBC and CMP orders:

  • K92.1 (Melena) justifies both CBC and CMP
  • D62 (Acute posthemorrhagic anemia) provides additional support for CBC monitoring
  • The ulcer code supports metabolic panel monitoring for complications

These codes together establish medical necessity for laboratory monitoring, as low hemoglobin levels are critical prognostic indicators in upper GI bleeding and guide transfusion decisions 2.

Important Coding Considerations

Code positioning matters significantly: Placing bleeding codes in the primary position demonstrates higher positive predictive value (86.9%) but lower sensitivity (36.0%) compared to including secondary position codes, which improves sensitivity to 69.5% 3.

Avoid adverse effect codes: ICD-10 adverse effect/poisoning codes (T45.5x series) are rarely used in practice and would miss over 90% of anticoagulant-related bleeding cases 3. Only use these if medication-induced bleeding is explicitly documented as the primary etiology.

Specificity improves with endoscopy: Once endoscopy identifies the specific ulcer location and characteristics (active bleeding, visible vessel, adherent clot), update to the most specific code available 1.

The combination of K92.1, D62, and the appropriate ulcer code provides comprehensive documentation of the clinical scenario while ensuring appropriate reimbursement for the laboratory studies performed.

Professional Medical Disclaimer

This information is intended for healthcare professionals. Any medical decision-making should rely on clinical judgment and independently verified information. The content provided herein does not replace professional discretion and should be considered supplementary to established clinical guidelines. Healthcare providers should verify all information against primary literature and current practice standards before application in patient care. Dr.Oracle assumes no liability for clinical decisions based on this content.