project-nomad/admin
Chris 7ba5fca6ec feat(drug-reference): offline FDA drug labels, conditions, and remedies
Adds an offline medical-reference feature with three coupled layers:

- Drug Reference: full-text search over openFDA drug-label indications,
  a detail page per label, and a side-by-side single-drug comparison view.
  A two-phase background pipeline downloads the openFDA label parts to the
  storage volume (resumable) and ingests them into the search table.
- Conditions ("When to use what"): a curated spine of first-aid situations
  that maps each situation to matching OTC drugs, each linking back to its
  Drug Reference detail page.
- Curated remedies: hand-authored natural and home-remedy entries drawn from
  US-government public-domain sources (NCCIH, CDC, MedlinePlus, FDA), shown
  with their source links and the same safety disclaimers as the rest of the
  feature.

The drug-reference and conditions layers are intentionally coupled: the drug
detail page shows the situations a drug treats, and the conditions controller
reads the same drug_labels table.

Safety surfaces ship as written. The amber SafetyBanner ("informational only,
not medical advice, not an FDA endorsement, not a drug-interaction checker, in
an emergency call emergency services") renders on the condition pages and the
search page; the detail and comparison pages carry their own "not a cross-drug
interaction checker" callout; and every page carries the openFDA CC0 source
citation and no-FDA-affiliation footer.

Wiring on this branch:
- start/routes.ts: the /drug-reference and /conditions page GETs plus their
  /api/* groups.
- commands/queue/work.ts: the drug-download and drug-ingest queues, both at
  concurrency 1. The two drug queues get a per-queue stall override
  (lockDuration 1_800_000, maxStalledCount 3) because each part is one long
  stream; every other queue keeps the existing 300000 default.
- inertia/pages/home.tsx: Drug Reference and "When to use what" tiles. The
  icon and display_order are a starting point, open to change.
- types/kv_store.ts: the two drugReference.* keys the pipeline reads and writes.
- package.json: yauzl and stream-json (plus their @types), used by the ingest
  job to stream the label JSON out of the downloaded zips.

The app reads the conditions and remedy data from the compiled TS constants in
app/data/; the repo-root collections/*.json files are the browseable mirrors.
The natural-remedies standalone test reads collections/natural_remedies.json to
assert the two stay in sync, so that file is also a test fixture.

The four standalone tests pass (drug_interactions, drug_ingest_status,
conditions, natural_remedies). tsc reports no errors in the feature code.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 07:14:34 -05:00
..
app feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
bin feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
commands feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
config feat(zim): add zim uploader in content manager 2026-06-23 04:47:08 +00:00
constants feat: configurable internet test url override in new Advanced Settings page 2026-06-23 04:47:10 +00:00
database feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
docs docs(release): finalize v1.33.0 release notes [skip ci] 2026-06-23 04:49:49 +00:00
inertia feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
providers fix(kiwix): self-heal a missing or corrupt library XML on startup 2026-06-23 04:46:56 +00:00
public feat: switch all PNG images to WEBP (#575) 2026-04-03 14:26:50 -07:00
resources feat(Maps): regional map downloads via go-pmtiles extract (#780) 2026-05-20 10:16:00 -07:00
scripts feat(supply-depot): add MeshCore Web with self-signed HTTPS 2026-06-23 04:47:06 +00:00
start feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
tests feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
types feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
util feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
views feat: initial commit 2025-06-29 15:51:08 -07:00
.editorconfig feat: initial commit 2025-06-29 15:51:08 -07:00
.env.example fix(system): prevent false offline reports when Cloudflare endpoint is unreachable 2026-06-23 04:47:01 +00:00
ace.js feat: initial commit 2025-06-29 15:51:08 -07:00
adonisrc.ts feat(GPU): auto-remediate nomad_ollama passthrough loss on admin boot (#755) 2026-05-20 10:16:00 -07:00
eslint.config.js feat: openwebui+ollama and zim management 2025-07-09 09:08:21 -07:00
package-lock.json feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
package.json feat(drug-reference): offline FDA drug labels, conditions, and remedies 2026-06-23 07:14:34 -05:00
tailwind.config.ts feat: initial commit 2025-06-29 15:51:08 -07:00
tsconfig.json feat: initial commit 2025-06-29 15:51:08 -07:00
vite.config.ts fix(Maps): ensure proper parsing of hostnames (#640) 2026-04-03 14:26:50 -07:00