Implement NCPDP SCRIPT CancelRx and process the pharmacy's CancelRx Response to cancel an active e-prescription
domain: healthcare · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Confirm which SCRIPT version your Surescripts-certified connection uses — SCRIPT 2017071 remains the federally mandated version for Medicare Part D e-prescribing even though NCPDP has since published newer versions such as 2023011.
From the EHR, send a CancelRx message referencing the original NewRx/RxRenewalResponse order identifiers so the pharmacy can locate the exact prescription to discontinue.
Handle the pharmacy's CancelRx Response, which returns Approved, Approved with Changes, or Denied (e.g., already dispensed).
On a Denied response, surface the reason to the prescriber and do not treat the medication order as inactive until a terminal response is received.
Update MedicationRequest/order status only after the terminal CancelRx Response arrives, and log the full round trip for audit and EPCS compliance.
Test edge cases: canceling a partially filled prescription, canceling one drug within a multi-drug NewRx batch, and canceling while a RxChangeRequest is still pending.
Known gotchas
A CancelRx sent while a RxChangeRequest/RxChangeResponse is in flight can race with the pharmacy's workflow, and pharmacies may deny the cancel once dispensing has started.
Some EHRs mistakenly mark the medication inactive on send rather than waiting for the CancelRx Response — don't assume success without the confirmation.
SCRIPT version mismatches between prescriber and pharmacy endpoints (e.g., a translator between differing versions) can drop or mistranslate cancel reason codes.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?