Sources and method
Everything on the console is computed ahead of time by a pipeline of plain scripts that read the files below and write the outputs the console renders. Nothing is computed in the browser. Seed 20260914.
Trust at a glance
- Items forecast
- 164
- Median weekly error
- 11%
- Naive reference
- 13%
- Vendor lines checked
- 380
Files
| File | Rows | Columns | What it is |
|---|---|---|---|
| consumption.csv | 119,720 | date, item_id, qty | Daily hospital-wide usage per item in base units, 24 months. |
| consumption_by_department.csv | 41,055 | date, item_id, department_id, qty | Daily usage by department, last 90 days. |
| contracts.csv | 267 | contract_id, vendor_id, vendor_part_number, contract_price, contract_uom, pack_qty, tier_min_qty, tier_price, effective_start, effective_end, source_doc, item_id_truth | Contracted price per vendor line with effective window and optional volume tier. Extracted from the contract documents in contracts/. |
| departments.csv | 10 | department_id, department_name | Department codes. |
| inventory_onhand.csv | 164 | item_id, location, qty_on_hand, unit_cost, as_of | On-hand quantity and unit cost per item as of today. |
| invoice_lines.csv | 35,275 | invoice_id, po_id, invoice_date, vendor_id, vendor_part_number, qty, sell_uom, unit_price_paid, price_basis, item_id_truth | Invoiced price paid per PO line. The source for all price variance. |
| items.csv | 164 | item_id, canonical_name, type, category, base_uom, criticality, shelf_life_days, storage, ndc, labeler, generic, strength_txt, form, package_desc, unspsc, anchor_unit_price, primary_vendor | Item master. One row per canonical item; pharma rows carry real FDA NDC identities. |
| lots.csv | 120 | lot_id, item_id, location, qty_remaining, received_date, expiry_date, unit_cost | Lot-level quantity and expiry for pharma and dated med-surg items only. |
| planted_scenarios.csv | 25 | scenario_id, scenario_type, item_id, item_name, vendor_id, expected_flag, description | Ground truth for the scorecard. Never read by the analysis steps. |
| po_lines.csv | 35,338 | po_id, order_date, vendor_id, vendor_part_number, qty, sell_uom, unit_price, expected_delivery, received_date, status, note, item_id_truth | Purchase orders over 24 months, including open ones. |
| vendor_catalog.csv | 279 | vendor_id, vendor_part_number, vendor_description, sell_uom, pack_qty, list_price, item_id_truth, purchase_share | Each vendor's own part number, description, and sell unit for every item it carries. item_id_truth is the generator's ground truth for scoring the AI matching step. |
| vendors.csv | 6 | vendor_id, name, type, scope, lead_mean, lead_sd, cycle, terms | Six fictional vendors with lead times and replenishment cycles. |
| contracts/V1_price_schedule.md | — | Generated contract document (price schedule). Input to the AI extraction step. | |
| contracts/V2_price_schedule.md | — | Generated contract document (price schedule). Input to the AI extraction step. | |
| contracts/V3_price_schedule.md | — | Generated contract document (price schedule). Input to the AI extraction step. | |
| contracts/V4_price_schedule.md | — | Generated contract document (price schedule). Input to the AI extraction step. | |
| contracts/V5_price_schedule.md | — | Generated contract document (price schedule). Input to the AI extraction step. | |
| contracts/V6_price_schedule.md | — | Generated contract document (price schedule). Input to the AI extraction step. |
Method, in plain language
Forecast. One method per item, chosen from the research rather than a per-item contest: exponential smoothing with a weekday pattern for regular items, and an intermittent-demand method for items used on fewer than 60% of days. Each item's forecast carries a report card: the model was fit on history up to eight weeks ago and scored against what actually happened since, in weekly totals, alongside a same-weekday-last-week guess for reference.
Stock decisions. Projected on hand is today's stock plus open orders minus the forecast, day by day. Safety stock is the empirical percentile of the model's own error over the lead-time window at the item's service target: 99% for vital items, 95% essential, 90% non-essential. A stockout risk means ordering today cannot fully prevent a dip, an open order lands after the projected stockout, or nothing is in flight and the normal cycle cannot cover it. Overstock means more than 90 days of supply with no build-up ahead. Expiry waste is an earliest-expiry-first simulation: whatever remains in a lot on its expiry date is waste, valued at unit cost.
Price variance. Every invoice line is paired to a canonical item and converted to a price per base unit, so a case of a thousand and a box of a hundred compare honestly. Cross-vendor: each vendor against the best price the hospital already pays. Contract: invoiced against the contracted price for that vendor, tier, and effective window. Lines that looked like variances but were explained by unit conversion, a tier, or the dollar floor are listed as checked, not flagged.
Where AI is used. Only to pair the same item across vendors when descriptions, part numbers, and units differ, and to pull contracted terms out of contract documents. Every dollar figure is arithmetic on that structured output. Until that step runs, pairings are labeled stand-in.
How the data was generated
How this data was generated
Seed 20260914. Everything below is reproducible by running 01_generate.py.
Identities
- 164 items: 98 med-surg, 66 pharmaceutical.
- Pharmaceutical identities (name, strength, dosage form, labeler, package NDC) come from the FDA National Drug Code directory, matched 65/66. Unmatched entries carry a synthetic 99999- NDC and are labeled as such.
- Med-surg descriptions follow GPO catalog conventions. UNSPSC segment 42 (medical supplies) / 51 (drugs).
- Hospital: Cascade Ridge Medical Center, 480 beds. Fictional. Vendors are fictional.
Demand (consumption.csv, 730 days × 164 items, ending 2026-09-14)
- Day-of-week profile (Mon high, weekends low); a separate OR-schedule profile for surgical items (weekends near zero).
- US federal holidays at 62% of normal.
- Winter respiratory season (peak mid-January) on respiratory-tagged supplies and drugs; influenza vaccine peaks mid-October.
- Item-level trend ~N(2%, 3%) per year.
- Two formulary level shifts on 2026-03-01: pantoprazole IV ×0.40, famotidine IV ×2.6.
- 8 intermittent items (crash-cart drugs, oncology, biologics): Bernoulli occurrence × lognormal size. Across all items, 3% of item-days are zero; 7 items exceed 40% zero days.
- Noise: gamma-Poisson (negative binomial), dispersion 12 for smooth items, 3.5 for erratic ones.
- Department split (consumption_by_department.csv) kept for the last 90 days only, multinomial over each item's department weights.
Vendors, catalog, contracts
- Primary vendor by item type (prime distributor / prime wholesaler / manufacturer-direct); ~55% of items have a secondary vendor with a 30% share; some have a drop-ship tertiary.
- Each vendor lists the same item under its own part number, its own description style (caps-abbreviated, catalog title case, or compressed), and its own sell unit (BX/CS/PK/EA). item_id_truth in vendor_catalog.csv is the ground truth the AI matching step is scored against; the analysis never reads it directly once real matches exist.
- Contracts exist for ~78% of vendor-item pairs at 5–16% below list, 1–2 year terms; ~12% carry a volume tier. Contract documents are generated per vendor in contracts/.
- Purchase orders follow each vendor's replenishment cycle (3–30 days); invoices carry the contract price when a contract is in effect, list price otherwise. Lead times ~N(vendor mean, sd).
Inventory
- On-hand sized to 8–22 days of recent demand for distributor items, 25–60 for manufacturer-direct.
- Lots with expiry dates exist only for pharma and dated med-surg (blood tubes, CHG applicators, test kits, culture bottles, glucose strips). Nursing-unit PAR stock has no lot capture, as in real hospitals.
Planted scenarios (25; see planted_scenarios.csv)
- S01 cross_vendor — Nitrile Exam Gloves, Medium, Powder-Free: Northwind charges ~22% more per glove than Meridian and gets 40% of the volume. (expected flag: yes)
- S02 decoy_uom — Nitrile Exam Gloves, Large, Powder-Free: Northwind sells the case (1,000); Meridian sells the box (100). Sell price is ~10x; per-glove price is within 1%. (expected flag: no)
- S03 stockout — N95 Respirator, Regular, NIOSH: Early respiratory uptick: demand doubled over the last 9 days; 3 days on hand; the open PO covers half a day. (expected flag: yes)
- S04 contract — Isolation Gown, AAMI Level 2, Universal: Invoiced 6% above contract for the last 90 days. (expected flag: yes)
- S05 cross_vendor — IV Administration Set, 20 drop, 92 in: Northwind ~19% above Meridian for 45% of volume. (expected flag: yes)
- S06 decoy_uom — Alcohol Prep Pad, Medium, Sterile: Summit sells the case (4,000); Meridian the box (200). Per-pad price identical. (expected flag: no)
- S07 expiry — Chlorhexidine Gluconate Applicator, 3 mL: Dated med-surg item: 4,000 applicators expiring in 45 days against ~60/day. (expected flag: yes)
- S08 cross_vendor — Prefilled Saline Flush Syringe, 10 mL: Summit drop-ship price ~30% above Meridian for 30% of volume. (expected flag: yes)
- S09 decoy_tier — Blood Collection Tube, Lavender (K2 EDTA), 4 mL: Contract lists a tier-2 price for volumes above a threshold the hospital does not reach; invoices match tier 1. (expected flag: no)
- S10 stockout — Nasopharyngeal Swab with Viral Transport Media: Testing volume doubled in the last 8 days; 4 days on hand; nothing on order. (expected flag: yes)
- S11 expiry — Rapid Influenza A/B + COVID-19 Antigen Test Kit: Last season's over-buy: 3,000 kits expiring in 60 days. (expected flag: yes)
- S12 overstock — Abdominal (ABD) Pad, 8 x 10 in, Sterile: Over-ordered; 160 days on hand. (expected flag: yes)
- S13 stockout — Suture, Absorbable Braided (Polyglactin 910), 3-0, 27 in: Manufacturer-direct item with a 3-week lead time and 12 days on hand; nothing on order. (expected flag: yes)
- S14 contract — Surgical Gloves, Sterile, Latex-Free, 7.5: Contract lapsed 75 days ago; invoiced at list (+12%) since. (expected flag: yes)
- S15 overstock — Laparoscopic Trocar, Bladeless, 12 mm: High-cost direct item with 140 days on hand. (expected flag: yes)
- S16 cross_vendor — Cefazolin for Injection, 1 g Vial: Cobalt Rx ~24% above Harborline for 35% of volume. (expected flag: yes)
- S17 cross_vendor — Ondansetron Injection, 4 mg/2 mL Vial: Cobalt Rx ~28% above Harborline for 40% of volume. (expected flag: yes)
- S18 contract — Propofol Injectable Emulsion, 1%, 20 mL Vial: Three recent POs invoiced 15% above contract. (expected flag: yes)
- S19 stockout — Norepinephrine Bitartrate Injection, 4 mg/4 mL Vial: Vital vasopressor with 4 days on hand; the replenishment PO is backordered and not expected for 6 days. (expected flag: yes)
- S20 contract — Enoxaparin Sodium Injection, 40 mg/0.4 mL Prefilled Syringe: Invoiced 9% above contract since a renewal 120 days ago. (expected flag: yes)
- S21 expiry — Alteplase for Injection, 100 mg Vial: 10 vials at ~$8,900 expiring in 40 days against ~0.12 vials/day of use. (expected flag: yes)
- S22 cross_vendor — Sodium Chloride Injection, 0.9%, 1000 mL Bag: Cobalt Rx ~18% above Harborline on the highest-volume fluid. (expected flag: yes)
- S23 overstock — Pantoprazole Sodium for Injection, 40 mg Vial: Formulary switched to famotidine on 2026-03-01; demand fell 60% but stock was sized for the old rate. (expected flag: yes)
- S24 expiry — Carboplatin Injection, 450 mg/45 mL Vial: 200 vials expiring in 55 days against ~2 vials/day of use. (expected flag: yes)
- S25 expiry — Filgrastim Injection, 480 mcg/0.8 mL Prefilled Syringe: 40 syringes at $190 expiring in 30 days against ~1/day of use. (expected flag: yes)
The analysis steps never read planted_scenarios.csv. Only 07_scorecard.py does.