RxBridge - Bridging US and Canadian Drug Formularies
RxBridge is a web-based tool providing comparative drugs between two countries
RxBridge - Bridging US and Canadian Drug Formularies
Note
This tool links the US (RxNorm) and Canadian (Health Canada DPD) drug databases. When you enter a US brand name, it finds the core active ingredient and then searches both countries for all products containing that ingredient.
Example: A search for the US brand "Tylenol" identifies its ingredient as "ACETAMINOPHEN". The charts below show all US and Canadian products (brands and generics) that are also based on "ACETAMINOPHEN", along with their available strengths and formulations.
Loading data...
Introduction
Navigating the pharmaceutical landscape across borders presents significant challenges. Patients, clinicians, and travelers often struggle to determine if a medication available in the United States has an equivalent in Canada, and if so, how its branding, dosage forms, or available strengths might differ. RxBridge is a web-based tool designed to address this gap by providing an interactive, comparative visualization of drug products between the US (using the RxNorm standard) and Canada (using Health Canada’s Drug Product Database).
Core Concept: Linking via Active Ingredient
The fundamental principle behind RxBridge is that the active ingredient serves as the common link between drug products in different countries, even when brand names, formulations, or strengths vary. The tool implements a multi-step process to establish this link:
- US Brand Name Input: The user searches using a common US brand name (e.g., “Lipitor”).
- RxNorm Lookup (US): The application queries the US National Library of Medicine’s (NLM) RxNorm API to find the Concept Unique Identifier (RxCUI) associated with the input brand name.
- Ingredient Identification: Using the brand RxCUI, a subsequent RxNorm API call identifies the primary Active Ingredient RxCUI and its standardized name (e.g., RxCUI 83367, Name ATORVASTATIN).
- Cross-Database Query:
- The Ingredient RxCUI is used to query the RxNorm API again to retrieve all related US drug products (both branded SBD and generic SCD), extracting their full names for later parsing.
- The Ingredient Name (“ATORVASTATIN”) is used to query a local copy of Health Canada’s Drug Product Database (DPD) to find all Canadian drug products containing that same ingredient.
- Data Consolidation: Information from both sources is aggregated into a single JSON response, detailing US product names, Canadian product specifics (brand name, DIN, strength, form, class), and categorized lists of brand vs. generic names for each country.
Technology Stack
RxBridge employs a modern web stack:
- Backend API: A SvelteKit application utilizing
@sveltejs/adapter-auto, designed for deployment on serverless platforms like Vercel. The API logic is implemented in Node.js. - Frontend Integration: The user interface consists of Svelte components (
.sveltefiles) intended for integration into existing SvelteKit websites (potentially within MDsveX.svxcontent files). - Data Sources:
- US: Live calls to the NLM RxNorm REST API.
- Canada: Health Canada Drug Product Database (DPD) public data extracts. These text files are pre-processed and loaded into an SQLite database (
dpd.sqlite) for efficient querying by the backend API. The database is bundled with the deployed API.
- Charting Library: Chart.js is used for creating interactive donut, bar, and radar charts on the frontend. D3.js was considered but replaced due to complexity in data handling for this use case.
Data Acquisition and Processing
- Canadian Data: The publicly available DPD “all files” extracts are downloaded. Key files (
drug.txt,ingred.txt,form.txt) are parsed using Python/pandas, assigned correct headers based on official layouts, and loaded into an SQLite database. This database provides fast, indexed lookups based on ingredient names. - US Data: A robust “two-hop” query strategy is used for the RxNorm API: first identifying the ingredient from the brand name, then using the ingredient’s RxCUI to retrieve all associated products (SBD/SCD). This proved more reliable than single, complex queries. Raw US product names are returned by the API.
- Frontend Parsing & Normalization: To handle inconsistencies in RxNorm data and create readable charts, the Svelte frontend components perform crucial processing:
- Strength Parsing: US product names (e.g., “Atorvastatin 40 MG Oral Tablet”) are parsed using regular expressions to extract the strength value (e.g., “40 MG”).
- Form Parsing: After extracting the strength, the remaining part of the US product name is parsed to determine the dosage form (e.g., “Oral Tablet”).
- Strength Binning: Extracted numerical strengths are grouped into ranges (e.g., “0-100 MG”, “101-300 MG”) for the Dosage Comparison chart to prevent overly granular and unreadable axes.
- Form Normalization: Extracted form strings (both US and Canadian) are mapped to standardized categories (e.g., “TABLET (CHEWABLE)”, “ORAL TABLET” both become “Tablet”) for the Formulation Availability chart.
API Design
RxBridge exposes a single, simple REST endpoint:
- GET /api/bridge/[drugname] Where
[drugname]is the URL-encoded US brand name being searched.
The API returns a JSON object containing:
View Source Code
Click to expand interactive code modal
Frontend Visualizations
The frontend presents the API data through four distinct components:
- Brand/Generic Alternatives: Two lists displaying the top 10 distinct brand names found in the US and Canada for the active ingredient. This provides a quick glance at naming similarities or differences.
- Market Competition: Two donut charts visualizing the proportion of distinct brand name products versus distinct generic products available in each country’s market for that ingredient. This offers insight into market dynamics.
- Dosage Strength Comparison: A bar chart showing the availability of the ingredient across predefined strength bins (e.g., “101-300 MG”). Bars indicate whether any product within that strength range exists in the US or Canada.
- Formulation Availability: A radar chart mapping the availability of normalized pharmaceutical forms (Tablet, Capsule, Liquid, Injection, etc.) in both countries. This highlights differences in how the medication can be administered.
Use Cases
RxBridge serves several potential user groups:
- Patients/Travelers: Individuals traveling between the US and Canada can quickly check for equivalent brand names or available forms of their medications.
- Clinicians: Healthcare providers can use the tool to understand cross-border availability when treating patients who may travel or relocate, or when discussing alternatives.
- Pharmacists: Useful for counseling patients on medication differences between the two countries.
- Researchers/Formulary Managers: Provides a high-level comparative view of market presence for specific drug ingredients.
Conclusion
RxBridge demonstrates a practical application of integrating disparate public health datasets (RxNorm API and Health Canada DPD) via a common semantic link (the active ingredient). By leveraging SvelteKit for both the API backend and frontend component integration, and employing careful data processing on both ends, it provides a unique and valuable tool for visualizing and understanding the complex relationship between the US and Canadian drug markets. While challenges in normalizing inconsistent source data exist, the resulting visualizations offer clear, actionable insights for a variety of users.