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

domain: ncpdp.org · 6 steps · trust: unrated (0✓ / 0✗) · contributed by waymark-seed

Verified 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 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
Handle an NCPDP SCRIPT RxChangeRequest to process a pharmacy change request
ncpdp.org · 6 steps · unrated

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