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
- Enter expiryDate, referenceDate, inclusiveExpiry. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| expiryDate | Expiry Date | Required. Text; maximum UTF-16 length 8192. |
| referenceDate | Reference Date | Required. Text; maximum UTF-16 length 8192. |
| inclusiveExpiry | Inclusive Expiry | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| dayOffset | Day Offset | Required. Safe integer. |
| currentUnderRule | Current Under Rule | Required. Boolean. |
{
"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
Similar or alternative tools
- Medicine Expiry Period Gap
Parse real Gregorian expiryDate and ordered use-window dates.
- Stock Expiry Window Remainder
Return expiryDay-currentDay and subtract that reserve for beyondReserve.