// Screen: Patient Profile (reached only from patient-name links)
function PatientProfile({ patientId, nav }) {
const p = PATIENTS[patientId] || PATIENTS.petersen;
const medChip = (status) => {
if (status === 'due') return Due now;
if (status === 'expired') return Expired — renewal sent;
return Active;
};
return (
{/* Identity */}
{p.name}
{p.dob}
{p.phone}
Prefers {p.store}
{p.vet ? Veterinary · Chuckanut Valley Vet : null}
{p.sync ? Med sync · anchor {p.syncDate} : null}
{p.ar > 0
? A/R balance ${p.ar.toFixed(2)}
: A/R $0.00}
{p.allergies.length > 0 ? (
Allergies:
{p.allergies.join(' · ')}
) : null}
{/* Active meds */}
| Medication | Sig | Refills | Last filled | Next due | Status |
{p.meds.map((m, i) => (
| {m.drug} |
{m.sig} |
{m.refills} |
{m.last} |
{m.due} |
{medChip(m.status)} |
))}
{/* Recent fills */}
| Date | Fill | Store | Copay | Status |
{p.fills.map((f, i) => (
| {f[0]} |
{f[1]} |
{f[2]} |
{f[3]} |
{f[4]} |
))}
{/* Notes */}
{p.notes.map((n, i) => (
{n.date} · {n.by}
{n.text}
))}
);
}
Object.assign(window, { PatientProfile });