cs.HCAug 27, 2026

An Offline Smartphone Check for Drug Interactions and Past Reactions in Handwritten Prescriptions: A Technical Feasibility Study in Rural Bangladeshi Outpatient Care

Authors: Shahir Abdullah

Organizations: Department of Computer Science and Engineering, United International University, Dhaka, Bangladesh

Abstract

Rural Bangladeshi outpatient clinics keep no patient records, prescriptions are handwritten, and physicians have under a minute per patient, so they easily miss a known adverse drug reaction (ADR) or drug-drug interaction (DDI). We built and evaluated an offline Android application that photographs a handwritten prescription, detects and reads each medicine line, resolves brand names to active ingredients, and retrieves, but never predicts, documented interactions and the patient's recorded reactions. This quantitative technical-feasibility study, with qualitative error analysis, involved no patients or clinicians. Reference data combine two Bangladeshi drug registries (27,880 brands) with 190,421 DDI pairs. A YOLOv8n line detector reached [email protected] = 0.687 on held-out prescriptions but recalled only 60.6% of lines at the deployed cutoff. On-device ML Kit read 11.8% of 780 benchmark handwritten words exactly. We trained a CRNN-CTC reader on public handwriting data, decoded it against the brand lexicon, and fine-tuned it on 660 author-labelled prescription crops. On benchmark words, the reader accepted the correct ingredient for 41.5% and a wrong one for 4.2%, versus 21.0% and 5.3% for ML Kit at its preset cutoff (McNemar p<10^-20). On scorable lines from held-out real prescriptions, the reader accepted the correct ingredient for 36.0% [26.8, 46.3] and a wrong one for 2.2% [0.6, 7.8]. In 62 simulated runs on a mid-range phone, median time per patient was 26-31 s and 59 of 62 runs finished within 60 s, but 62% of medicine lines still needed a manual check. A cross-visit medication history added after the evaluation passed seven automated tests and one two-visit functional test but was not evaluated. The pipeline is feasible within the clinic workflow; reading handwriting, not retrieval, is the bottleneck. Nothing here demonstrates a clinical benefit.

Figures & tables

Explore similar work

Feb 17, 2026

Exploring Drug Safety Through Knowledge Graphs: Protein Kinase Inhibitors as a Case Study

Adverse Drug Reactions (ADRs) are a leading cause of morbidity and mortality. Existing prediction methods rely mainly on chemical similarity, machine learning on structured databases, or isolated target profiles, but often fail to integrate heterogeneous, partly unstructured evidence effectively. We present a knowledge graph-based framework that unifies diverse sources, drug-target data (ChEMBL), clinical trial literature (PubMed), trial metadata (ClinicalTrials.gov), and post-marketing safety reports (FAERS) into a single evidence-weighted bipartite network of drugs and medical conditions. Applied to 400 protein kinase inhibitors, the resulting network enables contextual comparison of efficacy (HR, PFS, OS), phenotypic and target similarity, and ADR prediction via target-to-adverse-event correlations. A non-small cell lung cancer case study correctly highlights established and candidate drugs, target communities (ERbB, ALK, VEGF), and tolerability differences. Designed as an orthogonal, extensible analysis and search tool rather than a replacement for current models, the framework excels at revealing complex patterns, supporting hypothesis generation, and enhancing pharmacovigilance. Code and data are publicly available at https://github.com/davidjackson99/PKI_KG.
May 27, 2026

SafeRx-Agent: A Knowledge-Grounded Multi-Agent Framework for Safe and Explainable Medication Recommendation

Medication recommendation predicts medications for patient visits, but existing methods still face two key challenges. At the model level, traditional drug recommendation methods only predict structured drug codes with limited evidence grounding, while LLM agents can use richer clinical context but may lack safety verification and traceability. At the task level, existing benchmarks often use broad medication categories, which ignore subgroup-level safety differences and can lead to risk overestimation. We introduce the first fine-grained medication recommendation setting based on fourth-level ATC code generation. We propose Safe Prescription Agent (SafeRx-Agent), a knowledge-grounded multi-agent framework that uses patient context, external clinical knowledge, and safety verification to recommend traceable medication sets. Experimental results on MIMIC-III and MIMIC-IV datasets show that SafeRx-Agent improves fine-grained medication prediction accuracy while controlling drug interactions, contraindications, and medication set size.
Jul 30, 2026

GRAIN: Molecules Are Not the Right Granularity -- Active-Ingredient Modeling for Safe Medication Recommendation

Medication recommendation from electronic health records must balance predictive accuracy against the risk of adverse drug-drug interactions (DDIs) under polypharmacy. Existing safety-aware recommenders operate at one of two granularities: the drug code, which treats each medication as an indivisible token, or the molecular substructure, which is finer than pharmacological interaction knowledge is actually organized. We argue that the active ingredient is the missing granularity, and introduce GRAIN, a medication recommendation framework built around it. GRAIN encodes longitudinal patient trajectories (diagnoses, procedures, past medications) with a selective state space backbone that handles long, irregular visit sequences in linear time. On top of it we introduce a joint objective unifying three knowledge sources aligned to a common medication vocabulary: a drug-level DDI graph, an ingredient-level DDI graph obtained by normalizing medication codes to active ingredients via RxNorm, and an EHR-derived co-prescription graph. A proportional controller adapts the accuracy-safety trade-off to the observed validation DDI rate rather than fixing it a priori. Under strictly matched settings -- identical preprocessing, cohort, vocabulary, split, and evaluation code -- GRAIN improves over a re-implemented MambaHealth baseline on MIMIC-IV across all standard multi-label metrics (Jaccard 0.4488 to 0.4983, PRAUC 0.6911 to 0.7485, F1 0.5989 to 0.6453) while reducing the drug-level DDI rate from 0.1875 to 0.0948. We further define an ingredient-level DDI rate, a safety measure invisible to drug-code-level evaluation. The results indicate that ingredient-level normalization recovers predictive signal erased by code-level aggregation, and that it is complementary to, rather than in competition with, accurate sequence modeling.