Medication errors pose a significant threat to patient safety, making pharmacist verification (PV) a critical, yet heavily burdened, final safeguard. The direct application of Large Language Models (LLMs) to this zero-tolerance domain is untenable due to their inherent factual unreliability, lack of traceability, and weakness in complex reasoning. To address these challenges, we introduce PharmGraph-Auditor, a novel system designed for safe and evidence-grounded prescription auditing. The core of our system is a trustworthy Hybrid Pharmaceutical Knowledge Base (HPKB), implemented under the Virtual Knowledge Graph (VKG) paradigm. This architecture strategically unifies a relational component for set constraint satisfaction and a graph component for topological reasoning via a rigorous mapping layer. To construct this HPKB, we propose the Iterative Schema Refinement (ISR) algorithm, a framework that enables the co-evolution of both graph and relational schemas from medical texts. For auditing, we introduce the KB-grounded Chain of Verification (CoV), a new reasoning paradigm that transforms the LLM from an unreliable generator into a transparent reasoning engine. CoV decomposes the audit task into a sequence of verifiable queries against the HPKB, generating hybrid query plans to retrieve evidence from the most appropriate data store. Experimental results demonstrate robust knowledge extraction capabilities and show promises of using PharmGraph-Auditor to enable pharmacists to achieve safer and faster prescription verification.
Figures & tables
Figure 1. The workflow and the role of PharmGraph-Auditor.
Dimension
Relational ( R )
Graph ( G )
Data Nature
Atomic, Numerical, Conditional
Associative, Hierarchical, Transitive
Logic Type
Set Constraint Satisfaction
Topological Traversal
Access Cost
Index Scan: O(logN)
Index-free Adjacency: O(1)†
Complexity
Dependent on Dataset Size ( N )
Independent of Dataset Size ( N )
Typical Audit
Dosage Checks, Contraindications
Interactions, Allergies, Duplicate Therapy
† O(1) denotes constant time per relationship traversal, irrespective of ∣V∣ .
Table 1. The Knowledge Stratification Framework
Figure 2. System architecture of PharmGraph-Auditor.
Figure 3. The KB-grounded Chain of Verification (CoV) framework.
Figure 4. The Patient Profile-driven Evidence Selection Tree (P-EST) logic for pruning conflicting dosage rules.
Metric
Relational Data
Graph Relations
Total
# Documents
100
100
100
# Extracted Records
2,951
923
3,874
Avg. # Records / Doc
29.51
9.23
38.74
Table 2. Statistics of the Golden Standard HPKB
Method
Component
Precision
Recall
F1-score
PharmGraph-Auditor (Ours, GPT-4o)
Relational
0.7973
0.8243
0.8106
Graph
0.9565
0.9565
0.9565
Overall (Micro)
0.8260
0.8491
0.8374
PharmGraph-Auditor (Ours, Deepseek-V3)
Relational
0.7948
0.8378
0.8157
Graph
0.9782
0.9782
0.9782
Overall (Micro)
0.8235
0.8603
0.8415
Table 3. Performance on Knowledge Population Task
Figure 5. Types of prescription errors.
Method
Precision
Recall
F1-Score
Experience Review (Human)
100.0%
45.9%
62.9%
Rule Review (CDSS)
52.1%
67.6%
58.8%
Proposed Method (Ours)
74.3%
70.3%
72.2%
Table 4. Performance Comparison
Figure 6. Fine-grained performance analysis by risk category. The top chart illustrates Precision, and the bottom chart illustrates Recall.