[object Object]

← back to AbramsOS

Recall lot/date check: mark all 4 NDC recalls CLEARED (recalled lots expired before your fills); green Clear badges + plain-English assessment on Recalls + Rx tabs

a1038a61ff7512f14199039a87a9270926ec6ed4 · 2026-07-08 15:40:00 -0700 · Steve

Files touched

Diff

commit a1038a61ff7512f14199039a87a9270926ec6ed4
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed Jul 8 15:40:00 2026 -0700

    Recall lot/date check: mark all 4 NDC recalls CLEARED (recalled lots expired before your fills); green Clear badges + plain-English assessment on Recalls + Rx tabs
---
 routes/recalls.js       |  3 ++-
 views/prescriptions.ejs |  3 ++-
 views/recalls.ejs       | 18 ++++++++++++------
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/routes/recalls.js b/routes/recalls.js
index 48a7d2c..586981f 100644
--- a/routes/recalls.js
+++ b/routes/recalls.js
@@ -57,7 +57,8 @@ router.get('/recalls', async (req, res) => {
     `SELECT pf.drug_name, pf.ndc, pf.ndc_recall_number, pf.ndc_recall_class, pf.ndc_recall_reason,
             coalesce(pp.full_name,'—') AS person, count(*)::int AS fills,
             min(pf.fill_date) AS first_fill, max(pf.fill_date) AS last_fill,
-            (array_agg(pf.ndc_recall_links ORDER BY pf.fill_date DESC))[1] AS links
+            (array_agg(pf.ndc_recall_links ORDER BY pf.fill_date DESC))[1] AS links,
+            max(pf.ndc_recall_status) AS status, max(pf.ndc_recall_assessment) AS assessment
        FROM prescription_fill pf LEFT JOIN person pp ON pp.id = pf.person_id
       WHERE pf.user_id = $1 AND pf.ndc_recalled
       GROUP BY pf.drug_name, pf.ndc, pf.ndc_recall_number, pf.ndc_recall_class, pf.ndc_recall_reason, pp.full_name
diff --git a/views/prescriptions.ejs b/views/prescriptions.ejs
index d338c49..2dac895 100644
--- a/views/prescriptions.ejs
+++ b/views/prescriptions.ejs
@@ -46,7 +46,7 @@
             data-find="<%= ((f.drug_name||'')+' '+(f.doctor||'')+' '+(f.rx_number||'')).toLowerCase() %>">
           <td class="mono"><%= f.fill_date ? String(f.fill_date).slice(0,10) : '' %></td>
           <td><%= f.person_name || '' %></td>
-          <td><%= f.drug_name %><% if (f.ndc_recalled) { %> <span class="recall-flag" title="This dispensed product (NDC <%= f.ndc %>) is on an FDA recall list: <%= f.ndc_recall_class %> <%= f.ndc_recall_number %>">⚠ RECALL</span><% } %></td>
+          <td><%= f.drug_name %><% if (f.ndc_recalled) { var clr = f.ndc_recall_status==='cleared' || f.ndc_recall_status==='likely_clear'; %> <span class="recall-flag <%= clr ? 'clear' : '' %>" title="<%= f.ndc_recall_class %> <%= f.ndc_recall_number %> — <%= (f.ndc_recall_assessment||'on an FDA recall list').replace(/&/g,'&amp;').replace(/\"/g,'&quot;') %>"><%= clr ? '✓ recall (lot clear)' : '⚠ RECALL' %></span><% } %></td>
           <td class="mono"><%= f.rx_number || '' %><% if (f.refill) { %><span class="subtle"> · rf<%= f.refill %></span><% } %></td>
           <td class="num"><%= f.quantity != null ? f.quantity : '' %></td>
           <td class="num"><%= f.days_supply != null ? f.days_supply : '' %></td>
@@ -72,6 +72,7 @@
   .rx-table tbody tr:hover { background:rgba(255,255,255,.03); }
   .recall-flag { display:inline-block; margin-left:6px; padding:0 6px; border-radius:4px; font-size:10px; font-weight:700;
     background:rgba(248,113,113,.18); color:#f87171; border:1px solid rgba(248,113,113,.5); white-space:nowrap; }
+  .recall-flag.clear { background:rgba(127,208,160,.15); color:#7fd0a0; border-color:rgba(127,208,160,.45); }
 </style>
 <script>
   (function(){
diff --git a/views/recalls.ejs b/views/recalls.ejs
index 2b1cf99..f8af624 100644
--- a/views/recalls.ejs
+++ b/views/recalls.ejs
@@ -9,19 +9,25 @@
 <% if (ndcF.length) { %>
 <section class="page-head" style="margin-top:18px">
   <div>
-    <h1 style="font-size:16px">🚨 Your actual products on an FDA recall list <span class="subtle" style="font-weight:400">(NDC-matched)</span></h1>
+    <h1 style="font-size:16px">Your dispensed products vs FDA recalls <span class="subtle" style="font-weight:400">(NDC + lot/date checked)</span></h1>
     <p class="subtle" style="margin:0;color:var(--text-dim);font-size:13px">
-      The exact product/manufacturer you were dispensed (matched by <strong>NDC</strong>) appears in an FDA recall.
-      This is the actionable list — unlike the by-name section below, these are <strong>your specific products</strong>.
+      The exact product you were dispensed (matched by <strong>NDC</strong>) appears in an FDA recall — then checked against the
+      recall's <strong>lot expiration + distribution dates</strong>. <span style="color:#7fd0a0">Green = your fills predate/postdate the recalled lot (clear)</span>;
+      amber = worth confirming your lot #.
     </p>
   </div>
 </section>
 <section class="glass" style="padding:8px 6px;overflow:auto;border:1px solid rgba(248,113,113,.35)">
   <table class="mr-table">
-    <thead><tr><th>Severity</th><th>Medication</th><th>Person</th><th>NDC</th><th>Recall #</th><th class="num">Fills</th><th>Fill dates</th><th>Reason</th><th>Read about it</th></tr></thead>
+    <thead><tr><th>Your fills</th><th>Severity</th><th>Medication</th><th>Person</th><th>NDC</th><th>Recall #</th><th class="num">Fills</th><th>Fill dates</th><th>Assessment</th><th>Read about it</th></tr></thead>
     <tbody>
-      <% ndcF.forEach(function(x){ var badge = x.ndc_recall_class==='Class I' ? '#f87171' : x.ndc_recall_class==='Class II' ? '#fbbf24' : '#9aa0aa'; %>
+      <% ndcF.forEach(function(x){
+           var badge = x.ndc_recall_class==='Class I' ? '#f87171' : x.ndc_recall_class==='Class II' ? '#fbbf24' : '#9aa0aa';
+           var clear = x.status==='cleared', amber = x.status==='likely_clear';
+           var sBg = clear ? '#7fd0a0' : amber ? '#fbbf24' : '#f87171';
+           var sTxt = clear ? '✓ Clear' : amber ? '⚠ Confirm lot' : '⚠ Review'; %>
         <tr>
+          <td><span class="sev" style="background:<%= sBg %>22;color:<%= sBg %>;border:1px solid <%= sBg %>66"><%= sTxt %></span></td>
           <td><span class="sev" style="background:<%= badge %>22;color:<%= badge %>;border:1px solid <%= badge %>55"><%= x.ndc_recall_class || '—' %></span></td>
           <td><%= x.drug_name %></td>
           <td><%= x.person %></td>
@@ -29,7 +35,7 @@
           <td class="mono"><a href="https://www.accessdata.fda.gov/scripts/ires/index.cfm?Product=<%= encodeURIComponent(x.ndc_recall_number||'') %>" target="_blank" rel="noopener noreferrer"><%= x.ndc_recall_number || '' %></a></td>
           <td class="num"><%= x.fills %></td>
           <td class="mono"><%= x.first_fill ? String(x.first_fill).slice(0,10) : '' %> → <%= x.last_fill ? String(x.last_fill).slice(0,10) : '' %></td>
-          <td class="reason subtle"><%= (x.ndc_recall_reason||'').slice(0,110) %></td>
+          <td class="reason"><%= x.assessment || ((x.ndc_recall_reason||'').slice(0,110)) %></td>
           <td class="links"><% (x.links || []).forEach(function(l){ %><a href="<%= l.url %>" target="_blank" rel="noopener noreferrer"><%= l.label %></a><% }) %></td>
         </tr>
       <% }) %>

← 2caebba Recalls: add curated article/FDA links per NDC-recalled prod  ·  back to AbramsOS  ·  recall-watch.js: nightly-ready FDA recall watcher with PROGR 362c884 →