Medications Section¶
Template ID: 2.16.840.1.113883.10.20.22.2.1.1 Version: R2.1 (2014-06-09) Badge: Core Section
Overview¶
The Medications Section contains a patient's current and historical medications, including prescriptions, over-the-counter medications, and medication administration records. This section is critical for medication reconciliation, drug interaction checking, and continuity of care.
Clinical Purpose and Context¶
The Medications Section documents: - All current medications a patient is taking - Historical medications that have been discontinued - Medication details including dosage, route, frequency, and status - Start and end dates for medication therapy - Patient instructions for medication administration
This information is essential for: - Preventing adverse drug interactions - Ensuring medication continuity during care transitions - Supporting clinical decision-making - Meeting Meaningful Use requirements
When to Include¶
The Medications Section is a required section in most C-CDA document types, including: - Continuity of Care Documents (CCD) - Discharge Summaries - Transfer Summaries - Consultation Notes - History and Physical Notes
Even if a patient is not taking any medications, the section should be included with narrative text stating "No known medications."
Template Details¶
Official OID¶
- Root: 2.16.840.1.113883.10.20.22.2.1.1
- Extension: 2014-06-09 (R2.1)
Conformance Level¶
- Conformance: SHALL (Required in entries-required variant)
- Section Code: 10160-0 (LOINC - "History of Medication use Narrative")
Cardinality¶
- Section: 1..1 (Required in most C-CDA document types)
- Entries: 1..* (At least one Medication Activity entry is required for entries-required variant)
Related Templates¶
- Medication Activity (V2): 2.16.840.1.113883.10.20.22.4.16:2014-06-09
- Medication Information (V2): 2.16.840.1.113883.10.20.22.4.23:2014-06-09
Protocol Requirements¶
The MedicationProtocol defines the data contract for medication entries. Each medication must provide:
Required Properties¶
| Property | Type | Description |
|---|---|---|
name |
str |
Human-readable medication name |
code |
str |
RxNorm code for the medication |
dosage |
str |
Dosage amount (e.g., "10 mg", "1 tablet") |
route |
str |
Route of administration (e.g., "oral", "IV") |
frequency |
str |
Frequency of administration |
start_date |
date |
Date medication was started |
status |
str |
Status: 'active', 'completed', 'discontinued' |
Optional Properties¶
| Property | Type | Description |
|---|---|---|
end_date |
Optional[date] |
Date medication was stopped (None if ongoing) |
instructions |
Optional[str] |
Patient instructions |
Data Types and Constraints¶
- name: Free-text medication name (e.g., "Lisinopril 10mg oral tablet")
- code: Must be a valid RxNorm code
- dosage: Can include quantity and unit (e.g., "10 mg", "2 tablets")
- route: Common values include "oral", "IV", "topical", "subcutaneous", "intramuscular"
- frequency: Human-readable frequency (e.g., "twice daily", "every 6 hours", "as needed")
- status: Determines the activity statusCode and effective time high element
- start_date: Formatted as YYYYMMDD in CDA XML
- end_date: Only applicable for completed or discontinued medications
Code Example¶
Here's a complete working example using ccdakit to create a Medications Section:
from datetime import date
from ccdakit.builders.sections.medications import MedicationsSection
from ccdakit.core.base import CDAVersion
# Define a medication using a simple class that implements MedicationProtocol
class Medication:
def __init__(self, name, code, dosage, route, frequency, start_date,
status, end_date=None, instructions=None):
self._name = name
self._code = code
self._dosage = dosage
self._route = route
self._frequency = frequency
self._start_date = start_date
self._status = status
self._end_date = end_date
self._instructions = instructions
@property
def name(self):
return self._name
@property
def code(self):
return self._code
@property
def dosage(self):
return self._dosage
@property
def route(self):
return self._route
@property
def frequency(self):
return self._frequency
@property
def start_date(self):
return self._start_date
@property
def end_date(self):
return self._end_date
@property
def status(self):
return self._status
@property
def instructions(self):
return self._instructions
# Create medication instances
medications = [
Medication(
name="Lisinopril 10mg oral tablet",
code="314076",
dosage="10 mg",
route="oral",
frequency="once daily",
start_date=date(2020, 3, 15),
status="active",
instructions="Take in the morning with water"
),
Medication(
name="Metformin 500mg oral tablet",
code="860975",
dosage="500 mg",
route="oral",
frequency="twice daily",
start_date=date(2020, 3, 15),
status="active",
instructions="Take with meals"
),
Medication(
name="Amoxicillin 500mg oral capsule",
code="308192",
dosage="500 mg",
route="oral",
frequency="three times daily",
start_date=date(2023, 10, 1),
status="completed",
end_date=date(2023, 10, 10),
instructions="Complete the full course"
)
]
# Build the Medications Section
section_builder = MedicationsSection(
medications=medications,
title="Medications",
version=CDAVersion.R2_1
)
# Generate XML element
section_element = section_builder.build()
# Convert to XML string (for demonstration)
from lxml import etree
xml_string = etree.tostring(section_element, pretty_print=True, encoding='unicode')
print(xml_string)
Official Reference¶
For complete specification details, refer to the official HL7 C-CDA R2.1 documentation: - HL7 C-CDA R2.1 Implementation Guide - Section: 5.34 - Medications Section (entries required)
Best Practices¶
Common Patterns¶
- Use RxNorm Codes
- RxNorm is the required vocabulary for medication codes
- Use specific product codes when available (e.g., brand + strength + form)
-
Use the RxNorm API or RxNav tool to find correct codes
-
Document All Medication Details
- Include complete dosage information (amount and unit)
- Specify route of administration using standard terminology
-
Provide clear frequency instructions
-
Track Medication Status Accurately
- Use 'active' for current medications
- Use 'completed' for medications that were finished as planned
-
Use 'discontinued' for medications that were stopped early
-
Include Patient Instructions
- Add administration instructions when clinically relevant
- Include timing relative to meals, activities, or other medications
- Note any special handling or storage requirements
Validation Tips¶
- Section Code Validation
- Ensure section code is 10160-0 (LOINC "History of Medication use Narrative")
-
This is automatically set by the builder
-
Template ID Validation
- Verify the template ID includes both root and extension attributes
-
R2.1 uses extension="2014-06-09"
-
RxNorm Code Validation
- Verify RxNorm codes are current and valid
- Check that codes represent clinical drugs, not ingredients alone
-
Use the RxNorm API for validation
-
Date Consistency
- Ensure end_date is after start_date
- Don't provide end_date for active medications
- Provide end_date for completed or discontinued medications
Gotchas to Avoid¶
- Missing Required Elements
- Always include at least one medication entry in entries-required variant
-
Include all required medication activity elements (dose, route, frequency)
-
Incorrect Code System
- Must use RxNorm codes, not NDC or other medication vocabularies
-
RxNorm OID is 2.16.840.1.113883.6.88
-
Date Format Issues
- Use Python date objects, not strings
-
The builder handles formatting to CDA TS format (YYYYMMDD)
-
Route Codes
- Route should use FDA Route of Administration codes
- Common routes: C38288 (oral), C38276 (intravenous), C38304 (topical)
-
The builder accepts display names and maps them appropriately
-
Frequency Representation
- C-CDA supports structured frequency (effectiveTime with PIVL_TS)
- For simplicity, the builder uses human-readable text
-
Consider structured timing for interoperability with e-prescribing systems
-
Medication Status vs. Activity Status
- The Medication Activity statusCode reflects the activity, not the medication
- Active medications can have a completed activity (administered as ordered)
-
Track whether the medication is current vs. whether the order was fulfilled
-
Empty Medication Lists
- An empty medication list may fail validation in entries-required contexts
- Consider using the entries-optional variant if no medications exist
-
Or include "No Known Medications" as a documented observation
-
Narrative-Entry Mismatch
- Ensure narrative table content matches structured entries
-
The builder handles this automatically but be aware when customizing
-
Dosage Precision
- Include both numeric value and unit in dosage
- Use standard UCUM units for measurements
-
Be consistent with precision (e.g., "10 mg" not "10mg")
-
Historical Medications
- Include recent historical medications for context
- Consider relevance when including very old discontinued medications
- Focus on medications relevant to current care