Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion data/medication-interaction-index.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -702,6 +702,7 @@
"clozapine",
"codeine",
"diazepam",
"dosulepin",
"doxepin",
"fentanyl",
"flupentixol-decanoate",
Expand DownExpand Up@@ -776,6 +777,7 @@
"chlorpromazine",
"clomipramine",
"clozapine",
"dosulepin",
"doxepin",
"flupentixol-decanoate",
"haloperidol-decanoate",
Expand DownExpand Up@@ -872,6 +874,7 @@
"clozapine",
"codeine",
"diazepam",
"dosulepin",
"doxepin",
"fentanyl",
"flupentixol-decanoate",
Expand DownExpand Up@@ -1252,6 +1255,7 @@
"citalopram",
"clomipramine",
"desvenlafaxine",
"dosulepin",
"doxepin",
"duloxetine",
"escitalopram",
Expand DownExpand Up@@ -2669,6 +2673,7 @@
"counterparties": [
"amitriptyline",
"clomipramine",
"dosulepin",
"doxepin",
"imipramine",
"nortriptyline",
Expand DownExpand Up@@ -3610,6 +3615,7 @@
"clozapine",
"codeine",
"diazepam",
"dosulepin",
"doxepin",
"fentanyl",
"flupentixol-decanoate",
Expand DownExpand Up@@ -3717,6 +3723,7 @@
"clozapine",
"codeine",
"diazepam",
"dosulepin",
"doxepin",
"fentanyl",
"flupentixol-decanoate",
Expand DownExpand Up@@ -3927,6 +3934,7 @@
"clozapine",
"cyclizine",
"diphenhydramine",
"dosulepin",
"doxepin",
"fexofenadine",
"flupentixol-decanoate",
Expand DownExpand Up@@ -5781,6 +5789,7 @@
"chlorpromazine",
"clomipramine",
"clozapine",
"dosulepin",
"doxepin",
"flupentixol-decanoate",
"haloperidol-decanoate",
Expand DownExpand Up@@ -6753,6 +6762,7 @@
"atomoxetine",
"clomipramine",
"desvenlafaxine",
"dosulepin",
"doxepin",
"duloxetine",
"imipramine",
Expand DownExpand Up@@ -6817,6 +6827,7 @@
"chlorpromazine",
"clomipramine",
"clozapine",
"dosulepin",
"doxepin",
"flupentixol-decanoate",
"haloperidol-decanoate",
Expand DownExpand Up@@ -6865,6 +6876,7 @@
"clozapine",
"cyclizine",
"diphenhydramine",
"dosulepin",
"doxepin",
"fexofenadine",
"hyoscine-butylbromide",
Expand DownExpand Up@@ -6934,6 +6946,7 @@
"chlorpromazine",
"clomipramine",
"clozapine",
"dosulepin",
"doxepin",
"flupentixol-decanoate",
"haloperidol-decanoate",
Expand DownExpand Up@@ -7269,7 +7282,15 @@
"rowKey": "Pharmacokinetic",
"rowIndex": 2,
"severity": "high",
"counterparties": ["clomipramine", "doxepin", "fluoxetine", "imipramine", "nortriptyline", "paroxetine"],
"counterparties": [
"clomipramine",
"dosulepin",
"doxepin",
"fluoxetine",
"imipramine",
"nortriptyline",
"paroxetine"
],
"termIds": ["cyp-inhibitors", "tcas"],
"resolved": false,
"note": "HIGH — **CYP2D6** inhibitors (Fluoxetine, Paroxetine) spike TCA blood levels into the toxic range."
Expand DownExpand Up@@ -7490,6 +7511,7 @@
"amitriptyline",
"clomipramine",
"codeine",
"dosulepin",
"doxepin",
"imipramine",
"metoprolol",
Expand DownExpand Up@@ -7687,6 +7709,7 @@
"amitriptyline",
"citalopram",
"clomipramine",
"dosulepin",
"doxepin",
"escitalopram",
"fluoxetine",
Expand DownExpand Up@@ -8480,6 +8503,7 @@
"amitriptyline",
"benzatropine",
"clomipramine",
"dosulepin",
"doxepin",
"hyoscine-butylbromide",
"hyoscine-hydrobromide",
Expand DownExpand Up@@ -8611,6 +8635,7 @@
"amitriptyline",
"citalopram",
"clomipramine",
"dosulepin",
"doxepin",
"escitalopram",
"fluoxetine",
Expand DownExpand Up@@ -8786,6 +8811,7 @@
"clozapine",
"cyclizine",
"diphenhydramine",
"dosulepin",
"doxepin",
"fexofenadine",
"flupentixol-decanoate",
Expand DownExpand Up@@ -8938,6 +8964,7 @@
"clomipramine",
"clonazepam",
"diazepam",
"dosulepin",
"doxepin",
"imipramine",
"lorazepam",
Expand DownExpand Up@@ -9018,6 +9045,7 @@
"clozapine",
"cyclizine",
"diphenhydramine",
"dosulepin",
"doxepin",
"fexofenadine",
"flupentixol-decanoate",
Expand DownExpand Up@@ -9122,6 +9150,7 @@
"chlorpromazine",
"clomipramine",
"clozapine",
"dosulepin",
"doxepin",
"flupentixol-decanoate",
"haloperidol-decanoate",
Expand Down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
| 2026-08-17 | PR (branch claude/p1-318-lexicon-slug-and-guards, #318 follow-up) | 478f06b52f672fa2a01b0f5c54a5f8c5df67c656 | src/lib/medication-interaction-lexicon.ts (tcas slug), scripts/build-medication-lexicon-report.ts (missedClassMembers), tests/medication-interaction-lexicon-coverage.test.ts, regenerated data/medication-interaction-index.json + docs/medication-interaction-lexicon-review.md, docs/medication-lexicon-review-worklist.md, one #318 inbox request (db498cc1). clinicalRisk true. Sign-off block untouched. | Authored handoff, owner-approved scope (dead slug + guard blind spots only; no mapping needing a clinical answer was changed). DEAD SLUG: tcas selected 'dothiepin' where the catalogue keys the drug 'dosulepin' (same drug, current INN), so it matched zero records and Dosulepin - own record flags Toxicity in OD FATAL - fired none of the term's 20 CRITICAL/HIGH rows. Treated as restoring evident intent, not a new clinical determination: the author wrote dothiepin and the catalogue already filed it subclass TCA. Measured after regenerating the index: 22 rows now name dosulepin as counterparty, 20 CRITICAL/HIGH, up from 0; aggregate resolution unchanged (523/362/161/423) because those rows already resolved via other TCAs. Durable guard: coverage test now fails on any selector slug or denySlug resolving to no record - the pre-existing test only required a TERM to resolve to some drug, so tcas stayed green on five of six slugs. GUARD BLIND SPOTS: missedClassMembers skipped sub-4-char stems, so the check could not fire for tcas or arbs (ppis rescued by its long surface), and it never read tag. The sheet's printed 'checks ran clean' line was false for two terms. Floor now 3 and haystack includes tag; the sheet now raises the Celecoxib/Parecoxib gap itself (2 flagged, up from 1). First attempt was wrong and mutation testing caught it: whole-token matching for short acronyms did no protective work (the leading word boundary already blocks arb-in-Carbapenem) and would have missed a subclass spelled TCAs - kept as a prefix match, pinned by a pluralised-subclass test. STILL OPEN: sign-off block untouched, sheet still UNREVIEWED, and five clinical questions unanswered (coxibs, Moclobemide which the sheet structurally cannot surface because its tag is also RIMA, Loperamide, single-drug acei/arbs, antiplatelets in anticoagulants). Noted for a separate row: the lexicon source alone classifies clinicalRisk FALSE and only the generated index makes such a PR clinical-risk. | verify:pr-local 18 checks completed, failed: (none) - includes lint, typecheck, full unit suite, build, check:medication-interactions, check:medication-lexicon-report. Focused tests/medication-interaction-lexicon-coverage.test.ts 33 passed (was 30). check:production-readiness run for the clinical-risk scope: 2 PASS, 5 WARN, 2 FAIL, both FAILs the documented offline provider gap (absent NEXT_PUBLIC_SUPABASE_URL/SUPABASE_SERVICE_ROLE_KEY/OPENAI_API_KEY), not regressions from this diff. Mutation-verified four ways: slug revert fails 2 tests; restoring the <4 stem floor fails 2; dropping tag fails 1; anchoring the stem tail fails 1. verify:ui NOT run and NOT runnable here - Playwright chromium-1194 vs pinned 1234 (#255/#312) fails closed; no browser coverage claimed, none needed for this scope. |
4 changes: 2 additions & 2 deletions docs/medication-interaction-lexicon-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,7 +30,7 @@ CRITICAL or HIGH. Start at the top — the table is sorted by severe usage.
| `opioids` | opioids, opioid, opioid analgesia, opiates, full agonists | 36 | 35 | **14** — Buprenorphine (SL/depot), Buprenorphine + naloxone, Buprenorphine patch, Codeine, Fentanyl, Hydromorphone (IR/IV), Loperamide, Methadone, Morphine (IR/IV), Morphine SR / MR, Oxycodone IR, Oxycodone SR / MR, Tapentadol SR, Tramadol IR |
| `benzodiazepines` | benzodiazepines, benzodiazepine, benzos, benzo | 32 | 32 | **8** — Alprazolam, Clonazepam, Diazepam, Lorazepam, Midazolam, Nitrazepam, Oxazepam, Temazepam |
| `beta-blockers` | beta-blockers, beta blockers, beta-blocker, beta blocker, non-selective beta-blockers | 23 | 22 | **7** — Atenolol, Bisoprolol, Carvedilol, Labetalol, Metoprolol, Propranolol, Sotalol |
| `tcas` | tcas, tca, tricyclics, tricyclic antidepressants, anticholinergic tcas | 22 | 20 | **5** — Amitriptyline, Clomipramine, Doxepin, Imipramine, Nortriptyline |
| `tcas` | tcas, tca, tricyclics, tricyclic antidepressants, anticholinergic tcas | 22 | 20 | **6** — Amitriptyline, Clomipramine, Dosulepin, Doxepin, Imipramine, Nortriptyline |
| `acei` | acei, aceis, ace inhibitors, ace inhibitor | 20 | 20 | **1** — Perindopril |
| `ssris` | ssris, ssri | 21 | 19 | **6** — Citalopram, Escitalopram, Fluoxetine, Fluvoxamine, Paroxetine, Sertraline |
| `maois` | maois, maoi, monoamine oxidase inhibitors | 19 | 17 | **2** — Phenelzine, Tranylcypromine |
Expand DownExpand Up@@ -123,12 +123,12 @@ interaction row or making an existing row machine-resolvable, with clinical revi

## Flagged for a closer look

- `nsaids` does **not** cover Celecoxib (COX-2 Inhibitor), Parecoxib (COX-2 Inhibitor (Injectable)), whose own catalogue class names the term. A drug left out of a class is a missed alert, not a false one.
- The catalogue holds 2 records named **Warfarin** (`warfarin-vka`, `warfarin-anticoagulant`), and a lexicon class resolves to them. They carry **different** interaction rows (`warfarin-vka`: 3, `warfarin-anticoagulant`: 3; only 0 in common), so which record the clinician opens changes which warnings they see. Reconcile them in the catalogue.

Checks that ran and found nothing:

- **Accidental substring matches** — no class token matches a subclass only as a fragment of a longer word. (This is the check that caught `ARB` inside _Carbapenem_.)
- **Missed class members** — no catalogue drug whose own class or subclass names a term's phrase was left out of that term. Where a class resolves to a single drug, that is the catalogue holding one such drug, not a narrow selector.

## Sign-off

Expand Down
Loading
Loading