Skip to content

Main content

Expiry Reference Day Offset Tool

Compare an explicit inventory expiry date under a declared end-date rule without product stability advice.

Loading tool…

Description

Parse real Gregorian expiryDate and referenceDate and return expiry minus reference in calendar days.

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 referenceDate and return expiry minus reference in calendar days.

When to use this tool

Use Expiry Reference Day Offset when you need one explicit pharmacy stock-accounting component.

How to use the tool and how it works

  1. Enter expiryDate, referenceDate, inclusiveExpiry. 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 dayOffset, currentUnderRule. Inspect currentUnderRule before interpreting the associated values.

Parse real Gregorian expiryDate and referenceDate and return expiry minus reference in calendar days. Compare the offset with zero using inclusiveExpiry.1

Input fieldMeaning and unitsAccepted input
expiryDateExpiry DateRequired. Text; maximum UTF-16 length 8192.
referenceDateReference DateRequired. Text; maximum UTF-16 length 8192.
inclusiveExpiryInclusive ExpiryRequired. Boolean.
Output fieldInterpretationReturned shape
dayOffsetDay OffsetRequired. Safe integer.
currentUnderRuleCurrent Under RuleRequired. Boolean.
json
{
  "input": {
    "expiryDate": "2024-03-01",
    "referenceDate": "2024-02-28",
    "inclusiveExpiry": false
  },
  "output": {
    "dayOffset": 2,
    "currentUnderRule": true
  }
}

Limitations and assumptions

  • Date-only comparison does not select the manufacturer's expiry convention or establish product stability, storage quality, or safe use.
  • 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/expiry-reference-day-offset — tool.io

Similar or alternative tools