Docs/CSV Import Guide
Setup

CSV Import Guide

Migrate historical controlled-substance records from paper, spreadsheets, or your existing EMR using the VetRx Ledger EMR-agnostic CSV import wizard.

When to use the CSV import

Use the CSV import wizard to:

  • Migrate the last 60–90 days of historical draws and wastes at onboarding
  • Import vial inventory from a spreadsheet when setting up a new clinic location
  • Bulk-load records exported from AVImark, Cornerstone, ezyVet, or any other EMR that can produce a CSV
Important: Imported historical records are marked source: "csv_import"in the ledger and cannot carry cryptographic witness tokens. They establish a starting baseline but should be disclosed as imported records if questioned during an inspection. Use live VetRx Ledger recording for all prospective events.

Required columns

ColumnRequired?ExampleNotes
drugKetamine HClFree text; must match vial drug name exactly if vial already exists
lotA123456Lot number from vial label
event_typeDRAWDRAW, WASTE, REVERSAL, BLIND_COUNT, or ADJUSTMENT
qty2.5Numeric; must be in same unit as vial record
date2025-04-15ISO-8601 date or MM/DD/YYYY
dvm_idDVM-001Administering DVM identifier
tech_idTECH-004Optional; recommended
notesPost-op wasteOptional free-text notes

Optional: Vial columns (auto-creates vials)

If the vial does not already exist in VetRx Ledger, include these columns to auto-create it during import:

ColumnExample
initial_qty10
expiry2026-12-31
ndc0143-9682-01

Step-by-step import

  1. Prepare your CSV file using the column names above. Column order does not matter; the wizard maps headers automatically.
  2. Navigate to Import in the top navigation.
  3. Drag and drop your CSV file onto the upload zone, or click Browse.
  4. VetRx Ledger shows a preview table with column mappings. Correct any mis-mapped columns in the dropdown selectors.
  5. Review the row count and any validation warnings (red rows indicate missing required fields or unrecognised event types).
  6. Click Import N rows. VetRx Ledger processes each row idempotently — re-uploading the same file will not create duplicates.
  7. Review the import summary: rows imported, rows skipped, error details.

Exporting from common EMRs

EMRExport pathNotes
AVImarkReports → Controlled Substances → Export CSVMap Quantityqty; Drugdrug
CornerstoneInventory → CS Log → Save As CSVDate format is MM/DD/YYYY — accepted by the wizard
ezyVetReports → Drug Register → DownloadIncludes lot numbers; map Dispensed to qty
ShepherdAnalytics → Controlled Drugs → ExportUse ISO-8601 date format option if available
Google Sheets / ExcelFile → Download → CSV (.csv)Ensure headers match column names exactly (case-insensitive)

Troubleshooting

ErrorFix
Missing required column: drugRename your column header to drug (case-insensitive)
Invalid event_type: AdministerMap your EMR type to DRAW before importing
qty is not a numberRemove units from the cell — use 2.5 not 2.5 mL
Vial not found for drug / lotAdd initial_qty and expiry columns so VetRx Ledger auto-creates the vial

For bulk migrations or complex CSV mappings, email hello@grantshelf.com — we offer assisted onboarding for multi-location groups.