Skip to content

Main content

Medicine Expiry Period Gap Tool

Compare explicit inventory expiry metadata with a supplied closed date window and equality rule; no use authorization.

Loading tool…

Description

Parse real Gregorian expiryDate and ordered use-window dates.

Pharmacy inventory distinguishes physical stock, reservations, holds, lots, package units, and expiry records. A stock calculation describes supplied records and cannot establish that a medicine is suitable or authorized for use.

Parse real Gregorian expiryDate and ordered use-window dates.

When to use this tool

Use Medicine Expiry Period Gap when you need one explicit pharmacy stock-accounting component.

How to use the tool and how it works

  1. Enter expiryDate, useWindowStart, useWindowEnd, expiryInclusive. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read daysToStart, daysToEnd, coversWholeWindow. Inspect coversWholeWindow before interpreting the associated values.

Parse real Gregorian expiryDate and ordered use-window dates. Return expiry minus each endpoint in calendar days and compare expiry with the window end using expiryInclusive.1

Input fieldMeaning and unitsAccepted input
expiryDateExpiry DateRequired. Text; maximum UTF-16 length 8192.
useWindowStartUse Window StartRequired. Text; maximum UTF-16 length 8192.
useWindowEndUse Window EndRequired. Text; maximum UTF-16 length 8192.
expiryInclusiveExpiry InclusiveRequired. Boolean.
Output fieldInterpretationReturned shape
daysToStartDays To StartRequired. Safe integer.
daysToEndDays To EndRequired. Safe integer.
coversWholeWindowCovers Whole WindowRequired. Boolean.
json
{
  "input": {
    "expiryDate": "2024-01-10",
    "useWindowStart": "2024-01-01",
    "useWindowEnd": "2024-01-08",
    "expiryInclusive": false
  },
  "output": {
    "daysToStart": 9,
    "daysToEnd": 2,
    "coversWholeWindow": true
  }
}

Limitations and assumptions

  • This is a date-only rule without time-of-day or product-specific expiry interpretation; covering the window does not establish storage compliance or medication suitability.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Reconcile verified inventory and product records within the pharmacy's controlled workflow before purchasing, releasing, or dispensing stock.

References

  1. Calculation and input contract: hospital-pharmacy/medicine-expiry-period-gap — tool.io

Similar or alternative tools