When to use an import
Use an import when you are setting up Drug Tracking for the first time or receiving a large order. Each row of the file adds one line of stock to one location, so a 40-vial order across three lots is three rows, not forty. Day-to-day restocking of a single box is quicker with Add items on the location page.
Before you start: Every location in the file must already exist and have a location code, and every drug must already be on your formulary or carry a package NDC so the importer can match it. The Import link sits under Inventory in the menu, which only admins see.
Preparing the file
Click Inventory in the menu, then Import. On the Import Inventory page, click Download the CSV template and fill it in. The header names must stay as they are. A drug row needs:
- location_code - the code of the location receiving the stock, for example
STA4-SAFE. - package_ndc, sku, or product_id - at least one, so the importer can find the drug. The product ID is on the Products page.
- quantity - the number of units, as a whole number.
- lot_number - required for every drug.
- expires_on - required for every drug. Write it as
YYYY-MM-DDorMM/DD/YYYY, or a month only such as03/2027(read as the last day of that month, the way pharmacy labels are). - stock_source -
receivefor a pharmacy or vendor order,manualfor a count correction. Leave it blank to use the default you choose on the page. - unit_price and notes - optional.
Supply rows (gauze, collars, tape) follow the same layout but do not need a lot number or expiration date. Use product_name and category_path for supplies the app has not seen before and they are created for you.
Checking and uploading the file
- Click Inventory in the menu, then Import.
- Pick a Default stock source: Receive from vendor or Manual adjustment.
- Under Inventory CSV, click Choose File and pick your file.
- Click Check file. Nothing is added yet. The page shows how many rows are ready, how many items would be created, and how many have errors, above a grid of every row. The Status column says what each row will do, or why it cannot be imported, and the lot and expiration columns let you confirm they were read correctly.
- Fix mistakes right in the grid: click a cell, type the correction, press Enter, then click Check again. Repeat until every row reads Ready.
- Click Import N rows to add the stock. Any row still showing an error is skipped.
When the import finishes, the page shows Rows processed, Imported, and Errors. The usual reasons a drug row fails are a missing lot number, a missing expiration date, or a location code that does not match.
Fixing errors
Correct the failed rows in the grid and check again before importing. If you already imported the good rows, make a second file with only the fixed rows. Rows that imported the first time must not be uploaded a second time or the stock is doubled.
How the importer finds your drugs
Each row is matched by product ID, then SKU, then package NDC, then by name. Only when nothing matches is a new item created, so re-importing the same names adds stock to the items you already have instead of making duplicates. A row that carries a lot number or expiration date makes its item lot-tracked, which is what keeps those values and shows them on the location page.
Undoing an import, or one line of it
Every upload is kept as its own import. From the same page you can undo the whole import, or use Fix a line to undo or replace one line and leave the rest alone, as long as that stock has not been used since. See Undoing an import.
Worked example
The pharmacy delivers the quarterly controlled substance order to Station 4: 20 fentanyl 100 mcg, lot F2291, expiring 2027-06-30, and 30 midazolam 5 mg across two lots. The supply officer makes a three-row file with STA4-SAFE in every location_code cell, the package NDC and lot number on each row, and the expiration dates, then uploads it with the default source set to Receive from vendor. The result shows 3 of 3 imported, and the safe's Contents list shows the three new lot rows.
Tips
- Read the check screen before confirming. If an import still lands wrong, undo it and fix the file.
- Keep one lot per row. Mixing lots on one row loses the expiration tracking that checkouts rely on.
- Drugs that must carry a QR label still need their labels assigned after the import. Open the location and use Assign QR on the row.