Medical affairs and safety teams rely on one-off spreadsheets to compare clinical trial outcomes against real-world patient experience. There is no repeatable, auditable signal pipeline for tracking how patients actually perceive a drug versus what trials promised.
Tenant-aware drug tracking with role-based access. Asynchronous ingestion and analysis jobs with progress polling. Gap breakdown across 7 dimensions: efficacy, safety, tolerability, convenience, quality of life, adherence, and trust. Per-drug trend views over configurable windows. Structured source metrics embedded in final report payloads for full traceability.
Microservice architecture: Next.js 14 frontend (BFF routes, SWR polling, Recharts) -> FastAPI primary API (auth, drug lifecycle, analysis endpoints) -> Celery workers (ingestion + analysis orchestration) -> NLP FastAPI microservice (sentiment + gap pipeline) -> PostgreSQL (SQLAlchemy + Alembic migrations) + Redis (broker/result backend) + Flower (task monitoring UI).
Parallel async ingestion from OpenFDA (paginated adverse-event pulls), ClinicalTrials.gov (paginated studies with token cycle guard), and Reddit (OAuth path with automatic public JSON fallback). All source outcomes persisted in report payload under source_metrics.
VADER lexical sentiment with custom lexicon, RoBERTa transformer classifier (cardiffnlp/twitter-roberta-base-sentiment-latest), SentenceTransformer embeddings (all-MiniLM-L6-v2) for clustering, and composite gap scoring across 7 clinical dimensions.
Celery chord pattern: parallel ingestion subtasks (OpenFDA + Reddit + ClinicalTrials) followed by gap analysis callback. Frontend polls job status endpoint until SUCCESS, then renders full report.
Organization-scoped data isolation. Four roles: OWNER, ADMIN, ANALYST, VIEWER. JWT token flow with refresh token rotation. Machine auth via hashed API keys.
Structured breakdown across efficacy, safety, tolerability, convenience, quality of life, adherence, and trust. Each dimension scored and compared against clinical trial benchmarks.
Time-series trend points per drug over configurable windows. Cross-drug metric comparison. Structured source_metrics in every report payload for full auditability.