Maintenance Notice

Due to necessary scheduled maintenance, the JMIR Publications website will be unavailable from Wednesday, July 01, 2020 at 8:00 PM to 10:00 PM EST. We apologize in advance for any inconvenience this may cause you.

Who will be affected?

Currently submitted to: JMIR Medical Informatics

Date Submitted: Feb 18, 2026

Warning: This is an author submission that is not peer-reviewed or edited. Preprints - unless they show as "accepted" - should not be relied on to guide clinical practice or health-related behavior and should not be reported in news media as established information.

Neurosymbolic Contraindication Detection in Clinical Pharmacy Notes: A Knowledge Graph Approach to Medication Safety in Medicaid Care Management

  • Sanjay Basu

ABSTRACT

Background:

Embedded clinical pharmacists in Medicaid care management programs produce medication-rich documentation that may contain drug-disease contraindications not detected by general-purpose text classifiers trained on care coordination notes.

Objective:

To develop and evaluate a neurosymbolic clinical decision support system combining a neural text classifier (ClinicalBERT) with a symbolic knowledge graph reasoning layer for detecting medication contraindications, and to characterize how contraindication detection rates vary across clinical documentation types produced by a multidisciplinary Medicaid care management program.

Methods:

We conducted a retrospective cross-sectional analysis of 98,189 clinical notes from 34,332 patients among 184,572 Medicaid enrollees in Washington and Virginia. The neurosymbolic system paired ClinicalBERT (a fine-tuned transformer encoder) with a symbolic reasoning layer encoding 63 clinical rules (30 contraindication, 19 risk-amplification, 14 required-intervention edges) derived from Clinical Pharmacogenetics Implementation Consortium (CPIC) guidelines, US Food and Drug Administration (FDA) boxed warnings, and American Geriatrics Society (AGS) Beers Criteria. A rule-based entity extractor identified approximately 250 medications and 140 conditions with sentence-scoped negation detection. We compared symbolic contraindication detection rates across four documentation types: pharmacy reviews (n=1,519), pharmacy outreach notes (n=1,500), community health worker (CHW) notes (n=1,500), and care coordinator notes (n=1,500), and analyzed the overlap between symbolic contraindication detection and ClinicalBERT hazard classification on pharmacy reviews.

Results:

ClinicalBERT achieved area under the receiver operating characteristic curve (AUROC) 0.97 (95\% CI: 0.95--0.99), sensitivity 86.9\% (95\% CI: 77.8--93.3), and specificity 95.5\% (95\% CI: 87.3--99.1) on held-out real-world notes (n=150). Two alternative pre-trained language models---BioBERT (AUROC 0.97; 95\% CI: 0.94--0.99) and PubMedBERT (AUROC 0.98; 95\% CI: 0.97--0.99)---achieved comparable discrimination, indicating that the classification architecture generalizes across biomedical encoders. The symbolic layer detected contraindications in 107 of 1,519 pharmacy reviews (7.0\%; 95\% CI: 5.9--8.4), comprising 128 total firings across 17 distinct contraindication types. Contraindication detection rates varied across documentation types: 7.0\% (95\% CI: 5.9--8.4) for pharmacy reviews versus 0.1\% (95\% CI: 0.0--0.4) for pharmacy outreach, 0.3\% (95\% CI: 0.1--0.8) for CHW notes, and 0.0\% (95\% CI: 0.0--0.3) for care coordinator notes. Of the 107 contraindication-positive pharmacy reviews, 30 (28.0\%; 95\% CI: 20.4--37.2) were missed by ClinicalBERT at the 0.50 classification threshold. Entity extraction achieved medication F1 0.98 and condition F1 0.96 on physician scenarios; negation detection achieved 89.7\% accuracy. Fairness analysis showed sensitivity differences across demographic subgroups, with a sex-based true positive rate gap of 0.19 and a race/ethnicity-based true positive rate gap of 0.23.

Conclusions:

A neurosymbolic architecture combining ClinicalBERT with knowledge graph reasoning detects medication contraindications in pharmacy documentation that are missed by neural classification alone. The variation in contraindication detection rates across documentation types---driven by differences in medication-condition co-mention density---identifies clinical pharmacy notes as a high-yield substrate for automated medication safety monitoring in Medicaid care management programs.


 Citation

Please cite as:

Basu S

Neurosymbolic Contraindication Detection in Clinical Pharmacy Notes: A Knowledge Graph Approach to Medication Safety in Medicaid Care Management

JMIR Preprints. 18/02/2026:93763

DOI: 10.2196/preprints.93763

URL: https://preprints.jmir.org/preprint/93763

Download PDF


Request queued. Please wait while the file is being generated. It may take some time.

© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.