๐ PDF Generation
Server-side PDF rendering for SOAP notes, progress reports, superbills, claims, intake forms, and patient-facing documents.
๐ Use Cases
- SOAP notes โ finalized clinical notes exported as PDFs filed to the patient chart and the Drive module.
- Progress reports โ auto-aggregated session data + graphs + mastery trends (used for ABA authorization renewals).
- Superbills โ patient-side billing summary for self-pay or out-of-network reimbursement.
- Intake packets โ multi-form bundles delivered to new patients via the Patient Portal.
- Receipts / invoices โ Stripe-payment confirmations.
- Recall letters โ bulk-send via Mail.

๐๏ธ Architecture
- Server-rendered via headless Chromium (per-call worker; no shared state).
- Templates live as React components โ same design system as the rest of the app, rendered to PDF via Puppeteer.
- Optional digital signature via the e-Signature module (BoldSign integration) for docs that need execution.
- PDF bytes uploaded to Supabase Storage with the same RLS scoping as other Drive files.

POST /api/v1/pdf { template, payload, sign?: bool } โ returns signed download URL
GET /api/v1/pdf/:id Read PDF metadata + signed URLโ๏ธ HIPAA + Audit
- PDFs scoped to workspace + (optional) patient โ same RLS as Drive.
- Generation logged in audit chain.
- Download links are short-TTL (5 minutes) signed URLs.