Process an NCPDP SCRIPT 2017071 CancelRx transaction to void a transmitted prescription before it is dispensed

domain: ncpdp.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Confirm the prescription has not yet been dispensed: check RxFill status or contact the pharmacy; once a prescription has been dispensed, cancellation via SCRIPT is not appropriate—a refill restriction or clinical intervention is needed instead
  2. Construct a CancelRx transaction per NCPDP SCRIPT 2017071: populate Header with PrescriberOrderNumber matching the original NewRx, routing To/From SPI addresses, and MessageID; include Patient and Drug segments to identify the specific prescription
  3. Transmit the CancelRx over Surescripts to the dispensing pharmacy; await a CancelRxResponse: Approved (prescription voided), Denied (prescription already dispensed or in process), or Error
  4. If CancelRxResponse returns Denied with reason 'already dispensed', document the response and notify the prescriber; if clinical concern is urgent (e.g., wrong drug, patient allergy), contact the pharmacy directly by phone as a concurrent action
  5. Update the EHR prescription record status to Cancelled upon confirmed CancelRxResponse Approved; ensure the cancelled order cannot be re-transmitted
  6. For controlled substances, document the cancellation reason per DEA and state pharmacy board requirements; some states require specific documentation when a controlled substance prescription is voided

Known gotchas

Related routes

Implement NCPDP SCRIPT CancelRx and process the pharmacy's CancelRx Response to cancel an active e-prescription
healthcare · 6 steps · unrated
Implement an NCPDP SCRIPT 2017071 RxFill transaction flow to receive dispense status confirmations back at the prescriber's EHR from the pharmacy
ncpdp.org · 6 steps · unrated
Process an NCPDP SCRIPT RxRenewalRequest from a pharmacy to authorize a prescription renewal at the prescriber's EHR
ncpdp.org · 6 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans