Skip to content

Dataset

Pharmacy datasets of dispensing and medication records for AI training

A pharmacy dataset is a set of medication records that follow each prescription or inpatient order through the pharmacy: what was written, what the pharmacist checked and changed, what was dispensed on each fill, how the claim was answered and, in hospitals, each dose given. SourceX sources these to a buyer's specification from established retail, specialty, hospital and long-term-care pharmacies and other organizations with rights to the records. Each dataset is de-identified before delivery and licensed for an agreed permitted use. Buyers should confirm the de-identification method and jurisdiction with counsel.

Dataset manifest

Sourced to your spec
What it is
Prescriptions and orders with pharmacist interventions, fill and reversal events, claim responses and administration records
Typical systems
PioneerRx, McKesson EnterpriseRx, Epic Willow, Oracle Health PharmNet, FrameworkLTC and dispensing cabinets
Typical history
Specified by the buyer in patients, prescriptions and years; limited by pharmacy system conversions
Modality
Structured prescription, fill and claim events, plus free-text directions, pharmacist notes and intervention text
Delivery formats
Agreed per order; event-level Parquet or CSV, JSONL per prescription, or FHIR MedicationRequest, MedicationDispense and MedicationAdministration JSON
Preparation
De-identified before delivery under a method recorded per source; prescription numbers replaced; dates shifted or reduced; prescriber fields treated as agreed per order
Licensing
Permitted use agreed per license; the pharmacy's right to license reviewed per source
Availability
Sourced to your spec from pharmacies that hold the records; supply is not guaranteed
Structured recordsIllustrative

What a delivery contains

Fields vary by source system and are fixed per order. A typical delivery includes:

FieldTypeWhat it holds
rx_idstringPseudonymous prescription or order ID that every fill, claim, alert and intervention refers to.
settingenumRetail, mail-order, specialty, hospital or long-term-care pharmacy, which decides which other fields exist.
person_keyobjectPseudonymous patient key, stable across prescriptions at that pharmacy or chain, with age band and sex.
prescriber_refobjectPseudonymous prescriber key with prescriber type and specialty; license, NPI and DEA numbers are removed.
prescribedobjectThe prescription as written: drug, strength, form, quantity, refills authorized and how it arrived, such as electronic, phone, fax or paper.
sigobjectDirections as free text and, where the system parsed them, dose, route and frequency, with the days supply the pharmacy keyed.
alertsarrayScreening alerts shown at verification, such as interaction, allergy, duplicate therapy or dose range, with severity and override reason.
interventionsarrayPharmacist interventions: the problem found, who was contacted, the recommendation, the prescriber's answer and the resulting change.
dispensed_productobjectThe product actually dispensed: NDC, RxNorm concept where mapped, brand or generic, and the dispense-as-written code.
fill_eventsarrayOne entry per fill attempt: fill number, quantity, partial or completion fill, filled and sold times, pickup or delivery, and return to stock.
adjudicationarrayClaim submissions and payer responses per fill: paid, rejected with reject codes, resubmitted or reversed, with payer type.
administrationsarrayHospital and facility doses from the medication administration record: scheduled time, given, held or refused, reason and barcode scan status.
handlingobjectControlled-substance schedule, specialty handling and any sensitive drug-class tag used to scope or exclude records.
deidobjectThe de-identification method, how dates were shifted, and the drug classes or prescriber fields left out.
Sample recordIllustrative

Field names from the table above; values are masked placeholders.

Example record

{
  "rx_id": "rx_7c2e41",
  "setting": "retail",
  "deid": {
    "method": "expert_determination",
    "dates": "days_from_written"
  },
  "person_key": {
    "key": "pt_19af",
    "age_band": "70-79"
  },
  "prescriber_ref": {
    "key": "pr_0c55",
    "specialty": "family_medicine"
  },
  "prescribed": {
    "drug": "metoprolol tartrate 50 mg tablet",
    "quantity": 30,
    "refills": 5,
    "origin": "electronic"
  },
  "sig": {
    "text": "Take 1 tablet by mouth once daily",
    "days_supply": 30
  },
  "interventions": [
    {
      "day": 0,
      "problem": "immediate_release_form_written_once_daily",
      "recommendation": "change_to_extended_release",
      "response": "accepted",
      "result": "prescription_changed",
      "note": "Called office. Per [NAME], OK to change to succinate ER daily."
    }
  ],
  "dispensed_product": {
    "drug": "metoprolol succinate ER 50 mg tablet",
    "ndc": "[NDC]",
    "daw": "no_product_selection_indicated"
  },
  "fill_events": [
    {
      "fill": 0,
      "type": "partial",
      "quantity": 10,
      "reason": "out_of_stock",
      "filled_day": 0,
      "sold_day": 0
    },
    {
      "fill": 0,
      "type": "completion",
      "quantity": 20,
      "filled_day": 2,
      "sold_day": 3
    },
    {
      "fill": 1,
      "quantity": 30,
      "filled_day": 26,
      "sold_day": 26
    },
    {
      "fill": 2,
      "quantity": 30,
      "source": "auto_refill",
      "filled_day": 54,
      "sold_day": null,
      "returned_to_stock_day": 66
    }
  ],
  "adjudication": [
    {
      "fill": 0,
      "day": 0,
      "response": "paid"
    },
    {
      "fill": 1,
      "day": 20,
      "response": "rejected",
      "reject": "refill_too_soon"
    },
    {
      "fill": 1,
      "day": 26,
      "response": "paid"
    },
    {
      "fill": 2,
      "day": 54,
      "response": "paid"
    },
    {
      "fill": 2,
      "day": 66,
      "response": "reversed"
    }
  ]
}

Synthetic record for illustration. Field names, structure and format are agreed per order.

What AI teams use it for

Train prescription verification

Prescriptions as written, paired with the pharmacist's intervention and the product dispensed, are worked examples of checking an order.

Parse directions into structure

Free-text sigs beside the dose, frequency and days supply the pharmacy keyed give labeled pairs for extraction.

Resolve claim rejections

Reject, fix and resubmit sequences show how staff clear refill-too-soon, prior authorization and non-formulary rejects.

Model refill behavior

Fill sequences with sold dates, reversals and days supply support refill-gap and discontinuation models.

Evaluate medication safety reasoning

Held-out interventions with the prescriber's answer make test items for whether a model spots the wrong dose, form or combination.

Use-case guides: Healthcare administration AI, Enterprise and computer-use agents, Private evaluation sets

What makes this data valuable

Interventions on record

Intervention entries exist, link to the prescription or order they changed and carry the prescriber's response.

Before and after kept

The prescription as written survives beside the edited version and the dispensed product.

Reversals linked

Each reversal points to the claim and fill it cancels, and returns to stock are marked.

Sold date present

Pickup or delivery time is recorded separately from fill time.

Free-text sig retained

Directions are delivered as typed, beside any parsed fields.

Stable keys

One key per patient and per prescriber across years makes sequences possible.

Process

Pharmacy dataset

This page covers pharmacy dispensing and medication records.Illustrative

The pharmacist's intervention is the scarce record

Pharmacy data sold for analytics is usually a fill or claim table: a product code, a quantity, a days supply, a date and a payer. It says nothing about the check that came first. A pharmacist verifies each prescription against the patient's profile before it leaves the pharmacy, and a hospital pharmacist generally reviews an order against weight, kidney function, allergies and other active orders before the first dose reaches a nurse, with exceptions such as emergencies. Most pass untouched. Some are stopped, questioned or changed, and those are the cases where a licensed expert disagreed with what was written.

That judgment is stored in several places, at different quality. Screening alerts for interactions, allergies, duplicate therapy and dose range fire constantly, and the override reason is often a quick pick from a short list, so an override log is large and says little. Deliberate interventions are fewer and better. Hospital pharmacy systems typically offer an intervention record with a type, such as renal dose adjustment or intravenous to oral conversion, the recommendation, and whether the prescriber accepted it. Retail pharmacies tend to keep a free-text note on the prescription after a call to the prescriber's office, and electronic prescribing adds structured change requests with the prescriber's reply. Claims can carry drug utilization review codes for the reason, the service performed and the result.

None of it is complete. Documenting an intervention is extra work, so the count reflects each pharmacist's habits as much as each prescriber's errors. A clarification settled by phone may leave only an edited prescription. Ask a holder what share of prescriptions or orders carry an intervention, whether the original and the changed version are both kept, and whether a replacement order links back to the one it replaced.

Written, dispensed and taken are three different facts

A prescription says what a prescriber intended, and some are never filled. A fill says a pharmacy prepared a product, which is still not possession. A prescription can be filled, billed to the plan, left in the pickup bin, returned to stock and its claim reversed. Drop the reversal and the data reports a drug the patient never held. Pickup has its own timestamp, the sold date, and it is the closest a retail record gets to the patient.

Between written and dispensed the product can change. Generic substitution swaps the brand written for an equivalent, and the dispense-as-written code records who asked for the brand when it was kept. The same generic can carry a different NDC from one refill to the next when the pharmacy changes supplier, so ingredient-level work needs a mapping such as RxNorm. A partial fill followed by a completion fill is one fill delivered in two events. Days supply is keyed by pharmacy staff from the directions, exact for one tablet a day and a rough estimate for inhalers, insulin, creams and as-needed drugs, and every refill-gap measure depends on it.

Taken is recorded only where a nurse gives the dose. A hospital or care facility's medication administration record lists each scheduled dose as given, held or refused, with a reason and usually a barcode scan, while removal from a dispensing cabinet is not administration. Elsewhere, a gap between refills can mean a missed month, a dose change, a hospital stay or a move to another pharmacy. So state which fact you are modeling. Prescribing behavior needs prescriptions as written, unfilled ones included. Pharmacy operations need every fill attempt, reject and reversal. Adherence needs sold dates. Exposure needs administration records.

What to check before licensing

  • Get in writing which de-identification method each source used and how fill and sold dates were shifted, since refill intervals depend on them. Confirm the method and jurisdiction with counsel.
  • Ask how the holder's right to license was established. Pharmacies keep prescription records under state pharmacy law and payer contracts, and state prescription-data laws can add limits, so have counsel review each source's states.
  • Decide how prescribers appear. Ask counsel whether any state involved restricts prescriber-identifiable prescription data, and confirm that prescriber keys are pseudonymous and that NPI, DEA and license numbers are gone from free text too.
  • Ask which drug classes were excluded or tagged, including controlled substances and medications for substance use disorder, HIV, mental health and reproductive health.
  • On the sample, count interventions per thousand prescriptions or orders by site and pharmacist, and check that each links to the record it changed.
  • Check that every reversal links to its original claim, and that partial, completion and return-to-stock events can be told apart from ordinary fills.
  • Search sig text, pharmacist notes and intervention text for names and phone numbers of patients, prescribers and office staff.

Delivery No files move before a signed license. A listing or a request grants no files by itself.

How licensing works through SourceX

  1. 1

    Define

    Send the domain, modality, volume, format, timeline and permitted use you need.

  2. 2

    Source

    SourceX identifies businesses that hold matching data and are open to licensing it.

  3. 3

    Qualify

    Fit, rights and quality are checked, and you review samples before committing.

  4. 4

    License

    Scope, permitted use, exclusivity, price and obligations are agreed in writing.

  5. 5

    Deliver

    Approved data is prepared, de-identified where required and transferred securely.

Questions Acquisition Partners ask

Does a pharmacy dataset include pharmacist interventions?

Only if you ask for them and the holder documented them. Fill and claim tables carry none. Hospital pharmacies usually have an intervention record. Retail pharmacies have prescription notes, alert overrides and electronic change requests. Coverage varies by site and pharmacist, so request intervention counts on the sample and the original prescription beside the changed one.

What is the difference between a prescription, a fill and an administration record?

They record three different events. A prescription or order is what the prescriber wrote. A fill is what the pharmacy prepared and, where a sold date exists, handed over. An administration record is a nurse documenting a dose as given, held or refused, and exists only in hospitals and care facilities. Name the event you are modeling, because each comes from a different table.

How are reversed claims and prescriptions never picked up handled?

They should be kept and linked, not filtered out. A prescription filled and billed but never collected is returned to stock and its claim reversed. Ask for reversals as their own rows with a reference to the claim they cancel, and for the sold date on each fill. You can then derive net dispensing yourself and still study abandonment.

Can refill histories be used to measure adherence?

Partly. Fill dates and days supply support refill-gap measures, but they show possession, not ingestion, and only at the holder's own counters. A patient who changes pharmacy, pays cash elsewhere or is admitted to hospital looks like a gap. A pharmacy benefit manager sees claims across pharmacies but not purchases outside the plan. Ask what the holder sees beyond its own fills.

How are controlled substances and sensitive medications handled?

They should be scoped separately, and are often excluded. A drug name alone can reveal a condition, so medications for HIV, mental health, reproductive health and substance use disorder stay sensitive after names are removed, and controlled-substance and substance use treatment-program records can fall under additional federal and state rules. Say whether you need them, and have counsel confirm which rules apply.

Are prescribers identified in the data?

They should not be, but de-identification does not settle it, so ask exactly how prescribers were treated. A method aimed at patient identity may leave prescriber fields in place, and state rules on prescriber-identifiable prescription data may apply. A pseudonymous prescriber key with specialty keeps prescribing patterns usable. Confirm that NPI, DEA and license numbers were removed, including inside notes, and have counsel review the states involved.

Evaluating this data for procurement?

Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.

Request dataset diligence

Tell us what your models need

Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.

Updated 25 November 2026.

See if your company qualifies