Printer troubleshooting technician providing live chat help

Joe B.

Reviewed for technical accuracy

Specialities: Pharmacy systems (PioneerRx, QS/1, Rx30, PK), Thermal printers (Zebra/Datamax/TSC), Label templates, GS1 barcodes

Compounding log prints wrong batch ID — fix label template mapping, data source, barcode & BUD fields

Technician avatar Technician
Hi! We’ll track down why the compounding log and shipping/dispense labels are printing the wrong batch ID or missing the lot number and BUD (beyond-use date).
A few scoping questions: Which system (PioneerRx, QS/1, Rx30, PK, ScriptPro, custom EMR/EHR) generates the label? Are you using a Zebra or Datamax thermal label printer (ZPL/EPL/DP)? And does the on-screen preview show the correct BatchID while the printed label shows another?
Customer
We’re on PioneerRx with a Zebra ZD420. In the compounding record the batch is CB-241026-17, but printed labels show the previous batch ID. Sometimes the lot number or NDC truncates and our GS1-128 barcode scans as the wrong product.
Technician avatar Technician
Got it. This usually comes down to three buckets:
1) Template mapping: the label template pulls LastBatchID or a cached variable instead of the current CompoundingBatchID. Merged fields for Lot, BUD, or NDC may reference the wrong table/view.
2) Data source/SQL view: the report joins to an outdated view; HL7/JSON feed delays leave yesterday’s batch as “latest”.
3) Thermal printer formatting: ZPL/EPL field length, 203 vs 300 DPI templates, or fit-to-page/scaling in the Windows driver truncates the barcode or text.
Customer
Preview shows the right batch. Only the printed tag is wrong. We do reprint labels from the compounding log the next day—could that be using a cached value?
Technician avatar Technician
Likely. Many pharmacy systems store a Print Context at time of dispense. Reprints can pull the last successful label instead of the live batch record.
Check 1 — Data Source: In the report/label designer, confirm the batch ID field maps to CompoundingBatch.BatchID (or your system’s equivalent) and not a LabelHistory.BatchID field.
Check 2 — Refresh: Enable “Refresh data on print” or disable “Use cached dataset” for that template so the log re-queries the database on each print.
Customer
Our template has placeholders like [[BatchID]], [[LotNumber]], [[BUD]], [[NDC]], and [[GS1]]. How do we verify they point to the correct table?
Technician avatar Technician
Step 1 — Validate merge fields
• Open the label in your Report Builder / Template Designer.
• Inspect data bindings: map [[BatchID]] → Compounding.Batches.BatchID, [[LotNumber]] → Ingredients.Lot, [[BUD]] → CompoundedItem.BeyondUseDate, [[NDC]] → Product.NDC11.
• If you see [[BatchID]] → Dispense.LastBatchID or a LabelHistory table, re-map.
• For [[GS1]] ensure your string concatenates AI codes correctly (e.g., (01)NDC (10)Lot (17)YYMMDD) and uses GS1-128 with proper FNC1 separators.
Customer
Barcodes sometimes fail QA. Scanner says “invalid data” or it scans the NDC but not the lot/expiry. Could DPI or font cause this?
Technician avatar Technician
Step 2 — Fix barcode & thermal settings
• Match template to printer resolution: use the 203-DPI or 300-DPI version that matches your Zebra model.
• In the Windows driver, set Stock size exactly (e.g., 2″×1″), disable Fit to page, and set Print mode to Direct Thermal (if DT media).
• Use ZPL barcode field (e.g., ^BC or ^BX for GS1-128/QR) and let ZPL render it; avoid rasterized barcodes that can blur.
• Ensure the GS1 data string contains FNC1 separators and the (17) expiry date in YYMMDD format so lot/expiry scan reliably.
Customer
Lot numbers over 12 characters get cut off. The batch ID wraps, pushing the BUD off the sticker. Any layout tweaks?
Technician avatar Technician
Step 3 — Prevent truncation
• Set text fields to auto-shrink or reduce point size for long values; enable no wrap and ellipsis if required by policy.
• Reserve fixed blocks: Batch ID (20 chars), Lot (14), BUD (10). Add validation in the template to warn if length exceeds limits.
• If the system supports it, print the batch ID in the human-readable line below the GS1 barcode so both pass verification.
Customer
We also export a compounding log PDF for records. The PDF shows the correct batch, but the small shipping label doesn’t. Could the wrong template be assigned?
Technician avatar Technician
Exactly. Many systems maintain separate templates: Log Sheet vs Dispense/Shipping Label vs Bulk Label.
• Confirm the label profile assigned to “Compounding” uses the updated template.
• For reprints, set the workflow to “Rebuild from current record” not “Reprint last”.
• If you integrate via HL7 or API, verify the BatchID travels in the message (OBX/NTE) and your middleware maps it to the label engine.
Customer
After changes, today’s labels show the right batch ID and the barcode scans. Anything else we should lock down so it doesn’t regress?
Technician avatar Technician
Final checks:
• Version-control your label templates; restrict edits to admins and store them centrally.
• Create a QA test batch with extreme values (long Lot, future BUD, leading zeros in NDC) and print a sample weekly.
• In the printer driver, disable scale to fit and pin the correct stock; lock settings via GPO if on Windows.
Need help implementing validation rules or GS1 strings? Open the chat.
Customer
Perfect — compounding log and label now match, and QA passed. Thank you!
Technician avatar Technician
Summary: When a pharmacy compounding log prints the wrong batch ID, fix the template mapping to current records, refresh the data source (no cached labels), and correct Zebra/Datamax settings so GS1-128 barcodes, lot numbers, NDC, and BUD render at the right DPI without truncation. Want us to review your template via screen-share? Open the chat.

Quick answer: the accepted fix

Accepted fix when the compounding log prints the wrong batch ID: remap label fields to the live Compounding Batch table, disable cached/reprint data, rebuild GS1-128 with correct AIs for NDC, Lot, Expiry (BUD), and match the label template to the thermal printer’s DPI with no scaling.


Root causes — wrong batch ID, missing lot, or BUD on pharmacy labels

Most issues trace to merge field mapping (pulling LabelHistory instead of Compounding.Batches), an outdated SQL view/API cache, or thermal label formatting (wrong DPI, scaling, or field length). If your GS1-128 barcode lacks FNC1 or uses the wrong AI order, scanners read only the NDC but ignore lot/expiry.

How to verify your fix

Print a sample from the current compounding record and a reprint. Confirm the human-readable lines show the same BatchID and Lot. Scan the barcode to validate NDC, lot number, and BUD. If scans fail, recheck DPI, GS1 string, and that scaling is disabled in the driver.

Compounding labels — quick troubleshooting tips

Most printing errors are template, dataset, or DPI/scaling problems.

Quick path: remap fields → refresh data on print → enforce GS1-128 string → set Zebra stock/DPI correctly → add length validation for Batch ID and Lot. This resolves the majority of pharmacy compounding label mismatches.

Disclaimer: This information is AI-generated and intended for general guidance only. For advice specific to your environment, please consult a verified expert on Whizz-Tech before making decisions.


Getting Started Is Easy

Ask for help, 24/7

Members enjoy round-the-clock access to 12,000+ verified Experts, including tech support, mechanics, vets, and more.

Expert will respond in minutes

We match you with an Expert who specializes in your situation. Talk, text, or chat — whichever you prefer.

Save time & money

No scheduling hassles or expensive consults. Membership can save you significant time and money each month.

FAQ

Why does my compounding log print the wrong batch ID?

Reprint workflows and cached datasets often pull LabelHistory instead of the live Compounding.Batches table. Fix the template mapping and enable Refresh data on print.

Lot/BUD missing on the label — system or printer?

Usually template mapping or GS1 string. Confirm [[LotNumber]] and [[BUD]] bind to the correct fields and your GS1-128 includes AIs (10) and (17) with FNC1 separators.

Barcode scans NDC but not lot/expiry — what to change?

Use printer-rendered GS1-128 (ZPL ^BC/^BX), correct AI order, and match label DPI. Disable driver scaling and ensure stock size matches the physical label.

How do we prevent future mismatches?

Version-control templates, restrict edits, schedule a weekly QA test batch, and lock Zebra driver stock/DPI with admin rights or GPO.

Common pharmacy label problems and quick fixes
SymptomLikely causeQuick fix
Wrong Batch ID prints Cached dataset / wrong table (LabelHistory) Remap to live Compounding.Batches; refresh data on print
Lot or BUD missing Field not bound; GS1 string incomplete Bind [[LotNumber]], [[BUD]]; rebuild GS1-128 with AIs (10), (17)
Barcode fails QA Wrong DPI / scaling / raster barcode Use ZPL barcode fields; correct DPI; disable “fit to page”
Text truncated Field length too small; wrapping Auto-shrink; fixed blocks; add validation for long lots

Step-by-step (fast diagnosis)

  1. Open the label template → verify bindings: [[BatchID]], [[LotNumber]], [[BUD]], [[NDC]] map to current compounding tables.
  2. Disable cached datasets; set template to Refresh data on print and reprint from the current record.
  3. Rebuild the GS1 string (AIs 01/10/17) and switch to ZPL barcode objects.
  4. Match DPI and stock size in the Zebra driver; turn off scaling and confirm media type.

Sources

Matt Verified Icon
Matt ● replies in < 1 min
Technician Expert
⭐⭐⭐⭐⭐ Trusted by 27,000+ customers
Avatar
Alex · Expert's Assistant