Obtain Surescripts network certification and sandbox credentials; configure your system as a Prescriber System or Pharmacy System participant type
Construct the SCRIPT 2017071 NewRx XML document: populate Header (MessageID, SentTime, To/From SPI routing addresses), Patient segment (PTT), Prescriber segment (PVD with NPI and DEA if controlled), Drug segment (DRU with NDC or RxNorm code), and SigText (up to 1,000 characters in v2017071)
Set Quantity (QTY segment), DaysSupply, Refills, and WrittenDate fields; for controlled substances include EPCS digital signature block per DEA 21 CFR 1311
Submit the NewRx message over Surescripts SOAP/HTTPS endpoint; receive synchronous HTTP 200 acknowledgment then await asynchronous Status or Error transaction callback
Handle RxChangeRequest response from pharmacy if drug or quantity substitution is needed; respond with RxChangeResponse Approved or Denied transaction
Log all message IDs for audit trail; retain SCRIPT messages per applicable state e-prescribing record retention law (often 10 years)
Known gotchas
Surescripts requires prior certification testing in their sandbox before production access; the certification process includes mandatory test case scenarios that must pass before go-live approval
SCRIPT 2017071 SIG coded fields are optional but some pharmacy systems cannot parse free-text SigText reliably; always send both SigText and structured SIG elements where possible
The SPI (Surescripts Prescriber Identifier) is distinct from NPI; a provider must be enrolled in the Surescripts directory and have an active SPI before NewRx routing will succeed
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