← back to AbramsOS
Recalls: add curated article/FDA links per NDC-recalled product (Read-about-it column)
2caebba7f83aa5630921f494a03b09dd4e7daf1c · 2026-07-08 15:35:54 -0700 · Steve
Files touched
M routes/recalls.jsM views/recalls.ejs
Diff
commit 2caebba7f83aa5630921f494a03b09dd4e7daf1c
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Jul 8 15:35:54 2026 -0700
Recalls: add curated article/FDA links per NDC-recalled product (Read-about-it column)
---
routes/recalls.js | 3 ++-
views/recalls.ejs | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/routes/recalls.js b/routes/recalls.js
index d805b3f..48a7d2c 100644
--- a/routes/recalls.js
+++ b/routes/recalls.js
@@ -56,7 +56,8 @@ router.get('/recalls', async (req, res) => {
const ndcFlags = (await db.query(
`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
+ 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
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/recalls.ejs b/views/recalls.ejs
index cb92ba8..2b1cf99 100644
--- a/views/recalls.ejs
+++ b/views/recalls.ejs
@@ -18,7 +18,7 @@
</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></tr></thead>
+ <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>
<tbody>
<% ndcF.forEach(function(x){ var badge = x.ndc_recall_class==='Class I' ? '#f87171' : x.ndc_recall_class==='Class II' ? '#fbbf24' : '#9aa0aa'; %>
<tr>
@@ -30,6 +30,7 @@
<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="links"><% (x.links || []).forEach(function(l){ %><a href="<%= l.url %>" target="_blank" rel="noopener noreferrer"><%= l.label %></a><% }) %></td>
</tr>
<% }) %>
</tbody>
@@ -75,6 +76,8 @@
.mr-table td.mono{font-variant-numeric:tabular-nums;white-space:nowrap}
.mr-table td.reason{max-width:340px}
.sev{display:inline-block;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap}
+ .mr-table td.links{max-width:220px}
+ .mr-table td.links a{display:block;font-size:11.5px;color:var(--accent,#7dd3fc);white-space:normal;margin:1px 0}
</style>
<% } %>
← b02722e NDC-precise FDA recall match: flag fills whose actual dispen
·
back to AbramsOS
·
Recall lot/date check: mark all 4 NDC recalls CLEARED (recal a1038a6 →