RxInteract

Introduction

Across many PWA projects that I have worked on (such as RxLookup, RxAlbum, RxPed, and RxQuote), I began to recognise an unsettling pattern.

  • While modern AI-assisted vibe coding allows you to set up the app architecture within a few days, the hardest part remains the source data that acts as the foundation and soul of the app.

Even the thought of building a drug interaction database from scratch and trying to make it comprehensive felt overwhelming.

  • Gathering and verifying thousands of individual interaction pairs would take immense effort, and in the end, it would still be nowhere near complete.

Because of this, while vibe coding RxInteract, our initial plan was to outsource publicly available reference data, and one potential candidate was DDInter.

  • However, the downloadable data only provided interaction severity scores - it lacked clinical details, underlying mechanisms, and actionable management steps.
  • Knowing a severity number without knowing what to do with the patient is not very helpful at the bedside.
  • This prompted us to step back and rethink our database design.



Clinical Philosophy

Overall, the app database was never meant to be comprehensive, but practical.

Being part of a medication safety team, I have seen that listing every minor or theoretical interaction might look good on paper, but it is not necessarily meaningful in real life.

  • Far from creating a manageable action plan, clinicians often encounter alert fatigue, and end up skipping or dismissing the interaction flags altogether.

Hence, we focused on building a foundational database centered around practical clinical management, segregated into three straightforward tiers where every alert has a clear purpose:

  • Major: Severe risk, typically contraindicated or to be avoided.
  • Moderate: Clinically significant, requiring an affirmative change (such as a dosage adjustment, timing separation, or choosing an alternative).
  • Minor: Mild effect, requiring routine clinical observation or lab monitoring.

Beyond simple drug pairs, a crucial problem to address in daily practice is polypharmacy and duplicate prescribing.

  • For example, a junior doctor might start felodipine for a patient's elevated blood pressure while inadvertently continuing the patient's existing amlodipine tablet.
  • We also often see conflicting prescriptions where two different doctors prescribe two different statins to the same patient for their cholesterol.
  • This type of intra-class therapeutic duplication needed to be caught automatically.

Similarly, many significant drug interactions happen across entire pharmacological classes rather than just isolated drug pairs - such as the risk of acute kidney injury when combining an ACE inhibitor, an NSAID, and a diuretic (the "triple whammy").

  • Our database pipeline needed to handle these interactions across entire classes automatically, rather than forcing us to manually type out dozens of repetitive pair combinations.



Engineering for Speed and Privacy

To make the tool genuinely usable on busy ward rounds, it had to be lightning fast and work completely offline without hospital Wi-Fi.

Checking a patient on 8 medications means checking 28 separate drug pairs at the same time.

  • Doing this with plain text JSON files in the browser would quickly become sluggish and heavy.
  • Instead, we compiled our database into WebAssembly SQLite (sql.js) and used alphabetical pair keys (e.g. aspirin|warfarin).
  • Whether you enter Aspirin + Warfarin or Warfarin + Aspirin, the app instantly matches the pair in a single database lookup within milliseconds.

To keep download sizes tiny for mobile devices, the SQLite database is compressed using gzip into a small file.

  • When you open the app, the browser uses its native DecompressionStream to unpack it directly into memory.
  • Best of all, because the entire database runs right inside the browser, no patient data is ever sent to any server.



Summary

To be honest, knowing the massive effort required to build a drug interaction tool made me hesitate to even make it available.

  • Still, I plan to start small and focus on the most common drug interactions I encounter in my daily practice.

Nonetheless, I figured that while massive reference databases like Lexicomp and Medscape focus on listing all potential interactions, there is still a genuine need for an integrated tool designed from the ground up to automate point-of-care screening.

  • Each alert in RxInteract is designed so that it requires an actual clinical action.
  • These are not just "nice-to-have" theoretical warnings, but clinically significant interactions that truly matter to patient care.
  • In essence, this curated database is tailor-made for pharmacy transcribing systems and clinical workflows where flagging only the interactions that actually matter is paramount.

Comments