Dispensing in Healthcare Data Systems

Complete guide to dispensing data elements, abbreviations, and database design for pharmacy and healthcare systems.

What is Dispensing?

Dispensing refers to the process of preparing and providing medications to patients in healthcare and pharmacy settings. In healthcare data systems, dispensing data captures critical information about medication distribution, inventory management, and patient safety.

Common Dispensing Abbreviations

Core Dispensing Terms

AbbreviationFull TermDescription
disp_iddispensing identifierUnique identifier for each dispensing transaction
disp_dtdispensing dateDate medication was dispensed
disp_qtydispensing quantityAmount of medication dispensed
disp_nbrdispensing numberReference number for the dispensing event
disp_locdispensing locationPharmacy or facility location
disp_phrmdispensing pharmacistPharmacist who dispensed the medication
disp_stsdispensing statusCurrent status (completed, pending, cancelled)
disp_typdispensing typeType of dispensing (retail, hospital, mail order)

Related Medication Terms

  • rx_id - prescription identifier
  • med_id - medication identifier
  • ndc_cd - National Drug Code
  • refill_nbr - refill number
  • days_supply - days supply quantity

Database Schema Example

Dispensing Table Design

CREATE TABLE dispensing (
  disp_id VARCHAR(50) PRIMARY KEY,
  rx_id VARCHAR(50) NOT NULL,
  pt_id VARCHAR(50) NOT NULL,
  med_id VARCHAR(50) NOT NULL,
  ndc_cd VARCHAR(20),
  
  -- Dispensing Details
  disp_dt DATE NOT NULL,
  disp_qty DECIMAL(10,2),
  days_supply INT,
  refill_nbr INT,
  
  -- Location & Staff
  disp_loc VARCHAR(100),
  disp_phrm VARCHAR(100),
  
  -- Status & Type
  disp_sts VARCHAR(20),
  disp_typ VARCHAR(50),
  
  -- Audit
  crtd_dt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  upd_dt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  
  -- Foreign Keys
  FOREIGN KEY (rx_id) REFERENCES prescriptions(rx_id),
  FOREIGN KEY (pt_id) REFERENCES patients(pt_id),
  FOREIGN KEY (med_id) REFERENCES medications(med_id)
);

-- Indexes for performance
CREATE INDEX idx_disp_rx ON dispensing(rx_id);
CREATE INDEX idx_disp_pt ON dispensing(pt_id);
CREATE INDEX idx_disp_dt ON dispensing(disp_dt);
CREATE INDEX idx_disp_med ON dispensing(med_id);

Common Dispensing Workflows

1. Retail Pharmacy Dispensing

  • Prescription received
  • Insurance verification
  • Medication preparation
  • Patient counseling
  • Dispensing transaction recorded

2. Hospital Dispensing

  • Order verification
  • Clinical review
  • Medication preparation
  • Administration tracking
  • Inventory management

3. Mail Order Dispensing

  • Prescription processing
  • Medication packaging
  • Shipping coordination
  • Delivery confirmation

Regulatory Compliance

Required Data Elements

According to pharmacy regulations, dispensing records must capture:

Patient Information

  • Patient identifier
  • Patient name
  • Date of birth

Medication Details

  • NDC code
  • Medication name
  • Strength and formulation
  • Quantity dispensed

Prescriber Information

  • Prescriber identifier (NPI)
  • Prescriber name
  • DEA number (for controlled substances)

Dispensing Information

  • Dispensing date
  • Pharmacist identifier
  • Pharmacy location
  • Refill information

Dispensing Abbreviations: Extended Reference

Days Supply & Quantity Terms

AbbreviationFull TermDescription
days_supdays supplyNumber of days the dispensed quantity should last
disp_qty_uomdispensing quantity unit of measureUnit (EA, ML, GM, TAB, CAP)
pkg_qtypackage quantityNumber of packages dispensed
pkg_szpackage sizeQuantity per package
mme_qtymorphine milligram equivalent quantityOpioid strength conversion for safety monitoring

Controlled Substance Terms

  • dea_sch — DEA schedule (I–V)
  • cs_flg — controlled substance flag
  • dea_nbr — prescriber DEA number
  • pdmp_rptd_flg — PDMP reported flag
  • early_fill_flg — early fill indicator

Dispensing Fee & Billing Terms

  • disp_fee — dispensing fee
  • ingr_cost — ingredient cost
  • uc_price — usual and customary price
  • copay_amt — patient copay amount
  • adjud_sts — adjudication status
  • rej_cd — NCPDP rejection code

Medication Adherence Metrics

Pharmacy dispensing data is the primary source for medication adherence measurement — critical for STAR ratings and HEDIS measures.

Proportion of Days Covered (PDC)

PDC is the gold standard adherence metric. A patient is considered adherent when PDC ≥ 80%.

-- Calculate PDC for Diabetes Medications (measurement year)
WITH fills AS (
  SELECT
    d.pt_id,
    d.disp_dt                              AS fill_dt,
    d.disp_dt + d.days_supply             AS end_dt,
    d.days_supply
  FROM dispensing d
  JOIN medications m ON m.med_id = d.med_id
  WHERE m.drug_class IN ('METFORMIN','SULFONYLUREA','DPP4','GLP1','SGLT2','INSULIN')
    AND d.disp_dt BETWEEN '2025-01-01' AND '2025-12-31'
),
covered_days AS (
  SELECT
    pt_id,
    -- Count distinct days covered (handles overlapping fills)
    COUNT(DISTINCT gs::DATE) AS days_covered
  FROM fills,
    LATERAL generate_series(fill_dt, LEAST(end_dt, '2025-12-31'), '1 day') gs
  WHERE gs::DATE >= '2025-01-01'
  GROUP BY pt_id
)
SELECT
  pt_id,
  days_covered,
  365                                      AS measurement_days,
  ROUND(days_covered::DECIMAL / 365, 3)   AS pdc,
  CASE WHEN days_covered >= 292 THEN 'ADHERENT' ELSE 'NON-ADHERENT' END AS adherence_status
FROM covered_days
ORDER BY pdc;

DAW (Dispense As Written) Codes

DAW CodeMeaning
0No product selection indicated (generic dispensed)
1Substitution not allowed — prescriber's instructions
2Substitution allowed — patient requested brand
3Substitution allowed — pharmacist selected brand
4Substitution allowed — generic out of stock
7Substitution not allowed — brand medically necessary
9Other

340B Drug Program Dispensing

The 340B Drug Pricing Program requires covered entities to track 340B-purchased drugs separately from non-340B inventory to prevent diversion or duplicate discounts. Dispensing systems must flag and audit 340B transactions.

ALTER TABLE dispensing ADD COLUMN is_340b_eligible BOOLEAN DEFAULT FALSE;
ALTER TABLE dispensing ADD COLUMN is_340b_purchased BOOLEAN DEFAULT FALSE;
ALTER TABLE dispensing ADD COLUMN contract_pharmacy_id VARCHAR(50);

-- 340B eligibility: patient must be treated at or referred by the covered entity
-- and the drug must be dispensed for the covered entity's patient population
CREATE INDEX idx_disp_340b ON dispensing(is_340b_purchased, disp_dt)
  WHERE is_340b_purchased = TRUE;

Best Practices

Data Quality

  • ✅ Validate NDC codes against FDA database
  • ✅ Capture exact dispensing timestamps
  • ✅ Record lot numbers for medication recall tracking
  • ✅ Document pharmacist verification and DUR overrides
  • ✅ Validate days supply is clinically reasonable for the drug class

Controlled Substance Compliance

  • ✅ Report to state PDMP within required timeframe (typically 24 hours)
  • ✅ Flag and review early fills (refills more than 75% through days supply)
  • ✅ Calculate and flag high MME per day (≥ 90 MME/day triggers CDC guideline review)
  • ✅ Verify DEA schedule against prescriber DEA number

Security & Privacy

  • ✅ Encrypt patient identifiers and sensitive fields
  • ✅ Audit all dispensing record access
  • ✅ HIPAA-compliant logging with user, timestamp, and action
  • ✅ Role-based access — pharmacists vs technicians vs billing staff

Performance Optimization

  • ✅ Partition dispensing table by year/month for large datasets
  • ✅ Index on (pt_id, disp_dt) for patient history queries
  • ✅ Index on (ndc_cd, disp_dt) for drug utilization reports
  • ✅ Archive dispensing records older than 7 years per state requirements