// Rx Detail Drawer + Verification Station
const STATUS_TONE = { Paid: 'paid', Cash: 'cash', Pending: 'pending', Rejected: 'rejected' };
function AdjPanel({ rx }) {
const a = rx.adj;
const gp = a.copay + a.reimb - a.acq;
const revenue = a.copay + a.reimb;
const marginPct = revenue > 0 ? (gp / revenue) * 100 : 0;
return (
{rx.payer === 'Cash' ? 'Cash / HSA' : rx.payer}
{a.status}
Patient copay${a.copay.toFixed(2)}
Payer reimbursement${a.reimb.toFixed(2)}
Acquisition cost−${a.acq.toFixed(2)}
{gp < 0 ? '−' : ''}${Math.abs(gp).toFixed(2)}
gross profit on this fill · {marginPct.toFixed(1)}% margin
{a.status === 'Pending' ? ' (estimated)' : ''}
);
}
function ClinicalBlock({ rx, showToast }) {
const { useState } = React;
const [acked, setAcked] = useState(false);
if (rx.interaction && !acked) {
return (
⚠ {rx.interaction}
);
}
return ✓ No interactions found · Allergies checked{rx.interaction ? ' · interaction acknowledged' : ''}
;
}
function RxDrawer({ rx, onClose, nav, showToast }) {
return (
);
}
// ---- Verification Station ----------------------------------------------
function ScannedRx({ rx }) {
return (
{rx.clinic.split(',')[0]}
{rx.clinic.split(',')[1] ? rx.clinic.split(',')[1].trim() + ', WA' : 'Skagit County, WA'} · (360) 555-0188 · Fax (360) 555-0189
Patient{rx.patient}
DOB{rx.dob}
Date06/11/2026
℞
{rx.drug}
Disp: {rx.qty} · Refills: {rx.refills}
Sig: {rx.sig}
{rx.prescriber.replace('Dr. ', '').replace(', DVM', '')}
Prescriber signature
NPI 1396 558 214 · DEA BO5573821
);
}
function VerificationStation({ rx, onVerify, onClose, showToast }) {
const rows = [
['Patient', rx.patient + ' · DOB ' + rx.dob],
['Drug', rx.drug],
['Quantity', rx.qty],
['Days supply', String(rx.ds)],
['Sig', rx.sig],
['Refills', String(rx.refills)],
['Prescriber', rx.prescriber],
['Payer', rx.payer],
];
return (
Verification · Rx {rx.rx}
{rx.flag === 'compound' ? Lab : null}
{rx.flag === 'cii' ? C-II : null}
Source document vs. entered data
Entered data
{rows.map((r, i) => (
{r[0]}
{r[1]}✓
))}
DUR clear · allergies checked · {rx.flag === 'compound' ? 'lot + BUD recorded' : 'NDC scan matched'}
);
}
Object.assign(window, { RxDrawer, VerificationStation, AdjPanel });