/* global React, KitChrome, RX */ const { useState: phUseState } = React; const { Eyebrow: phEy } = KitChrome; // ========================================================= // Rx DETAIL — drill-in // ========================================================= function RxDetail({ rx, onClose }) { const [tab, setTab] = phUseState("Overview"); const TABS = ["Overview", "Adherence", "Refills", "Interactions", "Provenance"]; // 30-day adherence grid const days = Array.from({ length: 30 }, (_, i) => { const taken = Math.random() > 0.06; const onTime = taken && Math.random() > 0.15; return { d: i + 1, taken, onTime }; }); return (
{ e.preventDefault(); onClose(); }}>My Meds {rx.drug}
Rx
{rx.drug}
Generic for {rx.brand || "—"} · NDC 0093-1029-01 · {rx.supply} supply · {rx.refills} refills remaining
{rx.status} {rx.adherence !== null && ( = 90 ? "var(--accent-guardian)" : rx.adherence >= 80 ? "var(--accent-halo)" : "var(--accent-vital)" }}> ● {rx.adherence}% adherence (90d) )}
{TABS.map(t => ( ))}
{tab === "Overview" && (
Sig (instructions)
{rx.sig}
Take {rx.sig.includes("BID") ? "twice daily" : "once daily"} with or without food. {rx.drug.startsWith("Atorvastatin") || rx.drug.startsWith("Sertraline") ? "Best at bedtime." : "Best with breakfast."} Skip if dose missed by >6 hours and continue as scheduled.
Why you're taking it
{rx.drug.startsWith("Lisinopril") ? "Hypertension management" : rx.drug.startsWith("Hydroch") ? "Hypertension — diuretic" : rx.drug.startsWith("Atorva") ? "Hyperlipidemia (LDL ↓)" : rx.drug.startsWith("Metformin") ? "Type 2 diabetes — first line" : "Major depressive disorder — SSRI"}
Prescribed by Dr. M. Rodriguez · CH Healthcare · 2025-09-12
Why it matters · TA axis
Each on-time dose mints 0.4 HCR. Missing 3+ doses/week decays your TA score by 0.02/week.
Side effects to watch
  • Common: dizziness on standing, dry cough, mild headache
  • Call us: swelling of face/lips, persistent cough >2 weeks, K+ >5.5
  • Emergency: severe angioedema, difficulty breathing
Cost & insurance
Cash price (90d)$84.20
Cigna PPO copay$10.00
340B (you don't qualify)
Your cost$10.00 / 90d
)} {tab === "Adherence" && (
Last 30 days = 90 ? "var(--accent-guardian)" : "var(--accent-halo)", fontFamily: "var(--font-mono)", fontSize: 11 }}>● {rx.adherence}% on-time · {Math.round(((rx.adherence||90) / 100) * 30)} of 30 doses
{days.map(d => (
{d.d}
))}
On time Late (>2h) Missed
+12.4 HCR
earned this month
−0.6 HCR
forfeited (3 missed)
+0.04
TA axis lift YoY
23 days
current streak
Reminders
SMS to (•••) •••-2842Daily 7:30am · 30min before dose
Push to iPhone 15 ProDaily 7:50am · 10min before dose
Apple Watch hapticDaily 8:00am
Pillbox sensor (Hero)Confirms dose taken
)} {tab === "Refills" && (
Refill history & next due
Next refill ready
May 18, 2026
in 16 days · 3 refills remaining on this script
#FilledDays supplyPharmacyMethodCost
5 of 52026-02-1890Mail orderFree 2-day$10.00
4 of 52025-11-1990Mail orderFree 2-day$10.00
3 of 52025-08-2090Pickup · CH TallahasseeIn-store$10.00
2 of 52025-05-2190Pickup · CH TallahasseeIn-store$10.00
1 of 5 (initial)2025-02-2130Pickup · CH TallahasseeIn-store$8.50
)} {tab === "Interactions" && (
Interaction screening · against your full med list
Major
{rx.drug.split(" ")[0]} + Spironolactone
Risk of hyperkalemia. Not currently in your active meds — flagging because your mom has a history.
Moderate
{rx.drug.split(" ")[0]} + Ibuprofen (frequent OTC use)
NSAIDs may reduce antihypertensive effect. Limit to occasional dosing or switch to acetaminophen.
Moderate
{rx.drug.split(" ")[0]} + Grapefruit juice
Mild CYP3A4 inhibition. Limit to < 8 oz/day if taken with this medication.
No issue
Reviewed against 4 active meds + 2 supplements + 1 OTC
Last screened by PharmD M. Okonkwo · 2026-04-12. Re-runs automatically on every fill.
)} {tab === "Provenance" && (
Chain of custody · pharmacist verifications
{[ { t: "2025-09-12 14:08", who: "Dr. M. Rodriguez", evt: "e-Prescribed via e-prescribing network", h: "0xa8...91d", q: "✓" }, { t: "2025-09-12 14:09", who: "CH Pharmacy ingest", evt: "Received · clinical review queued", h: "0xa8...91d", q: "✓" }, { t: "2025-09-12 14:31", who: "PharmD M. Okonkwo", evt: "Verified · interaction screen passed", h: "0xa8...91d", q: "✓" }, { t: "2025-09-12 16:14", who: "PharmTech J. Liu", evt: "Counted · 2 × 45 tabs lot LIS-9281", h: "0xa8...91d", q: "✓" }, { t: "2025-09-12 16:32", who: "PharmD M. Okonkwo", evt: "Final verification · sealed", h: "0xa8...91d", q: "✓" }, { t: "2025-09-12 17:50", who: "Patient (you)", evt: "Picked up · ID verified", h: "0xa8...91d", q: "✓" }, { t: "2025-09-13 07:32", who: "Pillbox sensor", evt: "First dose confirmed · TA axis +0.4 HCR", h: "0xa8...91d", q: "✓" }, ].map((row, i) => (
{row.t}
{row.who}
{row.evt}
{row.h}
{row.q}
))}
)}
); } // ========================================================= // REFILLS VIEW — all-script refill queue // ========================================================= function RefillsView() { const [selected, setSelected] = phUseState({}); const queue = []; const total = Object.entries(selected).filter(([_, v]) => v).reduce((sum, [k]) => sum + (queue[+k]?.cost === "$10.00" ? 10 : 0), 0); const count = Object.values(selected).filter(Boolean).length; return (
Refill Queue

Three are ready.
Two need a call.

Bundle up to 5 prescriptions into one ship. Free 2-day on every order. Your pharmacist screens for interactions before anything counts down.

Ready to ship
3
no action needed
Due in 30 days
3
auto-fills enabled
Awaiting Rx from MD
1
we faxed for renewal
Expired · need new Rx
1
schedule appt to renew
All scripts

Pick what to ship together.

{queue.map((q, i) => ( ))}
MedicationReadyRefills leftMethodCostStatus
setSelected({ ...selected, [i]: e.target.checked })} />
{q.drug}
{q.ready}{q.days !== null && q.days > 0 ? ` · ${q.days}d` : ""} {q.refills} {q.method} {q.cost} {q.status === "ready" ? "● Ready" : q.status === "due" ? "● Due now" : q.status === "wait" ? "⏳ Awaiting Rx" : "✕ Expired"} {q.status === "expired" ? : q.status === "wait" ? : }
{count}
selected · ${total}.00 total
Ship to: 1842 Live Oak Ln, Tallahassee FL 32303
); } // ========================================================= // MAIL ORDER VIEW — orders & shipments // ========================================================= function MailOrderView() { const orders = []; return (
Mail Order

Free 2-day on every fill.
Cold-chain when it matters.

Insulin, biologics, and refrigerated meds ship with sealed cold-chain packaging and live temperature logging. Everything else ships in tamper-evident envelopes.

Default ship-to
Sarah J. Chen
1842 Live Oak Ln
Tallahassee, FL 32303
Active Shipments

Track every dose to the door.

{orders.map((o, i) => (
{o.id}
{o.items}
Placed {o.placed} · {o.carrier}
{o.status === "shipped" && (
Filled
Shipped
In transit
Delivered
{o.track} · ● 38°F constant · seal intact
)}
{o.eta}
{o.status === "shipped" ? "● In transit" : "● Delivered"}
))}
); } // ========================================================= // TRANSFER VIEW — bring scripts in from another pharmacy // ========================================================= function TransferView() { return (
Transfer Rx In

Tell us where your scripts
live now.

We'll pull them over within one business day. Your refill counts and adherence streaks travel with you. No paperwork, no calls.

1 · Where are they?
Recently transferred from
2 · Which scripts?
{["Lisinopril 20 mg", "Atorvastatin 40 mg", "Metformin 500 mg", "Sertraline 50 mg", "Albuterol HFA 90 mcg"].map((d, i) => ( ))}
3 · How should we ship?
Ready to transfer
Scripts4 of 5
FromCVS — 2401 N Monroe
ToCH Pharmacy · Mail
Estimated complete1 business day
We'll text you when the new pharmacy receives them, when interactions are screened, and when the first ship is on the way.
); } // ========================================================= // ADHERENCE VIEW — across-script TA axis story // ========================================================= function AdherenceView() { return (
Adherence · TA Axis

The plan keeps working only if you do.

Every prescription you fill is also a contract: take it on time, mint HCR. Skip 3+ doses in a week and the orb decays. Here's how you're doing across all scripts.

Composite adherence
89%
↑ 4 pts vs. 90 days ago
TA axis (last 90d)
+0.06
on-track for streak
HCR earned · 90d
+34.8
~$31.20 redeem value
HCR forfeited
−2.4
7 missed doses across 5 scripts
Per-script breakdown

Which scripts you're winning at.

{[ { drug: "Lisinopril 20 mg", pct: 96, mood: "great", miss: 1, streak: 23 }, { drug: "Atorvastatin 40 mg", pct: 88, mood: "ok", miss: 4, streak: 6 }, { drug: "Metformin 500 mg", pct: 72, mood: "warn", miss: 8, streak: 2 }, { drug: "Sertraline 50 mg", pct: 84, mood: "ok", miss: 5, streak: 11 }, ].map((m, i) => (
Rx
{m.drug}
{m.pct}%
{m.miss} missed (90d) {m.streak}d current streak +{(m.pct/10).toFixed(1)} HCR/30d
))}
Why you're missing doses

Patterns the pharmacist sees.

Friday & Saturday evenings
Metformin 8pm dose missed 6 of last 12 weekends. Travel? Going out? Try moving to 10am with breakfast.
After 14+ days on same dose
Atorvastatin adherence drops 9% in week 3 of every supply. Pillbox refill reminder set.
Travel weeks
Adherence drops 14% during travel. We can ship a 7-day travel kit before your next trip.
); } // Expose Object.assign(window, { RxDetail, RefillsView, MailOrderView, TransferView, AdherenceView });