FinchContext
Run with

Build E-Prescribing Transaction (NCPDP SCRIPT)

Skill: Convert a prescription into an NCPDP SCRIPT e-prescribing transaction

Region: United States Category: Health Care EDI Does: Takes a prescriber's medication order and assembles an NCPDP SCRIPT transaction — the national standard for electronic prescribing between prescribers, pharmacies, and intermediaries (Surescripts), including new prescriptions, renewals, changes, cancellations, electronic prior authorization, and controlled-substance prescribing. Spec: NCPDP SCRIPT Standard (XML; e.g. v2023011 / current adopted version)

SCRIPT is maintained by the National Council for Prescription Drug Programs. CMS adopted specific SCRIPT versions for Medicare Part D e-prescribing, and EPCS (Electronic Prescribing of Controlled Substances) carries additional DEA identity-proofing, two-factor signing, and audit requirements. Transactions almost always route through the Surescripts network. Confirm the CMS-adopted SCRIPT version and Surescripts companion requirements before building.


Transaction types

Transaction Purpose
NewRx Prescriber → pharmacy: a new prescription
RxRenewalRequest / Response Pharmacy ↔ prescriber: refill authorization
RxChangeRequest / Response Pharmacy ↔ prescriber: therapeutic/prior-auth/clarification change
CancelRx / CancelRxResponse Cancel a previously sent prescription
RxFill Pharmacy → prescriber: fill/dispense status
NewRx (EPCS) New prescription for a controlled substance (Schedule II–V) with DEA two-factor signature
ePA (PAInitiationRequest/Response, etc.) Electronic prior-authorization exchange

Message structure (XML)

<Message>
  <Header>
    <To Qualifier="..."> / <From Qualifier="...">     (routing IDs)
    <MessageID>, <SentTime>, <PrescriberOrderNumber>
  </Header>
  <Body>
    <NewRx>
      <Patient>        name, DOB, gender, address, contact
      <Pharmacy>       NCPDP Provider ID, NPI, name, address
      <Prescriber>     NPI, DEA (controlled), SPI, name, address, contact
      <MedicationPrescribed>
         DrugDescription, <DrugCoded> (NDC / RxNorm), Quantity (+ unit code),
         DaysSupply, Directions (Sig), Refills, Substitutions,
         WrittenDate, <DEASchedule> (controlled)
      <Observation> (height/weight, situational)
    </NewRx>
  </Body>
</Message>

Key identifiers & code sets

Element Carries
NPI prescriber and pharmacy National Provider Identifier
DEA number required for controlled substances (EPCS)
SPI Surescripts Prescriber Identifier (network routing)
NCPDP Provider ID pharmacy identifier
DrugCoded NDC (National Drug Code) and/or RxNorm RXCUI; potency/form qualifiers
Quantity value + NCPDP quantity unit of measure code + dosage-form description
DEASchedule controlled-substance schedule (CII–CV) for EPCS

Data rules


Worked example (NewRx — outline)

Header: From SPI=1234567 (Dr. Lee) → To NCPDP=5912345 (Acme Pharmacy); PrescriberOrderNumber=RX-1001
Patient:    Jane Doe, DOB 1985-01-15, F
Prescriber: NPI 1234567893, Dr. M. Lee
Pharmacy:   NCPDP 5912345, NPI 1982634...
MedicationPrescribed:
   DrugDescription: Amoxicillin 500 MG Oral Capsule
   DrugCoded: NDC 00093-3107-01 / RxNorm 308191
   Quantity: 30  (UOM = C48542 capsule)
   DaysSupply: 10
   Sig: "Take 1 capsule by mouth three times daily for 10 days"
   Refills: 0
   Substitutions: 0 (allowed)
   WrittenDate: 2025-05-31

(Non-controlled, so no DEA/DEASchedule/EPCS signature needed.) Emitted as a SCRIPT <Message><Body><NewRx> and routed via Surescripts.


Validation checklist


Last updated: 2026-05-31 — confirm the CMS-adopted NCPDP SCRIPT version, EPCS/DEA requirements, code sets (NDC/RxNorm/UOM), and Surescripts companion rules against current NCPDP and CMS guidance before use.