Reimagining Pharmacy Safety with Artificial Intelligence
Drug interactions remain one of the most persistent and dangerous challenges in pharmacy practice. According to the FDA, adverse drug interactions account for an estimated 125,000 deaths annually in the United States, with many more resulting in hospitalizations and diminished patient outcomes. Traditional drug interaction checking systems rely on static rule sets that struggle to keep pace with an ever-expanding pharmaceutical landscape, leaving pharmacists to bridge critical gaps through experience and manual cross-referencing.
Of Ash and Fire is currently developing RxLabelGuard, an AI-powered drug interaction detection platform that combines FDA drug databases with large language model analysis to deliver real-time, context-aware safety alerts to pharmacists and pharmacy technicians. The platform is designed to scan prescription labels, verify dosage accuracy, and detect potential multi-drug interactions that legacy systems routinely miss.
The Problem: Outdated Interaction Checking in a Complex Landscape
Modern pharmacy practice presents a challenging reality. The average American over 65 takes four or more prescription medications simultaneously, and the combinatorial complexity of potential interactions grows exponentially with each additional drug. Existing pharmacy software systems typically check interactions against curated databases of known drug pairs, but they fall short in several critical areas:
- Limited multi-drug analysis: Most systems check interactions between two drugs at a time, missing complex three-way or four-way interaction patterns that emerge in polypharmacy scenarios.
- Static knowledge bases: Traditional databases require manual curation and may lag months or even years behind emerging research on newly identified interactions.
- Label verification gaps: Prescription label errors, including incorrect dosages, wrong drug names, and missing contraindication warnings, are a leading cause of medication errors but are rarely caught by automated systems.
- Alert fatigue: Pharmacists are overwhelmed by low-priority, non-specific alerts, which causes them to dismiss warnings indiscriminately, including clinically significant ones.
RxLabelGuard is being built to address each of these shortcomings through an architecture that pairs structured FDA data with the reasoning capabilities of a large language model.
The Technical Architecture
Application Framework: Next.js 15 on AWS Amplify Gen 2
The platform is built on Next.js 15 with server-side rendering and deployed through AWS Amplify Gen 2. This combination was chosen for several healthcare-specific reasons. Next.js provides server components that keep sensitive processing logic off the client, which is essential when handling anything adjacent to protected health information. Amplify Gen 2 offers a code-first infrastructure definition that produces reproducible, auditable deployments, a requirement for healthcare environments where infrastructure changes must be traceable.
The mobile-responsive design is a deliberate choice. Pharmacists and technicians need to access RxLabelGuard at the pharmacy counter, often on tablets or smaller screens positioned alongside dispensing equipment. The interface prioritizes rapid label scanning and clear, actionable alert presentation over complex navigation.
Data Layer: AWS AppSync and DynamoDB
The data layer uses AWS AppSync with a GraphQL API backed by Amazon DynamoDB. GraphQL was selected over REST for this project because the platform's query patterns vary significantly by use case. A pharmacist checking a single prescription needs different data shapes than a pharmacy manager reviewing interaction trends across thousands of prescriptions. GraphQL's flexible query structure avoids the over-fetching and under-fetching problems that would require multiple REST endpoints to solve.
DynamoDB provides the low-latency, high-throughput data access that a real-time safety system demands. Drug interaction checks must return results in under two seconds to avoid disrupting pharmacy workflow. DynamoDB's single-digit-millisecond response times, combined with its ability to scale automatically during peak dispensing hours, make it well-suited for this workload.
AI Engine: AWS Bedrock with Claude
The core intelligence layer integrates AWS Bedrock with Anthropic's Claude model to perform contextual drug interaction analysis. This is not a simple lookup system. The AI engine performs several distinct functions:
- Prescription label parsing: Scanned or uploaded label images are processed through optical character recognition and then passed to Claude for structured data extraction. The model identifies the drug name, dosage, frequency, route of administration, and prescriber information, normalizing variations in label formatting across different pharmacy systems.
- Multi-drug interaction reasoning: When a pharmacist submits a patient's medication list, Claude analyzes the full combination against FDA interaction data, published pharmacological research, and known metabolic pathway conflicts. Unlike pairwise lookup systems, the model can reason about emergent risks when three or more drugs interact through shared enzymatic pathways, particularly CYP450 interactions that account for a significant portion of clinically dangerous drug combinations.
- Dosage verification: The model cross-references prescribed dosages against FDA-approved ranges, adjusting for factors like the patient's age category and the specific indication when that information is available. Dosages that fall outside expected ranges trigger targeted alerts with specific reasoning, not generic warnings.
- Contextual alert generation: Rather than producing binary "interaction detected" alerts, Claude generates structured, human-readable explanations that include the severity level, the pharmacological mechanism behind the interaction, recommended alternatives when applicable, and citations to relevant FDA safety communications.
FDA Data Integration: The openFDA API
RxLabelGuard draws its foundational drug data from the openFDA API, the FDA's public access point for drug labeling, adverse event reports, and recall information. The platform ingests and indexes data from several openFDA endpoints:
- Drug labeling data: Full prescribing information including contraindications, warnings, and known interaction profiles for FDA-approved medications.
- Adverse event reports (FAERS): Post-market surveillance data that captures real-world interaction reports submitted by healthcare providers and patients.
- Drug recall enforcement data: Active recalls and safety communications that may affect dispensed medications.
This FDA data is synchronized on a regular schedule and stored in DynamoDB for fast retrieval. When a pharmacist initiates an interaction check, the system first retrieves the relevant FDA data for each medication, then passes that structured information along with the medication list to Claude for analysis. This approach ensures that the AI's reasoning is grounded in authoritative regulatory data rather than relying solely on the model's training knowledge.
Authentication and Access Control
User management is handled through AWS Amplify Auth, powered by Amazon Cognito. The authentication system supports role-based access control with distinct permission levels for pharmacists, pharmacy technicians, and pharmacy managers. Multi-factor authentication is enforced for all accounts, and session management follows healthcare security best practices with automatic timeout and re-authentication requirements.
Healthcare Compliance and Data Privacy
Building software that operates in the pharmacy environment demands rigorous attention to patient data privacy. RxLabelGuard's architecture implements a PHI scrubbing pipeline that is central to its design, not an afterthought.
PHI Scrubbing Before AI Processing
All patient-identifiable information is stripped from data before it reaches the AI processing layer. When a prescription label is scanned, the system extracts only the pharmacologically relevant information: drug name, dosage, frequency, and route. Patient names, dates of birth, addresses, and prescription numbers are identified and removed at the application layer before any data is sent to AWS Bedrock for analysis. This means the AI model never sees, processes, or stores protected health information.
This architecture provides a critical compliance advantage. Because the AI layer operates exclusively on de-identified pharmaceutical data, it falls outside the scope of many PHI-related regulatory requirements. The system can leverage the full power of large language model analysis without creating the data governance complexity that arises when AI models process identifiable patient records.
Infrastructure-Level Safeguards
Beyond PHI scrubbing, the platform leverages AWS's healthcare-eligible infrastructure. All data at rest is encrypted using AWS Key Management Service, and all data in transit is encrypted via TLS 1.2 or higher. DynamoDB tables that store any pharmacy-level data use server-side encryption with customer-managed keys, providing full audit trail capability for key access. CloudTrail logging captures all API activity for compliance auditing.
For organizations pursuing formal compliance certification, the platform's infrastructure runs entirely within AWS services that are covered under AWS's BAA (Business Associate Agreement), a prerequisite for HIPAA-regulated workloads.
Target Users and Use Cases
Community and Retail Pharmacists
The primary users are pharmacists working at the dispensing counter who need rapid, reliable interaction checks as part of their verification workflow. RxLabelGuard is designed to integrate into existing dispensing processes, providing a secondary verification layer that catches interactions the primary pharmacy management system may miss. The platform's label scanning capability allows pharmacists to verify that the physical label matches the digital prescription record, catching transcription and printing errors before medication reaches the patient.
Pharmacy Technicians
Technicians who handle initial prescription processing can use RxLabelGuard to flag potential issues before they reach the pharmacist for final verification. The system's role-based interface presents technician-appropriate information, escalating complex interaction alerts to the supervising pharmacist automatically.
Healthcare Systems and Hospital Pharmacies
For larger healthcare organizations, RxLabelGuard provides a centralized interaction detection layer that can operate across multiple pharmacy locations. The platform's analytics capabilities, currently in development, will enable pharmacy managers to identify interaction patterns, track alert outcomes, and generate compliance reports across their organization.
Why These Technology Choices Matter
Every technology decision in RxLabelGuard was made with the healthcare context in mind:
- AWS Bedrock over self-hosted models: Bedrock provides managed access to Claude without requiring the team to operate GPU infrastructure. More importantly, Bedrock's data processing agreements and SOC 2 compliance simplify the regulatory conversation for healthcare organizations evaluating the platform.
- DynamoDB over relational databases: Drug interaction data is inherently hierarchical and varies significantly across medications. DynamoDB's flexible schema accommodates this variation without the migration overhead that a relational database would impose each time the FDA updates its data structures.
- GraphQL over REST: The diverse query patterns across pharmacist verification, technician processing, and manager reporting would require a large REST API surface. GraphQL consolidates these into a single, flexible endpoint while providing built-in query validation and documentation.
- Server-side rendering over client-side: Keeping interaction logic on the server reduces the attack surface of the client application and ensures that sensitive drug analysis data is not cached in browser storage on shared pharmacy workstations.
Current Development Status
RxLabelGuard is currently in active development. The core AI interaction detection engine, FDA data pipeline, and prescription label scanning functionality are being built and tested against real-world pharmaceutical scenarios. The platform is being developed with input from practicing pharmacists to ensure that the alert system, user interface, and workflow integration meet the practical demands of pharmacy practice.
The development roadmap includes integration with common pharmacy management systems, expanded analytics and reporting capabilities, and a mobile application optimized for tablet use at the pharmacy counter.
Building Healthcare Software That Protects Patients
RxLabelGuard represents our commitment to building healthcare software that delivers measurable safety improvements. By combining authoritative FDA data with the reasoning capabilities of large language models, we are building a platform that helps pharmacists do what they do best: protect patients from preventable medication errors.
Whether you are building a medical mobile application, a clinical decision support tool, or a pharmacy safety system, Of Ash and Fire brings deep healthcare domain expertise and modern cloud architecture to every project.
Interested in discussing a healthcare software project? We would welcome the opportunity to learn about your challenges and explore how AI-powered solutions can improve patient safety outcomes at your organization.
Contact our team to start the conversation.