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
- Enter expiryDate, useWindowStart, useWindowEnd, expiryInclusive. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| expiryDate | Expiry Date | Required. Text; maximum UTF-16 length 8192. |
| useWindowStart | Use Window Start | Required. Text; maximum UTF-16 length 8192. |
| useWindowEnd | Use Window End | Required. Text; maximum UTF-16 length 8192. |
| expiryInclusive | Expiry Inclusive | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| daysToStart | Days To Start | Required. Safe integer. |
| daysToEnd | Days To End | Required. Safe integer. |
| coversWholeWindow | Covers Whole Window | Required. Boolean. |
{
"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
Similar or alternative tools
- Expiry Reference Day Offset
Parse real Gregorian expiryDate and referenceDate and return expiry minus reference in calendar days.
- Stock Expiry Window Remainder
Return expiryDay-currentDay and subtract that reserve for beyondReserve.