{
  "id": "prescription-refill",
  "version": "b5ae25bc580a",
  "status": "published",
  "name": "Prescription Refill Calculator",
  "question": "When is my next refill?",
  "summary": "Finds the earliest date a pharmacy can refill a prescription, once 75% (or another share) of the days’ supply has passed, and the day the supply runs out.",
  "category": "days",
  "subcategory": "dates",
  "url": "https://www.acalculator.org/days/prescription-refill-calculator",
  "markdown": "https://www.acalculator.org/days/prescription-refill-calculator.md",
  "kind": "function",
  "method": "Days to wait = ⌈days’ supply × share ÷ 100⌉; earliest refill = date filled + days to wait; supply runs out = date filled + days’ supply.",
  "assumptions": [
    "Plans set the share; Colorado Medicaid, for example, uses 75% of the days’ supply, and 85% for controlled drugs. Check your own plan.",
    "Days are calendar days; the fill date is day 0.",
    "From pills and a daily dose, the days’ supply is the whole days the pills last (pills ÷ pills per day, rounded down).",
    "This is a date guide, not medical or insurance advice; the pharmacy and the plan decide."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "fill": {
        "title": "Date last filled",
        "description": "The day the pharmacy last filled the prescription.",
        "type": "string",
        "format": "date"
      },
      "by": {
        "title": "Supply given as",
        "description": "Type the days’ supply on the label, or the number of pills and how many you take a day.",
        "type": "string",
        "enum": [
          "days",
          "pills"
        ]
      },
      "ds": {
        "title": "Days’ supply",
        "description": "How many days the fill lasts, as on the label: often 30 or 90.",
        "type": "integer",
        "minimum": 1,
        "maximum": 1000
      },
      "qty": {
        "title": "Pills (or doses) dispensed",
        "description": "How many pills, tablets or doses the pharmacy gave you.",
        "type": "integer",
        "minimum": 1,
        "maximum": 100000
      },
      "pd": {
        "title": "Pills (or doses) per day",
        "description": "How many you take each day.",
        "type": "number",
        "minimum": 0.01,
        "maximum": 1000
      },
      "pct": {
        "title": "Share of the supply to use first",
        "description": "How much of the days’ supply must pass before a refill, as your plan sets it: often 75%, more for controlled drugs.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 100
      },
      "on": {
        "title": "Count from",
        "description": "The date to count the days from. Today, unless you change it.",
        "type": "string",
        "format": "date"
      }
    }
  },
  "outputs": {
    "earliest": {
      "label": "Earliest refill date",
      "description": "The fill date plus the days to wait: the first day a refill is due under the share chosen.",
      "format": "date-long"
    },
    "status": {
      "label": "Refill",
      "description": "Whether a refill is due on the count-from date, or in how many days.",
      "format": "text"
    },
    "wait": {
      "label": "Days from fill to refill",
      "description": "The days’ supply × the share, rounded up to a whole day.",
      "format": "integer"
    },
    "runOut": {
      "label": "Supply runs out",
      "description": "The fill date plus the days’ supply: the first day with no medicine left.",
      "format": "date-long"
    },
    "daysLeft": {
      "label": "Days of supply left",
      "description": "Days from the count-from date to the day the supply runs out; 0 once it has run out.",
      "format": "integer"
    },
    "supplyDays": {
      "label": "Days’ supply",
      "description": "The days the fill lasts: as typed, or the pills ÷ the pills per day, rounded down.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "fill": "2026-09-12",
      "by": "days",
      "ds": 30,
      "qty": 60,
      "pd": 2,
      "pct": 75,
      "on": "2026-10-02"
    },
    "outputs": {
      "earliest": "2026-10-05",
      "status": "Refill due in 3 days",
      "wait": 23,
      "runOut": "2026-10-12",
      "daysLeft": 10,
      "supplyDays": 30
    },
    "text": "Filled on September 12, 2026 with 30 days’ supply, the earliest refill is Monday, October 5, 2026; the supply runs out on Monday, October 12, 2026."
  },
  "examples": [
    {
      "given": {
        "fill": "2026-09-01",
        "by": "days",
        "ds": 30,
        "pct": 75,
        "on": "2026-09-10"
      },
      "expect": {
        "wait": 23,
        "earliest": "2026-09-24",
        "status": "Refill due in 14 days",
        "runOut": "2026-10-01",
        "daysLeft": 21,
        "supplyDays": 30
      },
      "source": "Colorado Department of Health Care Policy and Financing, Pharmacy Billing Manual (refill too soon: 75% of the days’ supply for non-scheduled drugs, 85% for Schedule II to V), https://hcpf.colorado.gov/pharmacy-billing-manual, retrieved 2026-10-02; hand calculation in content.mdx: 30 × 0.75 = 22.5, rounded up to 23 days; September 1 + 23 days = September 24; Python 3 datetime.date(2026, 9, 1) + datetime.timedelta(23)"
    },
    {
      "given": {
        "fill": "2026-01-15",
        "by": "days",
        "ds": 90,
        "pct": 85,
        "on": "2026-04-20"
      },
      "expect": {
        "wait": 77,
        "earliest": "2026-04-02",
        "status": "Refill due now",
        "runOut": "2026-04-15",
        "daysLeft": 0
      },
      "source": "Colorado Department of Health Care Policy and Financing, Pharmacy Billing Manual (refill too soon: 75% of the days’ supply for non-scheduled drugs, 85% for Schedule II to V), https://hcpf.colorado.gov/pharmacy-billing-manual, retrieved 2026-10-02; hand calculation in content.mdx: 90 × 0.85 = 76.5, so 77 days; January 15 + 77 days = April 2, 2026"
    },
    {
      "given": {
        "fill": "2026-02-20",
        "by": "pills",
        "qty": 45,
        "pd": 2,
        "pct": 80,
        "on": "2026-02-20"
      },
      "expect": {
        "supplyDays": 22,
        "wait": 18,
        "earliest": "2026-03-10",
        "runOut": "2026-03-14"
      },
      "source": "hand calculation in content.mdx: 45 ÷ 2 = 22.5, so 22 days; 22 × 0.8 = 17.6, so 18 days; February 20 + 18 days = March 10, 2026 (28-day February)"
    },
    {
      "given": {
        "fill": "2028-02-01",
        "by": "days",
        "ds": 30,
        "pct": 100,
        "on": "2028-02-29"
      },
      "expect": {
        "earliest": "2028-03-02",
        "status": "Refill due in 2 days"
      },
      "source": "hand calculation in content.mdx: 2028 is a leap year, February 1 + 30 days = March 2, 2028"
    }
  ],
  "sources": [
    "Colorado Department of Health Care Policy and Financing, Pharmacy Billing Manual, Refill Too Soon Policy (75% of the days’ supply for non-scheduled drugs, 85% for DEA Schedule II to V), retrieved 2026-10-02. https://hcpf.colorado.gov/pharmacy-billing-manual"
  ],
  "related": [
    "date",
    "days-until",
    "days-between-dates"
  ],
  "changelog": []
}
