Description
Find the minimum supplied expiry coordinate, retain every matching lot ID in input order, and set tie when more than one record matches.
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.
Find the minimum supplied expiry coordinate, retain every matching lot ID in input order, and set tie when more than one record matches.
When to use this tool
Use Medicine Lot Expiry Tie Token when you need one explicit pharmacy stock-accounting component.
How to use the tool and how it works
- Enter lotIds, expiryDayIndices. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read earliestLots, tie. Inspect tie before interpreting the associated values.
Require aligned nonempty lotIds and expiryDayIndices. Find the minimum supplied expiry coordinate, retain every matching lot ID in input order, and set tie when more than one record matches.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| lotIds | Lot Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| expiryDayIndices | Expiry Day Indices | Required. Array of safe integer; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| earliestLots | Earliest Lots | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| tie | Tie | Required. Boolean. |
{
"input": {
"lotIds": [
"A",
"B",
"C"
],
"expiryDayIndices": [
10,
8,
8
]
},
"output": {
"earliestLots": [
"B",
"C"
],
"tie": true
}
} Limitations and assumptions
- Duplicate lot IDs are not deduplicated; coordinates are supplied rather than verified dates, and the result does not authorize product release or establish stability.
- 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 First Out Tie Rule
Sort by expiry day, then received day, then original index, returning ordered IDs and originalIndices.
- Medicine Expiry Period Gap
Parse real Gregorian expiryDate and ordered use-window dates.