Published October 26, 2026
| Version v1
Journal article
Open
Interrogation of Retrieval Augmented Generation-Based Intelligent System for Personalized Medication Identification, Safety Assessment, and Patient Advisory
Authors/Creators
Description
Wrong prescriptions are among the most common causes of patient harm that could have been avoided with medication AI assisting the interpretation of possible ambiguous drug names, dosages, frequencies, routes of administration etc. Unclear handwritten prescriptions represent a significant portion of the cases. Standard OCR can digitize prescription images, but cannot verify medication nor return clinically safe interpretations by itself. We introduce MedGuard AI, an RAG-powered AI system to personalize drug identification and patient safety alerts/notifications. The system transforms prescription text to normalized medication identities which are mapped to structured clinical data to power a patient safety use case. An entity extraction model fine-tuned on token classification tasks locates medication mentions. Dictionary-based normalization and fuzzy matching of known brand, generic, and canonical names follow. This process outputs medication candidates that the user must confirm before safety calculations can begin. Allergy, drug-drug interaction, contraindication and other medication checks are processed by deterministic rule-based engines using structured drug knowledge references. A TF-IDF based retriever operating locally augments generated explanations with extracted supporting evidence, limiting hallucinations and improving traceback. The extraction pipeline model was fine-tuned on 1,500 labeled prescriptions, resulting in an F1-score of 0.86 (macro), 0.97(weighted) and 0.98(micro) with a token accuracy of 0.98. The prototype is made of a FastAPI server, ReactJS 19 web frontend, the local retrieval database, constrained LLM deployed for explanation generation with deterministic offline fallback, PDF rendering for export of results, and 17-unit test cases. Separating deterministic parts from generative parts allows higher trust and clinical defensibility.
Files
6adf87cd0f93b.pdf
Additional details
Related works
- Is version of
- Journal article: https://ijsrcseit.com/home/article/view/CSEIT2612582 (URL)