An intelligent OCR-LLM prescription review system for inpatient narcotic and psychotropic drugs

This study aimed to construct an intelligent prescription review system for inpatient narcotic and psychotropic drugs based on deep learning-based optical character recognition (OCR) and a local large language model (LLM) and evaluate its review performance and closed-loop management value. This study adopted a combined system development and retrospective validation design. Prescription images were first processed using OCR for text recognition and layout reconstruction. A local LLM was then applied to convert unstructured prescription text into standardized JavaScript Object Notation-formatted data. Subsequently, a locally developed rule base for narcotic and psychotropic drugs was used to evaluate prescription completeness, diagnosis-based dosage limits, medication instructions, physician signatures, and residual drug handling for injectable formulations. Using pharmacists' manual review results as the reference standard, 500 inpatient prescriptions for narcotic and psychotropic drugs were retrospectively included. System performance was evaluated in terms of accuracy, sensitivity, specificity, positive predictive value, negative predictive value, F1 score, and Cohen's kappa coefficient. The system successfully implemented prescription image recognition, text structuring, rule-based validation, signature verification, residual drug calculation, and triggers for manual pharmacist review. In the retrospective validation, compared with pharmacists' manual review, the system identified 144 true positives, 16 false positives, 334 true negatives, and 6 false negatives. The overall accuracy was 95.6%, sensitivity was 96.0%, specificity was 95.4%, positive predictive value was 90.0%, negative predictive value was 98.2%, F1 score was 0.929, and Cohen's kappa coefficient was 0.897. The proposed OCR-LLM-based intelligent prescription review system for inpatient narcotic and psychotropic drugs demonstrates high accuracy and strong consistency. It can serve as a front-end screening and decision-support tool for pharmacists and provides technical support for standardized, traceable, and closed-loop management of specially controlled medications.

Authors

Institutions

Publication Details

Journal
Medicine
Published
2026-09-18
DOI
https://doi.org/10.1097/md.0000000000050741
Primary Topic
Pharmaceutical Practices and Patient Outcomes
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
article

An intelligent OCR-LLM prescription review system for inpatient narcotic and psychotropic drugs

张鸣明, Xingrong Ma, Kai Xu, Rong Ma et al.
Medicine
Pharmaceutical Practices and Patient Outcomes
article

An intelligent OCR-LLM prescription review system for inpatient narcotic and psychotropic drugs

张鸣明, Xingrong Ma, Kai Xu, Rong Ma, Jing Li, Junyu Wang, Xiangpeng Li
article en

Abstract

This study aimed to construct an intelligent prescription review system for inpatient narcotic and psychotropic drugs based on deep learning-based optical character recognition (OCR) and a local large language model (LLM) and evaluate its review performance and closed-loop management value. This study adopted a combined system development and retrospective validation design. Prescription images were first processed using OCR for text recognition and layout reconstruction. A local LLM was then applied to convert unstructured prescription text into standardized JavaScript Object Notation-formatted data. Subsequently, a locally developed rule base for narcotic and psychotropic drugs was used to evaluate prescription completeness, diagnosis-based dosage limits, medication instructions, physician signatures, and residual drug handling for injectable formulations. Using pharmacists' manual review results as the reference standard, 500 inpatient prescriptions for narcotic and psychotropic drugs were retrospectively included. System performance was evaluated in terms of accuracy, sensitivity, specificity, positive predictive value, negative predictive value, F1 score, and Cohen's kappa coefficient. The system successfully implemented prescription image recognition, text structuring, rule-based validation, signature verification, residual drug calculation, and triggers for manual pharmacist review. In the retrospective validation, compared with pharmacists' manual review, the system identified 144 true positives, 16 false positives, 334 true negatives, and 6 false negatives. The overall accuracy was 95.6%, sensitivity was 96.0%, specificity was 95.4%, positive predictive value was 90.0%, negative predictive value was 98.2%, F1 score was 0.929, and Cohen's kappa coefficient was 0.897. The proposed OCR-LLM-based intelligent prescription review system for inpatient narcotic and psychotropic drugs demonstrates high accuracy and strong consistency. It can serve as a front-end screening and decision-support tool for pharmacists and provides technical support for standardized, traceable, and closed-loop management of specially controlled medications.

MedicineVol. 105(38)
Qingdao University (CN), Jinan Maternity And Care Hospital (CN), Affiliated Hospital of Qingdao University (CN), Qingdao Municipal Hospital (CN), Qingdao Eighth People's Hospital (CN)
Peace, Justice and strong institutions
Openalex Percentile: Top 15%
Pharmaceutical Practices and Patient Outcomes
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.