```html <!doctype html>
Last updated: 2025-09-14
We built a monthly NDC11 × date panel by merging IQVIA volumes, Medicaid SDUD units/prescriptions/spend, and NADAC prices. Pre-Jul 2019 IQVIA rows lacked NDCs, so we backfilled them using a product signature from 2019+, optionally splitting across multiple NDCs by 2019+ shares.
Data/ root)06 - Metformin Data/IQVIA/Metformin Jul 2019 - Jun 2025 NDC Level.xlsx (sheets: TRx, Extended Units)06 - Metformin Data/IQVIA/Metformin Jan 2015 - Mar 2025 No NDC.xlsx (drop “Grand Total”, use months ≤ 2019-06)04 - Medicaid - SDUD/sdud_monthly_national.parquet11 - Medicaid - NADAC/ with NADAC_*.csv00000000000; remove invalid placeholders.Canonicalized concat of Combined Molecule + Manufacturer + Prod Form2 + Product Sum + Strength (separates GLUCOPHAGE vs GLUCOPHAGE XR).
ndc11, signature, date, metric∈{TRx, Extended Units}, volume + meta.--share-min; save signature_to_ndc_mapping.csv.signature, date, metric, volume (drop “Grand Total”).alloc_share) or modal (pick top NDC).iqvia_trx, iqvia_extended_units. Meta kept via per-NDC mode.Audit: pre_allocation_audit.csv compares pre-2019 source vs allocated totals by (signature, date, metric); delta ≈ 0.
Aggregate to ndc11 × month (national): units, prescriptions, and spend; derive:
sdud_price_total_per_unit = total_amount_reimbursed / sdud_units_reimbursedsdud_price_medicaid_per_unit = medicaid_amount_reimbursed / sdud_units_reimbursedNormalize all weekly files and average to month-end: nadac_price (mean), n_obs, pricing_unit_mode. Optional filter --nadac-units (e.g., EA).
iqvia_with_sdud_nadac.cleaned.csv with keys, meta, IQVIA, SDUD, and NADAC fields.signature_to_ndc_mapping.csvpre_allocation_audit.csvpython -u src/iqvia_with_sdud_nadac.py \
--data-dir "<path to Data root>" \
--iqvia-xlsx "06 - Metformin Data/IQVIA/Metformin Jul 2019 - Jun 2025 NDC Level.xlsx" \
--iqvia-pre2019-xlsx "06 - Metformin Data/IQVIA/Metformin Jan 2015 - Mar 2025 No NDC.xlsx" \
--out-csv "06 - Metformin Data/IQVIA/iqvia_with_sdud_nadac.cleaned.csv" \
--mapping-csv "06 - Metformin Data/IQVIA/signature_to_ndc_mapping.csv" \
--nadac-units EA \
--pre-mapping-strategy proportional \
--share-min 0.01
ndc11: 11-digit National Drug Code (5–4–2)date: month-end (YYYY-MM-DD)iqvia_trx / iqvia_extended_units: IQVIA volumessdud_units_reimbursed, sdud_num_prescriptions: SDUD totalstotal_amount_reimbursed, medicaid_amount_reimbursed: SDUD spendsdud_price_total_per_unit, sdud_price_medicaid_per_unit: SDUD implied pricesnadac_price: average NADAC per unit; with pricing_unit_mode, n_obsCombined Molecule, Manufacturer, Prod Form2, Product Sum, Strength