Inferensys

Glossary

Medication Extraction

Medication extraction is a specialized named entity recognition task that identifies drug mentions and their structured attributes—including dosage, frequency, route, and duration—from unstructured clinical narratives.
Product manager reviewing autonomous task execution dashboard on laptop, completed tasks visible, casual work session.
CLINICAL NLP TASK

What is Medication Extraction?

A specialized named entity recognition task focused on identifying drug mentions and their structured attributes from unstructured clinical narratives.

Medication extraction is a specialized named entity recognition (NER) task that identifies mentions of pharmaceutical substances in clinical text and extracts their structured attributes—including dosage, frequency, route of administration, and duration—transforming narrative physician notes into machine-readable data.

Unlike general drug recognition, medication extraction must resolve complex, multi-attribute relationships within a single sentence, such as linking 'take 500mg of metformin twice daily with meals' to a single structured medication object. This requires contextual disambiguation to distinguish active medications from historical ones and to normalize extracted entities to standardized terminologies like RxNorm.

Structured Pharmacological Data

Core Medication Attributes Extracted

Medication extraction goes beyond simple drug name recognition to capture the full clinical context of a prescription. These structured attributes enable downstream automation for reconciliation, prior authorization, and clinical decision support.

01

Drug Name and Strength

Identifies the active ingredient or brand name along with its numeric strength and unit of measure. This foundational attribute distinguishes between formulations like 'Lisinopril 10 mg' and 'Lisinopril 20 mg', which have different therapeutic implications.

  • Brand vs. Generic: Maps trade names like 'Zestril' to their generic equivalent 'Lisinopril'
  • Compound Medications: Detects multi-ingredient drugs such as 'Lisinopril/Hydrochlorothiazide 20/12.5 mg'
  • Normalization: Links extracted strings to standardized RxNorm concept unique identifiers for interoperability
02

Dosage and Frequency

Extracts the quantitative amount to be taken and the temporal schedule governing administration. This pair is critical for calculating daily intake and identifying potential overdose scenarios.

  • Dosage: Captures structured values like '2 tablets' or '10 mL'
  • Frequency: Resolves abbreviations such as 'BID' (twice daily), 'TID' (three times daily), and 'QHS' (at bedtime)
  • Complex Schedules: Handles tapering instructions like 'Take 2 tablets daily for 7 days, then 1 tablet daily'
03

Route of Administration

Classifies the anatomical path by which the medication enters the body. The route directly impacts bioavailability and is essential for distinguishing safe from erroneous orders.

  • Common Routes: Oral (PO), Intravenous (IV), Intramuscular (IM), Subcutaneous (SC), Topical
  • Ambiguity Resolution: Differentiates 'PO' (by mouth) from 'PO' (post-operative) using contextual embeddings
  • Safety Implications: Flags mismatches like an IV-only formulation ordered with an oral route
04

Duration and Quantity

Captures the total length of therapy and the dispensed amount, enabling calculation of days' supply and identification of truncated or extended regimens.

  • Duration: Extracts explicit statements like 'for 10 days' or 'until follow-up'
  • Quantity: Parses dispense amounts such as '#30' or 'Qty: 60 mL'
  • PRN Designation: Identifies 'as needed' medications where duration is indefinite and tied to symptom recurrence
05

Sig: The Complete Instruction

Reconstructs the full signatura—the patient-facing administration instruction—as a unified, structured object. The sig synthesizes all extracted attributes into a single, actionable directive.

  • Free-Text Parsing: Converts 'Take 1 tab by mouth twice daily for 14 days' into discrete structured fields
  • Latin Abbreviation Expansion: Translates archaic shorthand like '1 tab PO BID x 14d' into plain English
  • Standardization: Outputs a canonical representation suitable for pharmacy system ingestion and patient education materials
06

Temporal Context and Status

Determines whether the medication mention refers to a current active order, a historical prescription, or a discontinued therapy. This temporal grounding prevents double-counting and ensures accurate medication reconciliation.

  • Status Classification: Labels mentions as Active, Discontinued, Historical, or Planned
  • Date Association: Links the medication to specific start and stop dates when explicitly stated
  • Section Awareness: Leverages document zones like 'Discharge Medications' vs. 'Home Medications' to infer status when dates are absent
MEDICATION EXTRACTION

Frequently Asked Questions

Clear, technical answers to the most common questions about identifying and structuring drug information from unstructured clinical narratives.

Medication extraction is a specialized Named Entity Recognition (NER) task that identifies mentions of pharmaceutical substances in clinical text and classifies their associated attributes—such as dosage, frequency, route, and duration—into a structured, machine-readable format. Unlike general NER, which might simply tag 'metformin' as a drug, medication extraction parses the full signature: 'metformin 500mg PO BID' is decomposed into the active ingredient (metformin), strength (500mg), route (PO/oral), and frequency (BID/twice daily). Modern systems achieve this using fine-tuned transformer models like BioBERT or ClinicalBERT that leverage contextual embeddings to understand the semantic relationships between these attribute spans within a sentence. The pipeline typically involves a span categorization or BIO tagging sequence labeling layer, followed by a relation extraction component that links the drug name to its modifiers, ensuring that '500mg' is correctly associated with 'metformin' and not an adjacent medication in the same note.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.