Complete the Surescripts Medication History for Pharmacy certification and execute the required data use agreement; obtain sandbox and production API credentials from the Surescripts developer portal
At the point of dispensing a new prescription, construct a Medication History request: include patient demographics (first name, last name, date of birth, gender) and patient consent status; Surescripts requires documented patient consent for medication history queries in most use cases
Submit the request to the Surescripts Medication History API endpoint; receive a structured response containing fill history records from participating pharmacies, PBMs, and payers—each record includes NDC, drug name, quantity, days supply, prescriber NPI, dispensing date, and dispensing pharmacy NPI
Parse the history response to identify potential drug-drug interactions, duplicate therapies, or adherence patterns; surface alerts to the pharmacist for clinical review before dispensing
Handle partial or no-history responses: not all fills are captured (some cash-pay fills, some non-participating pharmacies may have gaps); communicate to pharmacists that absence of history is not equivalent to absence of therapy
Log the query transaction ID and timestamp; retain query and response records per applicable state pharmacy law and Surescripts data use agreement requirements
Known gotchas
Patient consent handling is critical: Surescripts requires evidence of patient consent before releasing medication history; pharmacy systems must implement a consent capture workflow and transmit consent status in the request—missing or incorrect consent status can result in query rejection
Medication history from Surescripts is a point-in-time snapshot and does not guarantee completeness; it covers only pharmacies and payers that participate in the Surescripts network and have submitted data within the response lookback window
Using medication history for purposes beyond direct patient care (e.g., marketing or population analytics without proper data governance) violates the Surescripts data use agreement and potentially HIPAA; restrict access to care-team users only
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp