DIN Matching Without Errors: A Practical Guide for Pharmacy Managers
DIN matching is the step where automation most commonly goes wrong. Understanding how it works — and where it breaks down — helps pharmacy managers choose the right tool and audit their results.
Why DIN matching fails with OCR-only tools
OCR (optical character recognition) reads the text on a prescription image and returns a string. For DIN matching, that string might be “atorvastatin 20mg” or “Lipitor 20 mg” — but the OCR tool doesn’t know what your Kroll formulary carries, what DINs you stock, or whether the 20 mg product is listed as “20mg” or “20 mg” in your system.
OCR-only tools handle this gap in one of two ways:
- Best-guess string match — pick the DIN whose name most closely resembles the extracted text. Works for simple cases; breaks on brand/generic confusion, multi-strength products, and non-standard drug names.
- Pass to human — route everything to staff for manual DIN selection. Not automation; just structured OCR.
Both approaches increase the risk of a wrong-drug or wrong-strength selection, and neither is using your actual formulary to confirm the match.
What grounded DIN matching does
Grounded DIN matching means the AI agent selects a DIN by checking the prescription against your actual Kroll drug catalog — not just the extracted text string.
The process:
- Extract drug name, strength, form, and manufacturer from the prescription image
- Look up matching products in your Kroll drug catalog
- If a confident match exists in your formulary: select it
- If no match in your formulary: fall back to Health Canada’s Drug Product Database (DPD)
- If no confident match anywhere: route to exception queue with the closest candidates displayed
This approach means the agent is always working from real, current data — not a static drug database bundled with the software.
Drug catalog vs. DPD fallback
Your Kroll drug catalog is the primary lookup. It reflects the products your pharmacy actually carries: your stocked brands, generics, package sizes, and any preferred manufacturer settings you have configured. Matching here first means the selected DIN is always one you can dispense.
The DPD fallback covers the gap when a prescription is for a product you don’t currently stock or when the drug name on the fax doesn’t match your catalog entries exactly. Health Canada’s Drug Product Database lists all approved drugs by DIN, with active ingredient, strength, route, and manufacturer. AutoRx queries it in real time — not from a static snapshot.
What this means in practice:
- Brand-to-generic swaps are handled using your formulary preference settings
- Products you don’t stock are flagged, not silently matched to the nearest thing you do carry
- Recently approved drugs not yet in your catalog can be identified via DPD
Compounding and no-DIN scenarios
Compounded prescriptions often have no DIN — they’re prepared in-house using your pharmacy’s formulation library. AutoRx handles this through a separate read path: the mix catalog in Kroll.
For no-DIN prescriptions:
- The agent reads the compound name, ingredients, vehicle, and concentration from the prescription
- It queries your Kroll mix catalog for a matching formulation
- If a match is found: routes as a normal compound write with the formulation flagged for pharmacist review
- If no match: routes to exception queue with the closest catalog matches displayed and a confidence level indicator
Novel compounds — formulations not in your mix catalog at all — always go to exception. The agent does not attempt to construct a formulation from scratch.
How to audit DIN match accuracy
Your AutoRx dashboard records the DIN match result for every processed prescription. To audit:
Weekly check:
- Filter by status: exceptions with failure reason “DIN not matched”
- Look for patterns: is one drug appearing repeatedly? That usually means a product is in your catalog under a non-standard name, or a new generic has launched that’s not in your formulary yet
Monthly check:
- Pull the DIN match confidence distribution: what percentage of successful writes were high-confidence vs. medium-confidence matches?
- A rising share of medium-confidence matches can indicate catalog drift (stocked products have changed but the catalog hasn’t been updated)
When something looks wrong:
- Check the original document against the Kroll write record in the dashboard
- If a DIN was matched incorrectly, flag it via the dashboard — this feeds the system’s calibration
- Update your Kroll catalog if the root cause is a stocking change
What to ask automation vendors about DIN matching
Before signing with a vendor, ask these questions:
- Does your tool read our Kroll drug catalog, or does it match against its own drug database? The right answer is your catalog. A proprietary database doesn’t know what you stock.
- What happens when there’s no match? It should go to a human queue, not be silently skipped or force-matched.
- How do you handle brand vs. generic? Should follow your formulary preference settings, not a hardcoded rule.
- What is your DIN match accuracy rate on first attempt? Ask for this number and what it’s measured against. A credible vendor can answer with specifics.
- How is the mix catalog used for compounding? If they don’t mention the mix catalog, they’re not integrated with it.
For more on how AutoRx approaches DIN matching: Intelligent DIN Matching · Kroll Integration.
