Skip to content

fix(pgx): drug cards invisible + wrong metabolizer status#33

Merged
glebis merged 1 commit into
mainfrom
fix/pgx-category-and-status-mapping
May 7, 2026
Merged

fix(pgx): drug cards invisible + wrong metabolizer status#33
glebis merged 1 commit into
mainfrom
fix/pgx-category-and-status-mapping

Conversation

@glebis

@glebis glebis commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Drug cards never rendered: YAML uses category: drug but PGxPanel filters on === 'prescription' — all prescription drug cards were invisible since launch
  • Metabolizer status wrong for 3+ enzymes: mapMetabolizerStatus only matched 4 exact strings; vault values like caution, reference, intermediate-metabolizer, needs_review, high-activity all fell through to normal. CYP2C9 (*1/*2, intermediate) was showing as normal metabolizer.

Test plan

  • 492 frontend tests pass
  • Verify prescription drug cards now appear under each enzyme section
  • Verify CYP2C9 shows as intermediate metabolizer (not normal)
  • Check safety filter shows danger/warning cards correctly

Fixes bugs found during #25 exploration.

🤖 Generated with Claude Code

…alues

Two bugs found during #25 exploration:

1. Category mismatch: YAML uses `category: drug` but PGxPanel filters
   on `=== 'prescription'`, making all prescription drug cards invisible.
   Fix: normalize 'drug' → 'prescription' in usePGxData hook.

2. mapMetabolizerStatus only handled 4 exact strings but vault uses
   richer vocabulary ('caution', 'reference', 'intermediate-metabolizer',
   'needs_review', 'high-activity'). Most fell through to 'normal'.
   Notably CYP2C9 personal_status: caution → was 'normal', should be
   'intermediate' given *1/*2 genotype. Fix: normalize input and handle
   all known vault status values.

492 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@glebis glebis merged commit 1e674bb into main May 7, 2026
2 checks passed
@glebis glebis deleted the fix/pgx-category-and-status-mapping branch May 7, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant